diff --git a/tools/ui/node_modules/workbox-build/build/index.d.ts b/tools/ui/node_modules/workbox-build/build/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2bba846df479175282341d3eb60184a4258c65be --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/index.d.ts @@ -0,0 +1,10 @@ +import { copyWorkboxLibraries } from './lib/copy-workbox-libraries'; +import { getModuleURL } from './lib/cdn-utils'; +import { generateSW } from './generate-sw'; +import { getManifest } from './get-manifest'; +import { injectManifest } from './inject-manifest'; +/** + * @module workbox-build + */ +export { copyWorkboxLibraries, generateSW, getManifest, getModuleURL, injectManifest, }; +export * from './types'; diff --git a/tools/ui/node_modules/workbox-build/build/index.js b/tools/ui/node_modules/workbox-build/build/index.js new file mode 100644 index 0000000000000000000000000000000000000000..78dfdd014e7c07b7df32a351876df64b394878c4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/index.js @@ -0,0 +1,35 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.injectManifest = exports.getModuleURL = exports.getManifest = exports.generateSW = exports.copyWorkboxLibraries = void 0; +const copy_workbox_libraries_1 = require("./lib/copy-workbox-libraries"); +Object.defineProperty(exports, "copyWorkboxLibraries", { enumerable: true, get: function () { return copy_workbox_libraries_1.copyWorkboxLibraries; } }); +const cdn_utils_1 = require("./lib/cdn-utils"); +Object.defineProperty(exports, "getModuleURL", { enumerable: true, get: function () { return cdn_utils_1.getModuleURL; } }); +const generate_sw_1 = require("./generate-sw"); +Object.defineProperty(exports, "generateSW", { enumerable: true, get: function () { return generate_sw_1.generateSW; } }); +const get_manifest_1 = require("./get-manifest"); +Object.defineProperty(exports, "getManifest", { enumerable: true, get: function () { return get_manifest_1.getManifest; } }); +const inject_manifest_1 = require("./inject-manifest"); +Object.defineProperty(exports, "injectManifest", { enumerable: true, get: function () { return inject_manifest_1.injectManifest; } }); +__exportStar(require("./types"), exports); diff --git a/tools/ui/node_modules/workbox-build/build/inject-manifest.d.ts b/tools/ui/node_modules/workbox-build/build/inject-manifest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..07a463fee4609398cfc6642d7e89b16ec12f46b5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/inject-manifest.d.ts @@ -0,0 +1,30 @@ +import { BuildResult, InjectManifestOptions } from './types'; +/** + * This method creates a list of URLs to precache, referred to as a "precache + * manifest", based on the options you provide. + * + * The manifest is injected into the `swSrc` file, and the placeholder string + * `injectionPoint` determines where in the file the manifest should go. + * + * The final service worker file, with the manifest injected, is written to + * disk at `swDest`. + * + * This method will not compile or bundle your `swSrc` file; it just handles + * injecting the manifest. + * + * ``` + * // The following lists some common options; see the rest of the documentation + * // for the full set of options and defaults. + * const {count, size, warnings} = await injectManifest({ + * dontCacheBustURLsMatching: [new RegExp('...')], + * globDirectory: '...', + * globPatterns: ['...', '...'], + * maximumFileSizeToCacheInBytes: ..., + * swDest: '...', + * swSrc: '...', + * }); + * ``` + * + * @memberof workbox-build + */ +export declare function injectManifest(config: InjectManifestOptions): Promise; diff --git a/tools/ui/node_modules/workbox-build/build/inject-manifest.js b/tools/ui/node_modules/workbox-build/build/inject-manifest.js new file mode 100644 index 0000000000000000000000000000000000000000..60e3d2bb51c11a19fbbedbad65e101082ec41c36 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/inject-manifest.js @@ -0,0 +1,133 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.injectManifest = void 0; +const assert_1 = __importDefault(require("assert")); +const fs_extra_1 = __importDefault(require("fs-extra")); +const fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify")); +const upath_1 = __importDefault(require("upath")); +const errors_1 = require("./lib/errors"); +const escape_regexp_1 = require("./lib/escape-regexp"); +const get_file_manifest_entries_1 = require("./lib/get-file-manifest-entries"); +const get_source_map_url_1 = require("./lib/get-source-map-url"); +const rebase_path_1 = require("./lib/rebase-path"); +const replace_and_update_source_map_1 = require("./lib/replace-and-update-source-map"); +const translate_url_to_sourcemap_paths_1 = require("./lib/translate-url-to-sourcemap-paths"); +const validate_options_1 = require("./lib/validate-options"); +/** + * This method creates a list of URLs to precache, referred to as a "precache + * manifest", based on the options you provide. + * + * The manifest is injected into the `swSrc` file, and the placeholder string + * `injectionPoint` determines where in the file the manifest should go. + * + * The final service worker file, with the manifest injected, is written to + * disk at `swDest`. + * + * This method will not compile or bundle your `swSrc` file; it just handles + * injecting the manifest. + * + * ``` + * // The following lists some common options; see the rest of the documentation + * // for the full set of options and defaults. + * const {count, size, warnings} = await injectManifest({ + * dontCacheBustURLsMatching: [new RegExp('...')], + * globDirectory: '...', + * globPatterns: ['...', '...'], + * maximumFileSizeToCacheInBytes: ..., + * swDest: '...', + * swSrc: '...', + * }); + * ``` + * + * @memberof workbox-build + */ +async function injectManifest(config) { + const options = (0, validate_options_1.validateInjectManifestOptions)(config); + // Make sure we leave swSrc and swDest out of the precache manifest. + for (const file of [options.swSrc, options.swDest]) { + options.globIgnores.push((0, rebase_path_1.rebasePath)({ + file, + baseDirectory: options.globDirectory, + })); + } + const globalRegexp = new RegExp((0, escape_regexp_1.escapeRegExp)(options.injectionPoint), 'g'); + const { count, size, manifestEntries, warnings } = await (0, get_file_manifest_entries_1.getFileManifestEntries)(options); + let swFileContents; + try { + swFileContents = await fs_extra_1.default.readFile(options.swSrc, 'utf8'); + } + catch (error) { + throw new Error(`${errors_1.errors['invalid-sw-src']} ${error instanceof Error && error.message ? error.message : ''}`); + } + const injectionResults = swFileContents.match(globalRegexp); + // See https://github.com/GoogleChrome/workbox/issues/2230 + const injectionPoint = options.injectionPoint ? options.injectionPoint : ''; + if (!injectionResults) { + if (upath_1.default.resolve(options.swSrc) === upath_1.default.resolve(options.swDest)) { + throw new Error(`${errors_1.errors['same-src-and-dest']} ${injectionPoint}`); + } + throw new Error(`${errors_1.errors['injection-point-not-found']} ${injectionPoint}`); + } + (0, assert_1.default)(injectionResults.length === 1, `${errors_1.errors['multiple-injection-points']} ${injectionPoint}`); + const manifestString = (0, fast_json_stable_stringify_1.default)(manifestEntries); + const filesToWrite = {}; + const url = (0, get_source_map_url_1.getSourceMapURL)(swFileContents); + // See https://github.com/GoogleChrome/workbox/issues/2957 + const { destPath, srcPath, warning } = (0, translate_url_to_sourcemap_paths_1.translateURLToSourcemapPaths)(url, options.swSrc, options.swDest); + if (warning) { + warnings.push(warning); + } + // If our swSrc file contains a sourcemap, we would invalidate that + // mapping if we just replaced injectionPoint with the stringified manifest. + // Instead, we need to update the swDest contents as well as the sourcemap + // (assuming it's a real file, not a data: URL) at the same time. + // See https://github.com/GoogleChrome/workbox/issues/2235 + // and https://github.com/GoogleChrome/workbox/issues/2648 + if (srcPath && destPath) { + const originalMap = (await fs_extra_1.default.readJSON(srcPath, { + encoding: 'utf8', + })); + const { map, source } = await (0, replace_and_update_source_map_1.replaceAndUpdateSourceMap)({ + originalMap, + jsFilename: upath_1.default.basename(options.swDest), + originalSource: swFileContents, + replaceString: manifestString, + searchString: options.injectionPoint, + }); + filesToWrite[options.swDest] = source; + filesToWrite[destPath] = map; + } + else { + // If there's no sourcemap associated with swSrc, a simple string + // replacement will suffice. + filesToWrite[options.swDest] = swFileContents.replace(globalRegexp, manifestString); + } + for (const [file, contents] of Object.entries(filesToWrite)) { + try { + await fs_extra_1.default.mkdirp(upath_1.default.dirname(file)); + } + catch (error) { + throw new Error(errors_1.errors['unable-to-make-sw-directory'] + + ` '${error instanceof Error && error.message ? error.message : ''}'`); + } + await fs_extra_1.default.writeFile(file, contents); + } + return { + count, + size, + warnings, + // Use upath.resolve() to make all the paths absolute. + filePaths: Object.keys(filesToWrite).map((f) => upath_1.default.resolve(f)), + }; +} +exports.injectManifest = injectManifest; diff --git a/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.d.ts b/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..566c70ac0b4edca6460acdd3d6dde8205a78c3a8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.d.ts @@ -0,0 +1,13 @@ +import { ManifestEntry } from '../types'; +type AdditionalManifestEntriesTransform = { + (manifest: Array): { + manifest: Array; + warnings: string[]; + }; +}; +export declare function additionalManifestEntriesTransform(additionalManifestEntries: Array): AdditionalManifestEntriesTransform; +export {}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.js b/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.js new file mode 100644 index 0000000000000000000000000000000000000000..454025ba22c10967ad44d647a880dda862786742 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/additional-manifest-entries-transform.js @@ -0,0 +1,47 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.additionalManifestEntriesTransform = void 0; +const errors_1 = require("./errors"); +function additionalManifestEntriesTransform(additionalManifestEntries) { + return (manifest) => { + const warnings = []; + const stringEntries = new Set(); + for (const additionalEntry of additionalManifestEntries) { + // Warn about either a string or an object that lacks a revision property. + // (An object with a revision property set to null is okay.) + if (typeof additionalEntry === 'string') { + stringEntries.add(additionalEntry); + manifest.push({ + revision: null, + size: 0, + url: additionalEntry, + }); + } + else { + if (additionalEntry && additionalEntry.revision === undefined) { + stringEntries.add(additionalEntry.url); + } + manifest.push(Object.assign({ size: 0 }, additionalEntry)); + } + } + if (stringEntries.size > 0) { + let urls = '\n'; + for (const stringEntry of stringEntries) { + urls += ` - ${stringEntry}\n`; + } + warnings.push(errors_1.errors['string-entry-warning'] + urls); + } + return { + manifest, + warnings, + }; + }; +} +exports.additionalManifestEntriesTransform = additionalManifestEntriesTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/bundle.d.ts b/tools/ui/node_modules/workbox-build/build/lib/bundle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f336f6eb154dd26b15ee063e418aba0ab715ce1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/bundle.d.ts @@ -0,0 +1,9 @@ +import { GeneratePartial, RequiredSWDestPartial } from '../types'; +interface NameAndContents { + contents: string | Uint8Array; + name: string; +} +export declare function bundle({ babelPresetEnvTargets, inlineWorkboxRuntime, mode, sourcemap, swDest, unbundledCode, }: Omit & RequiredSWDestPartial & { + unbundledCode: string; +}): Promise>; +export {}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/bundle.js b/tools/ui/node_modules/workbox-build/build/lib/bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..f31d54eefaca68c5ef8f3819f442504017b067dd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/bundle.js @@ -0,0 +1,133 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bundle = void 0; +const plugin_babel_1 = require("@rollup/plugin-babel"); +const plugin_node_resolve_1 = require("@rollup/plugin-node-resolve"); +const rollup_1 = require("rollup"); +const plugin_terser_1 = __importDefault(require("@rollup/plugin-terser")); +const fs_extra_1 = require("fs-extra"); +const rollup_plugin_off_main_thread_1 = __importDefault(require("@trickfilm400/rollup-plugin-off-main-thread")); +const preset_env_1 = __importDefault(require("@babel/preset-env")); +const plugin_replace_1 = __importDefault(require("@rollup/plugin-replace")); +const tempy_1 = __importDefault(require("tempy")); +const upath_1 = __importDefault(require("upath")); +async function bundle({ babelPresetEnvTargets, inlineWorkboxRuntime, mode, sourcemap, swDest, unbundledCode, }) { + // We need to write this to the "real" file system, as Rollup won't read from + // a custom file system. + const { dir, base } = upath_1.default.parse(swDest); + const temporaryFile = tempy_1.default.file({ name: base }); + await (0, fs_extra_1.writeFile)(temporaryFile, unbundledCode); + const plugins = [ + (0, plugin_node_resolve_1.nodeResolve)(), + (0, plugin_replace_1.default)({ + // See https://github.com/GoogleChrome/workbox/issues/2769 + 'preventAssignment': true, + 'process.env.NODE_ENV': JSON.stringify(mode), + }), + (0, plugin_babel_1.babel)({ + babelHelpers: 'bundled', + // Disable the logic that checks for local Babel config files: + // https://github.com/GoogleChrome/workbox/issues/2111 + babelrc: false, + configFile: false, + presets: [ + [ + preset_env_1.default, + { + targets: { + browsers: babelPresetEnvTargets, + }, + loose: true, + }, + ], + ], + }), + ]; + if (mode === 'production') { + plugins.push((0, plugin_terser_1.default)({ + mangle: { + toplevel: true, + properties: { + regex: /(^_|_$)/, + }, + }, + })); + } + const rollupConfig = { + plugins, + input: temporaryFile, + }; + // Rollup will inline the runtime by default. If we don't want that, we need + // to add in some additional config. + if (!inlineWorkboxRuntime) { + // No lint for omt(), library has no types. + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + rollupConfig.plugins.unshift((0, rollup_plugin_off_main_thread_1.default)()); + } + const bundle = await (0, rollup_1.rollup)(rollupConfig); + const outputOptions = { + sourcemap, + // Using an external Workbox runtime requires 'amd'. + format: inlineWorkboxRuntime ? 'es' : 'amd', + }; + if (!inlineWorkboxRuntime) { + outputOptions.manualChunks = (id) => { + return id.includes('workbox') ? 'workbox' : undefined; + }; + outputOptions.hashCharacters = 'hex'; + } + const { output } = await bundle.generate(outputOptions); + const files = []; + for (const chunkOrAsset of output) { + if (chunkOrAsset.type === 'asset') { + if (!files.some((f) => f.name === chunkOrAsset.fileName)) { + files.push({ + name: chunkOrAsset.fileName, + contents: chunkOrAsset.source, + }); + } + } + else { + let code = chunkOrAsset.code; + if (chunkOrAsset.map) { + const sourceMapFile = chunkOrAsset.fileName + '.map'; + code += `//# sourceMappingURL=${sourceMapFile}\n`; + if (!files.some((f) => f.name === sourceMapFile)) { + files.push({ + name: sourceMapFile, + contents: chunkOrAsset.map.toString(), + }); + } + } + if (!files.some((f) => f.name === chunkOrAsset.fileName)) { + files.push({ + name: chunkOrAsset.fileName, + contents: code, + }); + } + } + } + // Make sure that if there was a directory portion included in swDest, it's + // preprended to all of the generated files. + return files.map((file) => { + file.name = upath_1.default.format({ + dir, + base: file.name, + ext: '', + name: '', + root: '', + }); + return file; + }); +} +exports.bundle = bundle; diff --git a/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.d.ts b/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39f86fc0ed77cec09e0892a9de7c5f0abc9b8e06 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.d.ts @@ -0,0 +1,2 @@ +import { BuildType } from '../types'; +export declare function getModuleURL(moduleName: string, buildType: BuildType): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.js b/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..80ddc97f990545328fc46173f92bb09dd9f7aa56 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/cdn-utils.js @@ -0,0 +1,57 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getModuleURL = void 0; +const assert_1 = require("assert"); +const errors_1 = require("./errors"); +const cdn = __importStar(require("../cdn-details.json")); +function getVersionedURL() { + return `${getCDNPrefix()}/${cdn.latestVersion}`; +} +function getCDNPrefix() { + return `${cdn.origin}/${cdn.bucketName}/${cdn.releasesDir}`; +} +function getModuleURL(moduleName, buildType) { + (0, assert_1.ok)(moduleName, errors_1.errors['no-module-name']); + if (buildType) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const pkgJson = require(`${moduleName}/package.json`); + if (buildType === 'dev' && pkgJson.workbox && pkgJson.workbox.prodOnly) { + // This is not due to a public-facing exception, so just throw an Error(), + // without creating an entry in errors.js. + throw Error(`The 'dev' build of ${moduleName} is not available.`); + } + return `${getVersionedURL()}/${moduleName}.${buildType.slice(0, 4)}.js`; + } + return `${getVersionedURL()}/${moduleName}.js`; +} +exports.getModuleURL = getModuleURL; diff --git a/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.d.ts b/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4906368cb25cc2e5b044303fbb53e006c003bf10 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.d.ts @@ -0,0 +1,20 @@ +/** + * This copies over a set of runtime libraries used by Workbox into a + * local directory, which should be deployed alongside your service worker file. + * + * As an alternative to deploying these local copies, you could instead use + * Workbox from its official CDN URL. + * + * This method is exposed for the benefit of developers using + * {@link workbox-build.injectManifest} who would + * prefer not to use the CDN copies of Workbox. Developers using + * {@link workbox-build.generateSW} don't need to + * explicitly call this method. + * + * @param {string} destDirectory The path to the parent directory under which + * the new directory of libraries will be created. + * @return {Promise} The name of the newly created directory. + * + * @alias workbox-build.copyWorkboxLibraries + */ +export declare function copyWorkboxLibraries(destDirectory: string): Promise; diff --git a/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.js b/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.js new file mode 100644 index 0000000000000000000000000000000000000000..5d58a9efe75c67a63df51cac66bd896e32ada1ce --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/copy-workbox-libraries.js @@ -0,0 +1,69 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.copyWorkboxLibraries = void 0; +const fs_extra_1 = __importDefault(require("fs-extra")); +const upath_1 = __importDefault(require("upath")); +const errors_1 = require("./errors"); +// Used to filter the libraries to copy based on our package.json dependencies. +const WORKBOX_PREFIX = 'workbox-'; +// The directory within each package containing the final bundles. +const BUILD_DIR = 'build'; +/** + * This copies over a set of runtime libraries used by Workbox into a + * local directory, which should be deployed alongside your service worker file. + * + * As an alternative to deploying these local copies, you could instead use + * Workbox from its official CDN URL. + * + * This method is exposed for the benefit of developers using + * {@link workbox-build.injectManifest} who would + * prefer not to use the CDN copies of Workbox. Developers using + * {@link workbox-build.generateSW} don't need to + * explicitly call this method. + * + * @param {string} destDirectory The path to the parent directory under which + * the new directory of libraries will be created. + * @return {Promise} The name of the newly created directory. + * + * @alias workbox-build.copyWorkboxLibraries + */ +async function copyWorkboxLibraries(destDirectory) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const thisPkg = require('../../package.json'); + // Use the version string from workbox-build in the name of the parent + // directory. This should be safe, because lerna will bump workbox-build's + // pkg.version whenever one of the dependent libraries gets bumped, and we + // care about versioning the dependent libraries. + const workboxDirectoryName = `workbox-v${thisPkg.version ? thisPkg.version : ''}`; + const workboxDirectoryPath = upath_1.default.join(destDirectory, workboxDirectoryName); + await fs_extra_1.default.ensureDir(workboxDirectoryPath); + const copyPromises = []; + const librariesToCopy = Object.keys(thisPkg.dependencies || {}).filter((dependency) => dependency.startsWith(WORKBOX_PREFIX)); + for (const library of librariesToCopy) { + // Get the path to the package on the user's filesystem by require-ing + // the package's `package.json` file via the node resolution algorithm. + const libraryPath = upath_1.default.dirname(require.resolve(`${library}/package.json`)); + const buildPath = upath_1.default.join(libraryPath, BUILD_DIR); + // fse.copy() copies all the files in a directory, not the directory itself. + // See https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy.md#copysrc-dest-options-callback + copyPromises.push(fs_extra_1.default.copy(buildPath, workboxDirectoryPath)); + } + try { + await Promise.all(copyPromises); + return workboxDirectoryName; + } + catch (error) { + throw Error(`${errors_1.errors['unable-to-copy-workbox-libraries']} ${error instanceof Error ? error.toString() : ''}`); + } +} +exports.copyWorkboxLibraries = copyWorkboxLibraries; diff --git a/tools/ui/node_modules/workbox-build/build/lib/errors.d.ts b/tools/ui/node_modules/workbox-build/build/lib/errors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31b1642d164ff945ff65e709dcd835c1b12f84d7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/errors.d.ts @@ -0,0 +1,61 @@ +export declare const errors: { + 'unable-to-get-rootdir': string; + 'no-extension': string; + 'invalid-file-manifest-name': string; + 'unable-to-get-file-manifest-name': string; + 'invalid-sw-dest': string; + 'unable-to-get-sw-name': string; + 'unable-to-get-save-config': string; + 'unable-to-get-file-hash': string; + 'unable-to-get-file-size': string; + 'unable-to-glob-files': string; + 'unable-to-make-manifest-directory': string; + 'read-manifest-template-failure': string; + 'populating-manifest-tmpl-failed': string; + 'manifest-file-write-failure': string; + 'unable-to-make-sw-directory': string; + 'read-sw-template-failure': string; + 'sw-write-failure': string; + 'sw-write-failure-directory': string; + 'unable-to-copy-workbox-libraries': string; + 'invalid-generate-sw-input': string; + 'invalid-glob-directory': string; + 'invalid-dont-cache-bust': string; + 'invalid-exclude-files': string; + 'invalid-get-manifest-entries-input': string; + 'invalid-manifest-path': string; + 'invalid-manifest-entries': string; + 'invalid-manifest-format': string; + 'invalid-static-file-globs': string; + 'invalid-templated-urls': string; + 'templated-url-matches-glob': string; + 'invalid-glob-ignores': string; + 'manifest-entry-bad-url': string; + 'modify-url-prefix-bad-prefixes': string; + 'invalid-inject-manifest-arg': string; + 'injection-point-not-found': string; + 'multiple-injection-points': string; + 'populating-sw-tmpl-failed': string; + 'useless-glob-pattern': string; + 'bad-template-urls-asset': string; + 'invalid-runtime-caching': string; + 'static-file-globs-deprecated': string; + 'dynamic-url-deprecated': string; + 'urlPattern-is-required': string; + 'handler-is-required': string; + 'invalid-generate-file-manifest-arg': string; + 'invalid-sw-src': string; + 'same-src-and-dest': string; + 'only-regexp-routes-supported': string; + 'bad-runtime-caching-config': string; + 'invalid-network-timeout-seconds': string; + 'no-module-name': string; + 'bad-manifest-transforms-return-value': string; + 'string-entry-warning': string; + 'no-manifest-entries-or-runtime-caching': string; + 'cant-find-sourcemap': string; + 'nav-preload-runtime-caching': string; + 'cache-name-required': string; + 'manifest-transforms': string; + 'invalid-handler-string': string; +}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/errors.js b/tools/ui/node_modules/workbox-build/build/lib/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..bb28236a38a7a547d6c4950c98f4cbdab442288e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/errors.js @@ -0,0 +1,125 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.errors = void 0; +const common_tags_1 = require("common-tags"); +exports.errors = { + 'unable-to-get-rootdir': `Unable to get the root directory of your web app.`, + 'no-extension': (0, common_tags_1.oneLine) `Unable to detect a usable extension for a file in your web + app directory.`, + 'invalid-file-manifest-name': (0, common_tags_1.oneLine) `The File Manifest Name must have at least one + character.`, + 'unable-to-get-file-manifest-name': 'Unable to get a file manifest name.', + 'invalid-sw-dest': `The 'swDest' value must be a valid path.`, + 'unable-to-get-sw-name': 'Unable to get a service worker file name.', + 'unable-to-get-save-config': (0, common_tags_1.oneLine) `An error occurred when asking to save details + in a config file.`, + 'unable-to-get-file-hash': (0, common_tags_1.oneLine) `An error occurred when attempting to create a + file hash.`, + 'unable-to-get-file-size': (0, common_tags_1.oneLine) `An error occurred when attempting to get a file + size.`, + 'unable-to-glob-files': 'An error occurred when globbing for files.', + 'unable-to-make-manifest-directory': (0, common_tags_1.oneLine) `Unable to make output directory for + file manifest.`, + 'read-manifest-template-failure': 'Unable to read template for file manifest', + 'populating-manifest-tmpl-failed': (0, common_tags_1.oneLine) `An error occurred when populating the + file manifest template.`, + 'manifest-file-write-failure': 'Unable to write the file manifest.', + 'unable-to-make-sw-directory': (0, common_tags_1.oneLine) `Unable to make the directories to output + the service worker path.`, + 'read-sw-template-failure': (0, common_tags_1.oneLine) `Unable to read the service worker template + file.`, + 'sw-write-failure': 'Unable to write the service worker file.', + 'sw-write-failure-directory': (0, common_tags_1.oneLine) `Unable to write the service worker file; + 'swDest' should be a full path to the file, not a path to a directory.`, + 'unable-to-copy-workbox-libraries': (0, common_tags_1.oneLine) `One or more of the Workbox libraries + could not be copied over to the destination directory: `, + 'invalid-generate-sw-input': (0, common_tags_1.oneLine) `The input to generateSW() must be an object.`, + 'invalid-glob-directory': (0, common_tags_1.oneLine) `The supplied globDirectory must be a path as a + string.`, + 'invalid-dont-cache-bust': (0, common_tags_1.oneLine) `The supplied 'dontCacheBustURLsMatching' + parameter must be a RegExp.`, + 'invalid-exclude-files': 'The excluded files should be an array of strings.', + 'invalid-get-manifest-entries-input': (0, common_tags_1.oneLine) `The input to + 'getFileManifestEntries()' must be an object.`, + 'invalid-manifest-path': (0, common_tags_1.oneLine) `The supplied manifest path is not a string with + at least one character.`, + 'invalid-manifest-entries': (0, common_tags_1.oneLine) `The manifest entries must be an array of + strings or JavaScript objects containing a url parameter.`, + 'invalid-manifest-format': (0, common_tags_1.oneLine) `The value of the 'format' option passed to + generateFileManifest() must be either 'iife' (the default) or 'es'.`, + 'invalid-static-file-globs': (0, common_tags_1.oneLine) `The 'globPatterns' value must be an array + of strings.`, + 'invalid-templated-urls': (0, common_tags_1.oneLine) `The 'templatedURLs' value should be an object + that maps URLs to either a string, or to an array of glob patterns.`, + 'templated-url-matches-glob': (0, common_tags_1.oneLine) `One of the 'templatedURLs' URLs is already + being tracked via 'globPatterns': `, + 'invalid-glob-ignores': (0, common_tags_1.oneLine) `The 'globIgnores' parameter must be an array of + glob pattern strings.`, + 'manifest-entry-bad-url': (0, common_tags_1.oneLine) `The generated manifest contains an entry without + a URL string. This is likely an error with workbox-build.`, + 'modify-url-prefix-bad-prefixes': (0, common_tags_1.oneLine) `The 'modifyURLPrefix' parameter must be + an object with string key value pairs.`, + 'invalid-inject-manifest-arg': (0, common_tags_1.oneLine) `The input to 'injectManifest()' must be an + object.`, + 'injection-point-not-found': (0, common_tags_1.oneLine) `Unable to find a place to inject the manifest. + Please ensure that your service worker file contains the following: `, + 'multiple-injection-points': (0, common_tags_1.oneLine) `Please ensure that your 'swSrc' file contains + only one match for the following: `, + 'populating-sw-tmpl-failed': (0, common_tags_1.oneLine) `Unable to generate service worker from + template.`, + 'useless-glob-pattern': (0, common_tags_1.oneLine) `One of the glob patterns doesn't match any files. + Please remove or fix the following: `, + 'bad-template-urls-asset': (0, common_tags_1.oneLine) `There was an issue using one of the provided + 'templatedURLs'.`, + 'invalid-runtime-caching': (0, common_tags_1.oneLine) `The 'runtimeCaching' parameter must an an + array of objects with at least a 'urlPattern' and 'handler'.`, + 'static-file-globs-deprecated': (0, common_tags_1.oneLine) `'staticFileGlobs' is deprecated. + Please use 'globPatterns' instead.`, + 'dynamic-url-deprecated': (0, common_tags_1.oneLine) `'dynamicURLToDependencies' is deprecated. + Please use 'templatedURLs' instead.`, + 'urlPattern-is-required': (0, common_tags_1.oneLine) `The 'urlPattern' option is required when using + 'runtimeCaching'.`, + 'handler-is-required': (0, common_tags_1.oneLine) `The 'handler' option is required when using + runtimeCaching.`, + 'invalid-generate-file-manifest-arg': (0, common_tags_1.oneLine) `The input to generateFileManifest() + must be an Object.`, + 'invalid-sw-src': `The 'swSrc' file can't be read.`, + 'same-src-and-dest': (0, common_tags_1.oneLine) `Unable to find a place to inject the manifest. This is + likely because swSrc and swDest are configured to the same file. + Please ensure that your swSrc file contains the following:`, + 'only-regexp-routes-supported': (0, common_tags_1.oneLine) `Please use a regular expression object as + the urlPattern parameter. (Express-style routes are not currently + supported.)`, + 'bad-runtime-caching-config': (0, common_tags_1.oneLine) `An unknown configuration option was used + with runtimeCaching: `, + 'invalid-network-timeout-seconds': (0, common_tags_1.oneLine) `When using networkTimeoutSeconds, you + must set the handler to 'NetworkFirst'.`, + 'no-module-name': (0, common_tags_1.oneLine) `You must provide a moduleName parameter when calling + getModuleURL().`, + 'bad-manifest-transforms-return-value': (0, common_tags_1.oneLine) `The return value from a + manifestTransform should be an object with 'manifest' and optionally + 'warnings' properties.`, + 'string-entry-warning': (0, common_tags_1.oneLine) `Some items were passed to additionalManifestEntries + without revisioning info. This is generally NOT safe. Learn more at + https://bit.ly/wb-precache.`, + 'no-manifest-entries-or-runtime-caching': (0, common_tags_1.oneLine) `Couldn't find configuration for + either precaching or runtime caching. Please ensure that the various glob + options are set to match one or more files, and/or configure the + runtimeCaching option.`, + 'cant-find-sourcemap': (0, common_tags_1.oneLine) `The swSrc file refers to a sourcemap that can't be + opened:`, + 'nav-preload-runtime-caching': (0, common_tags_1.oneLine) `When using navigationPreload, you must also + configure a runtimeCaching route that will use the preloaded response.`, + 'cache-name-required': (0, common_tags_1.oneLine) `When using cache expiration, you must also + configure a custom cacheName.`, + 'manifest-transforms': (0, common_tags_1.oneLine) `When using manifestTransforms, you must provide + an array of functions.`, + 'invalid-handler-string': (0, common_tags_1.oneLine) `The handler name provided is not valid: `, +}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.d.ts b/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2ab07babd7f730546975d9b8d9857f66c3cc11a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.d.ts @@ -0,0 +1 @@ +export declare function escapeRegExp(str: string): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.js b/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..c7291ac92825b3a2cff98b51b99be92bfa416f5d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/escape-regexp.js @@ -0,0 +1,15 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeRegExp = void 0; +// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions +function escapeRegExp(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} +exports.escapeRegExp = escapeRegExp; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c40ede5e7974363fa54b1b318092ffc596c2c8cb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.d.ts @@ -0,0 +1,2 @@ +import { FileDetails } from '../types'; +export declare function getCompositeDetails(compositeURL: string, dependencyDetails: Array): FileDetails; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.js b/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.js new file mode 100644 index 0000000000000000000000000000000000000000..17f4e877748b76889a4ea443b884b964e1cb498a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-composite-details.js @@ -0,0 +1,31 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getCompositeDetails = void 0; +const crypto_1 = __importDefault(require("crypto")); +function getCompositeDetails(compositeURL, dependencyDetails) { + let totalSize = 0; + let compositeHash = ''; + for (const fileDetails of dependencyDetails) { + totalSize += fileDetails.size; + compositeHash += fileDetails.hash; + } + const md5 = crypto_1.default.createHash('md5'); + md5.update(compositeHash); + const hashOfHashes = md5.digest('hex'); + return { + file: compositeURL, + hash: hashOfHashes, + size: totalSize, + }; +} +exports.getCompositeDetails = getCompositeDetails; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-details.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-file-details.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eb7460ddb9c74e9182b68d6b7f724fa63f2d60a0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-details.d.ts @@ -0,0 +1,14 @@ +import { GlobPartial } from '../types'; +interface FileDetails { + file: string; + hash: string; + size: number; +} +export declare function getFileDetails({ globDirectory, globFollow, globIgnores, globPattern, }: Omit & { + globDirectory: string; + globPattern: string; +}): { + globbedFileDetails: Array; + warning: string; +}; +export {}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-details.js b/tools/ui/node_modules/workbox-build/build/lib/get-file-details.js new file mode 100644 index 0000000000000000000000000000000000000000..0287db05f57e3168cbcf734602dcda6640af32cb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-details.js @@ -0,0 +1,54 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFileDetails = void 0; +const glob_1 = require("glob"); +const upath_1 = __importDefault(require("upath")); +const errors_1 = require("./errors"); +const get_file_size_1 = require("./get-file-size"); +const get_file_hash_1 = require("./get-file-hash"); +function getFileDetails({ globDirectory, globFollow, globIgnores, globPattern, }) { + let globbedFiles; + let warning = ''; + try { + globbedFiles = (0, glob_1.globSync)(globPattern, { + cwd: globDirectory, + follow: globFollow, + ignore: globIgnores, + }); + } + catch (err) { + throw new Error(errors_1.errors['unable-to-glob-files'] + + ` '${err instanceof Error && err.message ? err.message : ''}'`); + } + if (globbedFiles.length === 0) { + warning = + errors_1.errors['useless-glob-pattern'] + + ' ' + + JSON.stringify({ globDirectory, globPattern, globIgnores }, null, 2); + } + const globbedFileDetails = []; + for (const file of globbedFiles) { + const fullPath = upath_1.default.join(globDirectory, file); + const fileSize = (0, get_file_size_1.getFileSize)(fullPath); + if (fileSize !== null) { + const fileHash = (0, get_file_hash_1.getFileHash)(fullPath); + globbedFileDetails.push({ + file: `${upath_1.default.relative(globDirectory, fullPath)}`, + hash: fileHash, + size: fileSize, + }); + } + } + return { globbedFileDetails, warning }; +} +exports.getFileDetails = getFileDetails; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b2973fc67244a493ebce5305c3266d9ee86d711 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.d.ts @@ -0,0 +1 @@ +export declare function getFileHash(file: string): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.js b/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.js new file mode 100644 index 0000000000000000000000000000000000000000..4371484bfd72dee8604656d66c4bb4b5cebe65e2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-hash.js @@ -0,0 +1,27 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFileHash = void 0; +const fs_extra_1 = __importDefault(require("fs-extra")); +const get_string_hash_1 = require("./get-string-hash"); +const errors_1 = require("./errors"); +function getFileHash(file) { + try { + const buffer = fs_extra_1.default.readFileSync(file); + return (0, get_string_hash_1.getStringHash)(buffer); + } + catch (err) { + throw new Error(errors_1.errors['unable-to-get-file-hash'] + + ` '${err instanceof Error && err.message ? err.message : ''}'`); + } +} +exports.getFileHash = getFileHash; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87789f4dc01c264fbd6ca32b67d37b333baf17a2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.d.ts @@ -0,0 +1,2 @@ +import { GetManifestResult, GetManifestOptions } from '../types'; +export declare function getFileManifestEntries({ additionalManifestEntries, dontCacheBustURLsMatching, globDirectory, globFollow, globIgnores, globPatterns, manifestTransforms, maximumFileSizeToCacheInBytes, modifyURLPrefix, templatedURLs, }: GetManifestOptions): Promise; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.js b/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.js new file mode 100644 index 0000000000000000000000000000000000000000..3b550f72e0c4909d917b2cfd0f6393c6ac8ae971 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-manifest-entries.js @@ -0,0 +1,96 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFileManifestEntries = void 0; +const assert_1 = __importDefault(require("assert")); +const errors_1 = require("./errors"); +const get_composite_details_1 = require("./get-composite-details"); +const get_file_details_1 = require("./get-file-details"); +const get_string_details_1 = require("./get-string-details"); +const transform_manifest_1 = require("./transform-manifest"); +async function getFileManifestEntries({ additionalManifestEntries, dontCacheBustURLsMatching, globDirectory, globFollow, globIgnores, globPatterns = [], manifestTransforms, maximumFileSizeToCacheInBytes, modifyURLPrefix, templatedURLs, }) { + const warnings = []; + const allFileDetails = new Map(); + try { + for (const globPattern of globPatterns) { + const { globbedFileDetails, warning } = (0, get_file_details_1.getFileDetails)({ + globDirectory, + globFollow, + globIgnores, + globPattern, + }); + if (warning) { + warnings.push(warning); + } + for (const details of globbedFileDetails) { + if (details && !allFileDetails.has(details.file)) { + allFileDetails.set(details.file, details); + } + } + } + } + catch (error) { + // If there's an exception thrown while globbing, then report + // it back as a warning, and don't consider it fatal. + if (error instanceof Error && error.message) { + warnings.push(error.message); + } + } + if (templatedURLs) { + for (const url of Object.keys(templatedURLs)) { + (0, assert_1.default)(!allFileDetails.has(url), errors_1.errors['templated-url-matches-glob']); + const dependencies = templatedURLs[url]; + if (Array.isArray(dependencies)) { + const details = dependencies.reduce((previous, globPattern) => { + try { + const { globbedFileDetails, warning } = (0, get_file_details_1.getFileDetails)({ + globDirectory, + globFollow, + globIgnores, + globPattern, + }); + if (warning) { + warnings.push(warning); + } + return previous.concat(globbedFileDetails); + } + catch (error) { + const debugObj = {}; + debugObj[url] = dependencies; + throw new Error(`${errors_1.errors['bad-template-urls-asset']} ` + + `'${globPattern}' from '${JSON.stringify(debugObj)}':\n` + + `${error instanceof Error ? error.toString() : ''}`); + } + }, []); + if (details.length === 0) { + throw new Error(`${errors_1.errors['bad-template-urls-asset']} The glob ` + + `pattern '${dependencies.toString()}' did not match anything.`); + } + allFileDetails.set(url, (0, get_composite_details_1.getCompositeDetails)(url, details)); + } + else if (typeof dependencies === 'string') { + allFileDetails.set(url, (0, get_string_details_1.getStringDetails)(url, dependencies)); + } + } + } + const transformedManifest = await (0, transform_manifest_1.transformManifest)({ + additionalManifestEntries, + dontCacheBustURLsMatching, + manifestTransforms, + maximumFileSizeToCacheInBytes, + modifyURLPrefix, + fileDetails: Array.from(allFileDetails.values()), + }); + transformedManifest.warnings.push(...warnings); + return transformedManifest; +} +exports.getFileManifestEntries = getFileManifestEntries; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-size.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-file-size.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76462b33a8bf70d59a936ba0b2b6b12d236b1ce3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-size.d.ts @@ -0,0 +1 @@ +export declare function getFileSize(file: string): number | null; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-file-size.js b/tools/ui/node_modules/workbox-build/build/lib/get-file-size.js new file mode 100644 index 0000000000000000000000000000000000000000..cb9dd1e19d55e34f3fc4cd8bfae61928e93915d7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-file-size.js @@ -0,0 +1,29 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFileSize = void 0; +const fs_extra_1 = __importDefault(require("fs-extra")); +const errors_1 = require("./errors"); +function getFileSize(file) { + try { + const stat = fs_extra_1.default.statSync(file); + if (!stat.isFile()) { + return null; + } + return stat.size; + } + catch (err) { + throw new Error(errors_1.errors['unable-to-get-file-size'] + + ` '${err instanceof Error && err.message ? err.message : ''}'`); + } +} +exports.getFileSize = getFileSize; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f08b5165de6c60fe693b2c8ec4b011f999c12b14 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.d.ts @@ -0,0 +1 @@ +export declare function getSourceMapURL(srcContents: string): string | null; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.js b/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.js new file mode 100644 index 0000000000000000000000000000000000000000..f62fea9b7c68f6f1b68d28529fd3b4142c7c986c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-source-map-url.js @@ -0,0 +1,32 @@ +"use strict"; +/* + Copyright 2022 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSourceMapURL = void 0; +// Adapted from https://github.com/lydell/source-map-url/blob/master/source-map-url.js +// See https://github.com/GoogleChrome/workbox/issues/3019 +const innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/; +const regex = RegExp('(?:' + + '/\\*' + + '(?:\\s*\r?\n(?://)?)?' + + '(?:' + + innerRegex.source + + ')' + + '\\s*' + + '\\*/' + + '|' + + '//(?:' + + innerRegex.source + + ')' + + ')' + + '\\s*'); +function getSourceMapURL(srcContents) { + const match = srcContents.match(regex); + return match ? match[1] || match[2] || '' : null; +} +exports.getSourceMapURL = getSourceMapURL; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-string-details.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-string-details.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bcfa96c0798d7e4821e3060124e982d82b78b9b5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-string-details.d.ts @@ -0,0 +1,2 @@ +import { FileDetails } from '../types'; +export declare function getStringDetails(url: string, str: string): FileDetails; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-string-details.js b/tools/ui/node_modules/workbox-build/build/lib/get-string-details.js new file mode 100644 index 0000000000000000000000000000000000000000..8d1a86ff74b9d8bc7f785e40c93d18d7b07c4a13 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-string-details.js @@ -0,0 +1,19 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStringDetails = void 0; +const get_string_hash_1 = require("./get-string-hash"); +function getStringDetails(url, str) { + return { + file: url, + hash: (0, get_string_hash_1.getStringHash)(str), + size: str.length, + }; +} +exports.getStringDetails = getStringDetails; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.d.ts b/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..149f324fb45a076975d547ec12460e7c2cb6b210 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.d.ts @@ -0,0 +1,3 @@ +/// +import crypto from 'crypto'; +export declare function getStringHash(input: crypto.BinaryLike): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.js b/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.js new file mode 100644 index 0000000000000000000000000000000000000000..645e285b75864de6261826a138fda4cd3c5fe3ca --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/get-string-hash.js @@ -0,0 +1,20 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStringHash = void 0; +const crypto_1 = __importDefault(require("crypto")); +function getStringHash(input) { + const md5 = crypto_1.default.createHash('md5'); + md5.update(input); + return md5.digest('hex'); +} +exports.getStringHash = getStringHash; diff --git a/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.d.ts b/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b2a5f5d6bffd4d41d3d338333e3e16544438b26 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.d.ts @@ -0,0 +1,2 @@ +import { ManifestTransform } from '../types'; +export declare function maximumSizeTransform(maximumFileSizeToCacheInBytes: number): ManifestTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.js b/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.js new file mode 100644 index 0000000000000000000000000000000000000000..f0ee5c91c957cf527b819698fbac000fe07d66c7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/maximum-size-transform.js @@ -0,0 +1,30 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.maximumSizeTransform = void 0; +const pretty_bytes_1 = __importDefault(require("pretty-bytes")); +function maximumSizeTransform(maximumFileSizeToCacheInBytes) { + return (originalManifest) => { + const warnings = []; + const manifest = originalManifest.filter((entry) => { + if (entry.size <= maximumFileSizeToCacheInBytes) { + return true; + } + warnings.push(`${entry.url} is ${(0, pretty_bytes_1.default)(entry.size)}, and won't ` + + `be precached. Configure maximumFileSizeToCacheInBytes to change ` + + `this limit.`); + return false; + }); + return { manifest, warnings }; + }; +} +exports.maximumSizeTransform = maximumSizeTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.d.ts b/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85bfa453850bbebe775af88fbdcf434ddded22c2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.d.ts @@ -0,0 +1,4 @@ +import { ManifestTransform } from '../types'; +export declare function modifyURLPrefixTransform(modifyURLPrefix: { + [key: string]: string; +}): ManifestTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.js b/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.js new file mode 100644 index 0000000000000000000000000000000000000000..714d8a963595bfed30ebea9404a42758091f15e1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/modify-url-prefix-transform.js @@ -0,0 +1,51 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modifyURLPrefixTransform = void 0; +const errors_1 = require("./errors"); +const escape_regexp_1 = require("./escape-regexp"); +function modifyURLPrefixTransform(modifyURLPrefix) { + if (!modifyURLPrefix || + typeof modifyURLPrefix !== 'object' || + Array.isArray(modifyURLPrefix)) { + throw new Error(errors_1.errors['modify-url-prefix-bad-prefixes']); + } + // If there are no entries in modifyURLPrefix, just return an identity + // function as a shortcut. + if (Object.keys(modifyURLPrefix).length === 0) { + return (manifest) => { + return { manifest }; + }; + } + for (const key of Object.keys(modifyURLPrefix)) { + if (typeof modifyURLPrefix[key] !== 'string') { + throw new Error(errors_1.errors['modify-url-prefix-bad-prefixes']); + } + } + // Escape the user input so it's safe to use in a regex. + const safeModifyURLPrefixes = Object.keys(modifyURLPrefix).map(escape_regexp_1.escapeRegExp); + // Join all the `modifyURLPrefix` keys so a single regex can be used. + const prefixMatchesStrings = safeModifyURLPrefixes.join('|'); + // Add `^` to the front the prefix matches so it only matches the start of + // a string. + const modifyRegex = new RegExp(`^(${prefixMatchesStrings})`); + return (originalManifest) => { + const manifest = originalManifest.map((entry) => { + if (typeof entry.url !== 'string') { + throw new Error(errors_1.errors['manifest-entry-bad-url']); + } + entry.url = entry.url.replace(modifyRegex, (match) => { + return modifyURLPrefix[match]; + }); + return entry; + }); + return { manifest }; + }; +} +exports.modifyURLPrefixTransform = modifyURLPrefixTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/module-registry.d.ts b/tools/ui/node_modules/workbox-build/build/lib/module-registry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..52fd0c1b29c51a0bca22ba5def3bbc88dcd87f69 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/module-registry.d.ts @@ -0,0 +1,33 @@ +/** + * Class for keeping track of which Workbox modules are used by the generated + * service worker script. + * + * @private + */ +export declare class ModuleRegistry { + private readonly _modulesUsed; + /** + * @private + */ + constructor(); + /** + * @return {Array} A list of all of the import statements that are + * needed for the modules being used. + * @private + */ + getImportStatements(): Array; + /** + * @param {string} pkg The workbox package that the module belongs to. + * @param {string} moduleName The name of the module to import. + * @return {string} The local variable name that corresponds to that module. + * @private + */ + getLocalName(pkg: string, moduleName: string): string; + /** + * @param {string} pkg The workbox package that the module belongs to. + * @param {string} moduleName The name of the module to import. + * @return {string} The local variable name that corresponds to that module. + * @private + */ + use(pkg: string, moduleName: string): string; +} diff --git a/tools/ui/node_modules/workbox-build/build/lib/module-registry.js b/tools/ui/node_modules/workbox-build/build/lib/module-registry.js new file mode 100644 index 0000000000000000000000000000000000000000..9a34dd9d97965ad89e95da4af6ae74042b7fccaf --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/module-registry.js @@ -0,0 +1,70 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleRegistry = void 0; +const common_tags_1 = require("common-tags"); +const upath_1 = __importDefault(require("upath")); +/** + * Class for keeping track of which Workbox modules are used by the generated + * service worker script. + * + * @private + */ +class ModuleRegistry { + /** + * @private + */ + constructor() { + this._modulesUsed = new Map(); + } + /** + * @return {Array} A list of all of the import statements that are + * needed for the modules being used. + * @private + */ + getImportStatements() { + const workboxModuleImports = []; + for (const [localName, { moduleName, pkg }] of this._modulesUsed) { + // By default require.resolve returns the resolved path of the 'main' + // field, which might be deeper than the package root. To work around + // this, we can find the package's root by resolving its package.json and + // strip the '/package.json' from the resolved path. + const pkgJsonPath = require.resolve(`${pkg}/package.json`); + const pkgRoot = upath_1.default.dirname(pkgJsonPath); + const importStatement = (0, common_tags_1.oneLine) `import {${moduleName} as ${localName}} from + '${pkgRoot}/${moduleName}.mjs';`; + workboxModuleImports.push(importStatement); + } + return workboxModuleImports; + } + /** + * @param {string} pkg The workbox package that the module belongs to. + * @param {string} moduleName The name of the module to import. + * @return {string} The local variable name that corresponds to that module. + * @private + */ + getLocalName(pkg, moduleName) { + return `${pkg.replace(/-/g, '_')}_${moduleName}`; + } + /** + * @param {string} pkg The workbox package that the module belongs to. + * @param {string} moduleName The name of the module to import. + * @return {string} The local variable name that corresponds to that module. + * @private + */ + use(pkg, moduleName) { + const localName = this.getLocalName(pkg, moduleName); + this._modulesUsed.set(localName, { moduleName, pkg }); + return localName; + } +} +exports.ModuleRegistry = ModuleRegistry; diff --git a/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.d.ts b/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..268704529e355f51a20d784621659e6791a2afe7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.d.ts @@ -0,0 +1,2 @@ +import { ManifestTransform } from '../types'; +export declare function noRevisionForURLsMatchingTransform(regexp: RegExp): ManifestTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.js b/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.js new file mode 100644 index 0000000000000000000000000000000000000000..46a3eead9a4e800f92511a979c5a9855c86d2bb1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/no-revision-for-urls-matching-transform.js @@ -0,0 +1,29 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.noRevisionForURLsMatchingTransform = void 0; +const errors_1 = require("./errors"); +function noRevisionForURLsMatchingTransform(regexp) { + if (!(regexp instanceof RegExp)) { + throw new Error(errors_1.errors['invalid-dont-cache-bust']); + } + return (originalManifest) => { + const manifest = originalManifest.map((entry) => { + if (typeof entry.url !== 'string') { + throw new Error(errors_1.errors['manifest-entry-bad-url']); + } + if (entry.url.match(regexp)) { + entry.revision = null; + } + return entry; + }); + return { manifest }; + }; +} +exports.noRevisionForURLsMatchingTransform = noRevisionForURLsMatchingTransform; diff --git a/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.d.ts b/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..debf1491dc0734bed70c7428f116cd6ca5e945b9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.d.ts @@ -0,0 +1,4 @@ +import { GeneratePartial, ManifestEntry } from '../types'; +export declare function populateSWTemplate({ cacheId, cleanupOutdatedCaches, clientsClaim, directoryIndex, disableDevLogs, ignoreURLParametersMatching, importScripts, manifestEntries, navigateFallback, navigateFallbackDenylist, navigateFallbackAllowlist, navigationPreload, offlineGoogleAnalytics, runtimeCaching, skipWaiting, }: GeneratePartial & { + manifestEntries?: Array; +}): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.js b/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.js new file mode 100644 index 0000000000000000000000000000000000000000..d20bf720b4a1d85b2a02bd6891d7ab3dfbf5d676 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/populate-sw-template.js @@ -0,0 +1,80 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.populateSWTemplate = void 0; +const eta_1 = require("eta"); +const errors_1 = require("./errors"); +const module_registry_1 = require("./module-registry"); +const runtime_caching_converter_1 = require("./runtime-caching-converter"); +const stringify_without_comments_1 = require("./stringify-without-comments"); +const sw_template_1 = require("../templates/sw-template"); +const eta = new eta_1.Eta({ + useWith: true, + autoEscape: false, +}); +function populateSWTemplate({ cacheId, cleanupOutdatedCaches, clientsClaim, directoryIndex, disableDevLogs, ignoreURLParametersMatching, importScripts, manifestEntries = [], navigateFallback, navigateFallbackDenylist, navigateFallbackAllowlist, navigationPreload, offlineGoogleAnalytics, runtimeCaching = [], skipWaiting, }) { + // There needs to be at least something to precache, or else runtime caching. + if (!((manifestEntries === null || manifestEntries === void 0 ? void 0 : manifestEntries.length) > 0 || runtimeCaching.length > 0)) { + throw new Error(errors_1.errors['no-manifest-entries-or-runtime-caching']); + } + // These are all options that can be passed to the precacheAndRoute() method. + const precacheOptions = { + directoryIndex, + // An array of RegExp objects can't be serialized by JSON.stringify()'s + // default behavior, so if it's given, convert it manually. + ignoreURLParametersMatching: ignoreURLParametersMatching + ? [] + : undefined, + }; + let precacheOptionsString = JSON.stringify(precacheOptions, null, 2); + if (ignoreURLParametersMatching) { + precacheOptionsString = precacheOptionsString.replace(`"ignoreURLParametersMatching": []`, `"ignoreURLParametersMatching": [` + + `${ignoreURLParametersMatching.join(', ')}]`); + } + let offlineAnalyticsConfigString = undefined; + if (offlineGoogleAnalytics) { + // If offlineGoogleAnalytics is a truthy value, we need to convert it to the + // format expected by the template. + offlineAnalyticsConfigString = + offlineGoogleAnalytics === true + ? // If it's the literal value true, then use an empty config string. + '{}' + : // Otherwise, convert the config object into a more complex string, taking + // into account the fact that functions might need to be stringified. + (0, stringify_without_comments_1.stringifyWithoutComments)(offlineGoogleAnalytics); + } + const moduleRegistry = new module_registry_1.ModuleRegistry(); + try { + const populatedTemplate = eta.renderString(sw_template_1.swTemplate, { + cacheId, + cleanupOutdatedCaches, + clientsClaim, + disableDevLogs, + importScripts, + manifestEntries, + navigateFallback, + navigateFallbackDenylist, + navigateFallbackAllowlist, + navigationPreload, + offlineAnalyticsConfigString, + precacheOptionsString, + runtimeCaching: (0, runtime_caching_converter_1.runtimeCachingConverter)(moduleRegistry, runtimeCaching), + skipWaiting, + use: moduleRegistry.use.bind(moduleRegistry), + }); + const workboxImportStatements = moduleRegistry.getImportStatements(); + // We need the import statements for all of the Workbox runtime modules + // prepended, so that the correct bundle can be created. + return workboxImportStatements.join('\n') + populatedTemplate; + } + catch (error) { + throw new Error(`${errors_1.errors['populating-sw-tmpl-failed']} '${error instanceof Error && error.message ? error.message : ''}'`); + } +} +exports.populateSWTemplate = populateSWTemplate; diff --git a/tools/ui/node_modules/workbox-build/build/lib/rebase-path.d.ts b/tools/ui/node_modules/workbox-build/build/lib/rebase-path.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..450e652b9ffd335945963b0e55b332bfa50c7e27 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/rebase-path.d.ts @@ -0,0 +1,4 @@ +export declare function rebasePath({ baseDirectory, file, }: { + baseDirectory: string; + file: string; +}): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/rebase-path.js b/tools/ui/node_modules/workbox-build/build/lib/rebase-path.js new file mode 100644 index 0000000000000000000000000000000000000000..dd55c1c588a45828512f58df80ac8ca2b8a74eec --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/rebase-path.js @@ -0,0 +1,24 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rebasePath = void 0; +const upath_1 = __importDefault(require("upath")); +function rebasePath({ baseDirectory, file, }) { + // The initial path is relative to the current directory, so make it absolute. + const absolutePath = upath_1.default.resolve(file); + // Convert the absolute path so that it's relative to the baseDirectory. + const relativePath = upath_1.default.relative(baseDirectory, absolutePath); + // Remove any leading ./ as it won't work in a glob pattern. + const normalizedPath = upath_1.default.normalize(relativePath); + return normalizedPath; +} +exports.rebasePath = rebasePath; diff --git a/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.d.ts b/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d81855d26e1aee302a1e87c7891d6e7674012549 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.d.ts @@ -0,0 +1,30 @@ +import { RawSourceMap } from 'source-map'; +/** + * Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern + * JavaScript updates, along with additional properties copied from originalMap. + * + * @param {Object} options + * @param {string} options.jsFilename The name for the file whose contents + * correspond to originalSource. + * @param {Object} options.originalMap The sourcemap for originalSource, + * prior to any replacements. + * @param {string} options.originalSource The source code, prior to any + * replacements. + * @param {string} options.replaceString A string to swap in for searchString. + * @param {string} options.searchString A string in originalSource to replace. + * Only the first occurrence will be replaced. + * @return {{source: string, map: string}} An object containing both + * originalSource with the replacement applied, and the modified originalMap. + * + * @private + */ +export declare function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSource, replaceString, searchString, }: { + jsFilename: string; + originalMap: RawSourceMap; + originalSource: string; + replaceString: string; + searchString: string; +}): Promise<{ + map: string; + source: string; +}>; diff --git a/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.js b/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.js new file mode 100644 index 0000000000000000000000000000000000000000..80f15bc6b7264515baa5d55be23d5036b157a3f9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/replace-and-update-source-map.js @@ -0,0 +1,98 @@ +"use strict"; +/* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceAndUpdateSourceMap = void 0; +const source_map_1 = require("source-map"); +/** + * Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern + * JavaScript updates, along with additional properties copied from originalMap. + * + * @param {Object} options + * @param {string} options.jsFilename The name for the file whose contents + * correspond to originalSource. + * @param {Object} options.originalMap The sourcemap for originalSource, + * prior to any replacements. + * @param {string} options.originalSource The source code, prior to any + * replacements. + * @param {string} options.replaceString A string to swap in for searchString. + * @param {string} options.searchString A string in originalSource to replace. + * Only the first occurrence will be replaced. + * @return {{source: string, map: string}} An object containing both + * originalSource with the replacement applied, and the modified originalMap. + * + * @private + */ +async function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSource, replaceString, searchString, }) { + const generator = new source_map_1.SourceMapGenerator({ + file: jsFilename, + }); + const consumer = await new source_map_1.SourceMapConsumer(originalMap); + let pos; + let src = originalSource; + const replacements = []; + let lineNum = 0; + let filePos = 0; + const lines = src.split('\n'); + for (let line of lines) { + lineNum++; + let searchPos = 0; + while ((pos = line.indexOf(searchString, searchPos)) !== -1) { + src = + src.substring(0, filePos + pos) + + replaceString + + src.substring(filePos + pos + searchString.length); + line = + line.substring(0, pos) + + replaceString + + line.substring(pos + searchString.length); + replacements.push({ line: lineNum, column: pos }); + searchPos = pos + replaceString.length; + } + filePos += line.length + 1; + } + replacements.reverse(); + consumer.eachMapping((mapping) => { + for (const replacement of replacements) { + if (replacement.line === mapping.generatedLine && + mapping.generatedColumn > replacement.column) { + const offset = searchString.length - replaceString.length; + mapping.generatedColumn -= offset; + } + } + if (mapping.source) { + const newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn, + }, + original: { + line: mapping.originalLine, + column: mapping.originalColumn, + }, + source: mapping.source, + }; + return generator.addMapping(newMapping); + } + return mapping; + }); + consumer.destroy(); + // JSON.parse returns any. + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const updatedSourceMap = Object.assign(JSON.parse(generator.toString()), { + names: originalMap.names, + sourceRoot: originalMap.sourceRoot, + sources: originalMap.sources, + sourcesContent: originalMap.sourcesContent, + }); + return { + map: JSON.stringify(updatedSourceMap), + source: src, + }; +} +exports.replaceAndUpdateSourceMap = replaceAndUpdateSourceMap; diff --git a/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.d.ts b/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79640a34817f32cf61980f3bc893b12152589b2f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.d.ts @@ -0,0 +1,3 @@ +import { ModuleRegistry } from './module-registry'; +import { RuntimeCaching } from '../types'; +export declare function runtimeCachingConverter(moduleRegistry: ModuleRegistry, runtimeCaching: Array): Array; diff --git a/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.js b/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.js new file mode 100644 index 0000000000000000000000000000000000000000..76d78924a5604fbcdf5de19286cb4443b3ac8e29 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/runtime-caching-converter.js @@ -0,0 +1,142 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runtimeCachingConverter = void 0; +const common_tags_1 = require("common-tags"); +const errors_1 = require("./errors"); +const stringify_without_comments_1 = require("./stringify-without-comments"); +/** + * Given a set of options that configures runtime caching behavior, convert it + * to the equivalent Workbox method calls. + * + * @param {ModuleRegistry} moduleRegistry + * @param {Object} options See + * https://developers.google.com/web/tools/workbox/modules/workbox-build#generateSW-runtimeCaching + * @return {string} A JSON string representing the equivalent options. + * + * @private + */ +function getOptionsString(moduleRegistry, options = {}) { + const plugins = []; + const handlerOptions = {}; + for (const optionName of Object.keys(options)) { + if (options[optionName] === undefined) { + continue; + } + switch (optionName) { + // Using a library here because JSON.stringify won't handle functions. + case 'plugins': { + plugins.push(...options.plugins.map(stringify_without_comments_1.stringifyWithoutComments)); + break; + } + // These are the option properties that we want to pull out, so that + // they're passed to the handler constructor. + case 'cacheName': + case 'networkTimeoutSeconds': + case 'fetchOptions': + case 'matchOptions': { + handlerOptions[optionName] = options[optionName]; + break; + } + // The following cases are all shorthands for creating a plugin with a + // given configuration. + case 'backgroundSync': { + const name = options.backgroundSync.name; + const plugin = moduleRegistry.use('workbox-background-sync', 'BackgroundSyncPlugin'); + let pluginCode = `new ${plugin}(${JSON.stringify(name)}`; + if (options.backgroundSync.options) { + pluginCode += `, ${(0, stringify_without_comments_1.stringifyWithoutComments)(options.backgroundSync.options)}`; + } + pluginCode += `)`; + plugins.push(pluginCode); + break; + } + case 'broadcastUpdate': { + const channelName = options.broadcastUpdate.channelName; + const opts = Object.assign({ channelName }, options.broadcastUpdate.options); + const plugin = moduleRegistry.use('workbox-broadcast-update', 'BroadcastUpdatePlugin'); + plugins.push(`new ${plugin}(${(0, stringify_without_comments_1.stringifyWithoutComments)(opts)})`); + break; + } + case 'cacheableResponse': { + const plugin = moduleRegistry.use('workbox-cacheable-response', 'CacheableResponsePlugin'); + plugins.push(`new ${plugin}(${(0, stringify_without_comments_1.stringifyWithoutComments)(options.cacheableResponse)})`); + break; + } + case 'expiration': { + const plugin = moduleRegistry.use('workbox-expiration', 'ExpirationPlugin'); + plugins.push(`new ${plugin}(${(0, stringify_without_comments_1.stringifyWithoutComments)(options.expiration)})`); + break; + } + case 'precacheFallback': { + const plugin = moduleRegistry.use('workbox-precaching', 'PrecacheFallbackPlugin'); + plugins.push(`new ${plugin}(${(0, stringify_without_comments_1.stringifyWithoutComments)(options.precacheFallback)})`); + break; + } + case 'rangeRequests': { + const plugin = moduleRegistry.use('workbox-range-requests', 'RangeRequestsPlugin'); + // There are no configuration options for the constructor. + plugins.push(`new ${plugin}()`); + break; + } + default: { + throw new Error( + // In the default case optionName is typed as 'never'. + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `${errors_1.errors['bad-runtime-caching-config']} ${optionName}`); + } + } + } + if (Object.keys(handlerOptions).length > 0 || plugins.length > 0) { + const optionsString = JSON.stringify(handlerOptions).slice(1, -1); + return (0, common_tags_1.oneLine) `{ + ${optionsString ? optionsString + ',' : ''} + plugins: [${plugins.join(', ')}] + }`; + } + else { + return ''; + } +} +function runtimeCachingConverter(moduleRegistry, runtimeCaching) { + return runtimeCaching + .map((entry) => { + const method = entry.method || 'GET'; + if (!entry.urlPattern) { + throw new Error(errors_1.errors['urlPattern-is-required']); + } + if (!entry.handler) { + throw new Error(errors_1.errors['handler-is-required']); + } + if (entry.options && + entry.options.networkTimeoutSeconds && + entry.handler !== 'NetworkFirst') { + throw new Error(errors_1.errors['invalid-network-timeout-seconds']); + } + // urlPattern might be a string, a RegExp object, or a function. + // If it's a string, it needs to be quoted. + const matcher = typeof entry.urlPattern === 'string' + ? JSON.stringify(entry.urlPattern) + : entry.urlPattern; + const registerRoute = moduleRegistry.use('workbox-routing', 'registerRoute'); + if (typeof entry.handler === 'string') { + const optionsString = getOptionsString(moduleRegistry, entry.options); + const handler = moduleRegistry.use('workbox-strategies', entry.handler); + const strategyString = `new ${handler}(${optionsString})`; + return `${registerRoute}(${matcher.toString()}, ${strategyString}, '${method}');\n`; + } + else if (typeof entry.handler === 'function') { + return `${registerRoute}(${matcher.toString()}, ${entry.handler.toString()}, '${method}');\n`; + } + // '' will be filtered out. + return ''; + }) + .filter((entry) => Boolean(entry)); +} +exports.runtimeCachingConverter = runtimeCachingConverter; diff --git a/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.d.ts b/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0b073350ecffe9b258a2fc0f65fbfa412f6625a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.d.ts @@ -0,0 +1,3 @@ +export declare function stringifyWithoutComments(obj: { + [key: string]: any; +}): string; diff --git a/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.js b/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.js new file mode 100644 index 0000000000000000000000000000000000000000..4c7e393e89448b058814bb56d7802ff1c17e6f86 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/stringify-without-comments.js @@ -0,0 +1,28 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringifyWithoutComments = void 0; +const stringify_object_1 = __importDefault(require("stringify-object")); +const strip_comments_1 = __importDefault(require("strip-comments")); +function stringifyWithoutComments(obj) { + return (0, stringify_object_1.default)(obj, { + // See https://github.com/yeoman/stringify-object#transformobject-property-originalresult + transform: (_obj, _prop, str) => { + if (typeof _prop !== 'symbol' && typeof _obj[_prop] === 'function') { + // Can't typify correctly stripComments + return (0, strip_comments_1.default)(str); // eslint-disable-line + } + return str; + }, + }); +} +exports.stringifyWithoutComments = stringifyWithoutComments; diff --git a/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.d.ts b/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48343a233015fda375337d348a13c464e8a8581d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.d.ts @@ -0,0 +1,63 @@ +import { BasePartial, FileDetails, ManifestEntry } from '../types'; +/** + * A `ManifestTransform` function can be used to modify the modify the `url` or + * `revision` properties of some or all of the + * {@link workbox-build.ManifestEntry} in the manifest. + * + * Deleting the `revision` property of an entry will cause + * the corresponding `url` to be precached without cache-busting parameters + * applied, which is to say, it implies that the URL itself contains + * proper versioning info. If the `revision` property is present, it must be + * set to a string. + * + * @example A transformation that prepended the origin of a CDN for any + * URL starting with '/assets/' could be implemented as: + * + * const cdnTransform = async (manifestEntries) => { + * const manifest = manifestEntries.map(entry => { + * const cdnOrigin = 'https://example.com'; + * if (entry.url.startsWith('/assets/')) { + * entry.url = cdnOrigin + entry.url; + * } + * return entry; + * }); + * return {manifest, warnings: []}; + * }; + * + * @example A transformation that nulls the revision field when the + * URL contains an 8-character hash surrounded by '.', indicating that it + * already contains revision information: + * + * const removeRevisionTransform = async (manifestEntries) => { + * const manifest = manifestEntries.map(entry => { + * const hashRegExp = /\.\w{8}\./; + * if (entry.url.match(hashRegExp)) { + * entry.revision = null; + * } + * return entry; + * }); + * return {manifest, warnings: []}; + * }; + * + * @callback ManifestTransform + * @param {Array} manifestEntries The full + * array of entries, prior to the current transformation. + * @param {Object} [compilation] When used in the webpack plugins, this param + * will be set to the current `compilation`. + * @return {Promise} + * The array of entries with the transformation applied, and optionally, any + * warnings that should be reported back to the build tool. + * + * @memberof workbox-build + */ +interface ManifestTransformResultWithWarnings { + count: number; + size: number; + manifestEntries: ManifestEntry[]; + warnings: string[]; +} +export declare function transformManifest({ additionalManifestEntries, dontCacheBustURLsMatching, fileDetails, manifestTransforms, maximumFileSizeToCacheInBytes, modifyURLPrefix, transformParam, }: BasePartial & { + fileDetails: Array; + transformParam?: unknown; +}): Promise; +export {}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.js b/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.js new file mode 100644 index 0000000000000000000000000000000000000000..82baf46d532e4738f20155f5482b695ba0e7fe23 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/transform-manifest.js @@ -0,0 +1,69 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.transformManifest = void 0; +const additional_manifest_entries_transform_1 = require("./additional-manifest-entries-transform"); +const errors_1 = require("./errors"); +const maximum_size_transform_1 = require("./maximum-size-transform"); +const modify_url_prefix_transform_1 = require("./modify-url-prefix-transform"); +const no_revision_for_urls_matching_transform_1 = require("./no-revision-for-urls-matching-transform"); +async function transformManifest({ additionalManifestEntries, dontCacheBustURLsMatching, fileDetails, manifestTransforms, maximumFileSizeToCacheInBytes, modifyURLPrefix, transformParam, }) { + const allWarnings = []; + // Take the array of fileDetail objects and convert it into an array of + // {url, revision, size} objects, with \ replaced with /. + const normalizedManifest = fileDetails.map((fileDetails) => { + return { + url: fileDetails.file.replace(/\\/g, '/'), + revision: fileDetails.hash, + size: fileDetails.size, + }; + }); + const transformsToApply = []; + if (maximumFileSizeToCacheInBytes) { + transformsToApply.push((0, maximum_size_transform_1.maximumSizeTransform)(maximumFileSizeToCacheInBytes)); + } + if (modifyURLPrefix) { + transformsToApply.push((0, modify_url_prefix_transform_1.modifyURLPrefixTransform)(modifyURLPrefix)); + } + if (dontCacheBustURLsMatching) { + transformsToApply.push((0, no_revision_for_urls_matching_transform_1.noRevisionForURLsMatchingTransform)(dontCacheBustURLsMatching)); + } + // Run any manifestTransforms functions second-to-last. + if (manifestTransforms) { + transformsToApply.push(...manifestTransforms); + } + // Run additionalManifestEntriesTransform last. + if (additionalManifestEntries) { + transformsToApply.push((0, additional_manifest_entries_transform_1.additionalManifestEntriesTransform)(additionalManifestEntries)); + } + let transformedManifest = normalizedManifest; + for (const transform of transformsToApply) { + const result = await transform(transformedManifest, transformParam); + if (!('manifest' in result)) { + throw new Error(errors_1.errors['bad-manifest-transforms-return-value']); + } + transformedManifest = result.manifest; + allWarnings.push(...(result.warnings || [])); + } + // Generate some metadata about the manifest before we clear out the size + // properties from each entry. + const count = transformedManifest.length; + let size = 0; + for (const manifestEntry of transformedManifest) { + size += manifestEntry.size || 0; + delete manifestEntry.size; + } + return { + count, + size, + manifestEntries: transformedManifest, + warnings: allWarnings, + }; +} +exports.transformManifest = transformManifest; diff --git a/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.d.ts b/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b7413b20e284fe2543d437364fbe7f849c684f6 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.d.ts @@ -0,0 +1,5 @@ +export declare function translateURLToSourcemapPaths(url: string | null, swSrc: string, swDest: string): { + destPath: string | undefined; + srcPath: string | undefined; + warning: string | undefined; +}; diff --git a/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.js b/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.js new file mode 100644 index 0000000000000000000000000000000000000000..3220c5474eeac6e8a56ca9b2ac2bd9be48529e43 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/translate-url-to-sourcemap-paths.js @@ -0,0 +1,33 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.translateURLToSourcemapPaths = void 0; +const fs_extra_1 = __importDefault(require("fs-extra")); +const upath_1 = __importDefault(require("upath")); +const errors_1 = require("./errors"); +function translateURLToSourcemapPaths(url, swSrc, swDest) { + let destPath = undefined; + let srcPath = undefined; + let warning = undefined; + if (url && !url.startsWith('data:')) { + const possibleSrcPath = upath_1.default.resolve(upath_1.default.dirname(swSrc), url); + if (fs_extra_1.default.existsSync(possibleSrcPath)) { + srcPath = possibleSrcPath; + destPath = upath_1.default.resolve(upath_1.default.dirname(swDest), url); + } + else { + warning = `${errors_1.errors['cant-find-sourcemap']} ${possibleSrcPath}`; + } + } + return { destPath, srcPath, warning }; +} +exports.translateURLToSourcemapPaths = translateURLToSourcemapPaths; diff --git a/tools/ui/node_modules/workbox-build/build/lib/validate-options.d.ts b/tools/ui/node_modules/workbox-build/build/lib/validate-options.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf4b549f06b500cde1e29b132607508886269bcf --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/validate-options.d.ts @@ -0,0 +1,9 @@ +import { GenerateSWOptions, GetManifestOptions, InjectManifestOptions, WebpackGenerateSWOptions, WebpackInjectManifestOptions } from '../types'; +export declare class WorkboxConfigError extends Error { + constructor(message?: string); +} +export declare function validateGenerateSWOptions(input: unknown): GenerateSWOptions; +export declare function validateGetManifestOptions(input: unknown): GetManifestOptions; +export declare function validateInjectManifestOptions(input: unknown): InjectManifestOptions; +export declare function validateWebpackGenerateSWOptions(input: unknown): WebpackGenerateSWOptions; +export declare function validateWebpackInjectManifestOptions(input: unknown): WebpackInjectManifestOptions; diff --git a/tools/ui/node_modules/workbox-build/build/lib/validate-options.js b/tools/ui/node_modules/workbox-build/build/lib/validate-options.js new file mode 100644 index 0000000000000000000000000000000000000000..1266c75aa8323760dd821cfe7835b6ce0e311422 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/validate-options.js @@ -0,0 +1,147 @@ +"use strict"; +/* + Copyright 2021 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateWebpackInjectManifestOptions = exports.validateWebpackGenerateSWOptions = exports.validateInjectManifestOptions = exports.validateGetManifestOptions = exports.validateGenerateSWOptions = exports.WorkboxConfigError = void 0; +const better_ajv_errors_1 = require("@apideck/better-ajv-errors"); +const common_tags_1 = require("common-tags"); +const ajv_1 = __importDefault(require("ajv")); +const errors_1 = require("./errors"); +const ajv = new ajv_1.default({ + useDefaults: true, +}); +const DEFAULT_EXCLUDE_VALUE = [/\.map$/, /^manifest.*\.js$/]; +class WorkboxConfigError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + } +} +exports.WorkboxConfigError = WorkboxConfigError; +// Some methods need to do follow-up validation using the JSON schema, +// so return both the validated options and then schema. +function validate(input, methodName) { + // Don't mutate input: https://github.com/GoogleChrome/workbox/issues/2158 + const inputCopy = Object.assign({}, input); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const jsonSchema = require(`../schema/${methodName}Options.json`); + const validate = ajv.compile(jsonSchema); + if (validate(inputCopy)) { + // All methods support manifestTransforms, so validate it here. + ensureValidManifestTransforms(inputCopy); + return [inputCopy, jsonSchema]; + } + const betterErrors = (0, better_ajv_errors_1.betterAjvErrors)({ + basePath: methodName, + data: input, + errors: validate.errors, + // This is needed as JSONSchema6 is expected, but JSONSchemaType works. + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + schema: jsonSchema, + }); + const messages = betterErrors.map((err) => (0, common_tags_1.oneLine) `[${err.path}] ${err.message}. + ${err.suggestion ? err.suggestion : ''}`); + throw new WorkboxConfigError(messages.join('\n\n')); +} +function ensureValidManifestTransforms(options) { + if ('manifestTransforms' in options && + !(Array.isArray(options.manifestTransforms) && + options.manifestTransforms.every((item) => typeof item === 'function'))) { + throw new WorkboxConfigError(errors_1.errors['manifest-transforms']); + } +} +function ensureValidNavigationPreloadConfig(options) { + if (options.navigationPreload && + (!Array.isArray(options.runtimeCaching) || + options.runtimeCaching.length === 0)) { + throw new WorkboxConfigError(errors_1.errors['nav-preload-runtime-caching']); + } +} +function ensureValidCacheExpiration(options) { + var _a, _b; + for (const runtimeCaching of options.runtimeCaching || []) { + if (((_a = runtimeCaching.options) === null || _a === void 0 ? void 0 : _a.expiration) && + !((_b = runtimeCaching.options) === null || _b === void 0 ? void 0 : _b.cacheName)) { + throw new WorkboxConfigError(errors_1.errors['cache-name-required']); + } + } +} +function ensureValidRuntimeCachingOrGlobDirectory(options) { + if (!options.globDirectory && + (!Array.isArray(options.runtimeCaching) || + options.runtimeCaching.length === 0)) { + throw new WorkboxConfigError(errors_1.errors['no-manifest-entries-or-runtime-caching']); + } +} +// This is... messy, because we can't rely on the built-in ajv validation for +// runtimeCaching.handler, as it needs to accept {} (i.e. any) due to +// https://github.com/GoogleChrome/workbox/pull/2899 +// So we need to perform validation when a string (not a function) is used. +function ensureValidStringHandler(options, jsonSchema) { + var _a, _b, _c, _d; + let validHandlers = []; + /* eslint-disable */ + for (const handler of ((_d = (_c = (_b = (_a = jsonSchema.definitions) === null || _a === void 0 ? void 0 : _a.RuntimeCaching) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c.handler) === null || _d === void 0 ? void 0 : _d.anyOf) || []) { + if ('enum' in handler) { + validHandlers = handler.enum; + break; + } + } + /* eslint-enable */ + for (const runtimeCaching of options.runtimeCaching || []) { + if (typeof runtimeCaching.handler === 'string' && + !validHandlers.includes(runtimeCaching.handler)) { + throw new WorkboxConfigError(errors_1.errors['invalid-handler-string'] + runtimeCaching.handler); + } + } +} +function validateGenerateSWOptions(input) { + const [validatedOptions, jsonSchema] = validate(input, 'GenerateSW'); + ensureValidNavigationPreloadConfig(validatedOptions); + ensureValidCacheExpiration(validatedOptions); + ensureValidRuntimeCachingOrGlobDirectory(validatedOptions); + ensureValidStringHandler(validatedOptions, jsonSchema); + return validatedOptions; +} +exports.validateGenerateSWOptions = validateGenerateSWOptions; +function validateGetManifestOptions(input) { + const [validatedOptions] = validate(input, 'GetManifest'); + return validatedOptions; +} +exports.validateGetManifestOptions = validateGetManifestOptions; +function validateInjectManifestOptions(input) { + const [validatedOptions] = validate(input, 'InjectManifest'); + return validatedOptions; +} +exports.validateInjectManifestOptions = validateInjectManifestOptions; +// The default `exclude: [/\.map$/, /^manifest.*\.js$/]` value can't be +// represented in the JSON schema, so manually set it for the webpack options. +function validateWebpackGenerateSWOptions(input) { + const inputWithExcludeDefault = Object.assign({ + // Make a copy, as exclude can be mutated when used. + exclude: Array.from(DEFAULT_EXCLUDE_VALUE), + }, input); + const [validatedOptions, jsonSchema] = validate(inputWithExcludeDefault, 'WebpackGenerateSW'); + ensureValidNavigationPreloadConfig(validatedOptions); + ensureValidCacheExpiration(validatedOptions); + ensureValidStringHandler(validatedOptions, jsonSchema); + return validatedOptions; +} +exports.validateWebpackGenerateSWOptions = validateWebpackGenerateSWOptions; +function validateWebpackInjectManifestOptions(input) { + const inputWithExcludeDefault = Object.assign({ + // Make a copy, as exclude can be mutated when used. + exclude: Array.from(DEFAULT_EXCLUDE_VALUE), + }, input); + const [validatedOptions] = validate(inputWithExcludeDefault, 'WebpackInjectManifest'); + return validatedOptions; +} +exports.validateWebpackInjectManifestOptions = validateWebpackInjectManifestOptions; diff --git a/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.d.ts b/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bcf04962c68e9412ee0c944a591f1a944d9a9a80 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.d.ts @@ -0,0 +1,4 @@ +import { GenerateSWOptions, ManifestEntry } from '../types'; +export declare function writeSWUsingDefaultTemplate({ babelPresetEnvTargets, cacheId, cleanupOutdatedCaches, clientsClaim, directoryIndex, disableDevLogs, ignoreURLParametersMatching, importScripts, inlineWorkboxRuntime, manifestEntries, mode, navigateFallback, navigateFallbackDenylist, navigateFallbackAllowlist, navigationPreload, offlineGoogleAnalytics, runtimeCaching, skipWaiting, sourcemap, swDest, }: GenerateSWOptions & { + manifestEntries: Array; +}): Promise>; diff --git a/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.js b/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.js new file mode 100644 index 0000000000000000000000000000000000000000..77b34c843d4188fa2adb2573819d1a4ec2ebc055 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/lib/write-sw-using-default-template.js @@ -0,0 +1,71 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeSWUsingDefaultTemplate = void 0; +const fs_extra_1 = __importDefault(require("fs-extra")); +const upath_1 = __importDefault(require("upath")); +const bundle_1 = require("./bundle"); +const errors_1 = require("./errors"); +const populate_sw_template_1 = require("./populate-sw-template"); +async function writeSWUsingDefaultTemplate({ babelPresetEnvTargets, cacheId, cleanupOutdatedCaches, clientsClaim, directoryIndex, disableDevLogs, ignoreURLParametersMatching, importScripts, inlineWorkboxRuntime, manifestEntries, mode, navigateFallback, navigateFallbackDenylist, navigateFallbackAllowlist, navigationPreload, offlineGoogleAnalytics, runtimeCaching, skipWaiting, sourcemap, swDest, }) { + const outputDir = upath_1.default.dirname(swDest); + try { + await fs_extra_1.default.mkdirp(outputDir); + } + catch (error) { + throw new Error(`${errors_1.errors['unable-to-make-sw-directory']}. ` + + `'${error instanceof Error && error.message ? error.message : ''}'`); + } + const unbundledCode = (0, populate_sw_template_1.populateSWTemplate)({ + cacheId, + cleanupOutdatedCaches, + clientsClaim, + directoryIndex, + disableDevLogs, + ignoreURLParametersMatching, + importScripts, + manifestEntries, + navigateFallback, + navigateFallbackDenylist, + navigateFallbackAllowlist, + navigationPreload, + offlineGoogleAnalytics, + runtimeCaching, + skipWaiting, + }); + try { + const files = await (0, bundle_1.bundle)({ + babelPresetEnvTargets, + inlineWorkboxRuntime, + mode, + sourcemap, + swDest, + unbundledCode, + }); + const filePaths = []; + for (const file of files) { + const filePath = upath_1.default.resolve(file.name); + filePaths.push(filePath); + await fs_extra_1.default.writeFile(filePath, file.contents); + } + return filePaths; + } + catch (error) { + const err = error; + if (err.code === 'EISDIR') { + // See https://github.com/GoogleChrome/workbox/issues/612 + throw new Error(errors_1.errors['sw-write-failure-directory']); + } + throw new Error(`${errors_1.errors['sw-write-failure']} '${err.message}'`); + } +} +exports.writeSWUsingDefaultTemplate = writeSWUsingDefaultTemplate; diff --git a/tools/ui/node_modules/workbox-build/build/schema/GenerateSWOptions.json b/tools/ui/node_modules/workbox-build/build/schema/GenerateSWOptions.json new file mode 100644 index 0000000000000000000000000000000000000000..500a4eab86054bdadc3488442c1178423fc72d3b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/schema/GenerateSWOptions.json @@ -0,0 +1,878 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "additionalManifestEntries": { + "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ManifestEntry" + }, + { + "type": "string" + } + ] + } + }, + "dontCacheBustURLsMatching": { + "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.", + "$ref": "#/definitions/RegExp" + }, + "manifestTransforms": { + "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.", + "type": "array", + "items": {} + }, + "maximumFileSizeToCacheInBytes": { + "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.", + "default": 2097152, + "type": "number" + }, + "modifyURLPrefix": { + "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "globFollow": { + "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": true, + "type": "boolean" + }, + "globIgnores": { + "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": [ + "**/node_modules/**/*" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "globPatterns": { + "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).", + "default": [ + "**/*.{js,wasm,css,html}" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "templatedURLs": { + "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.", + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + }, + "babelPresetEnvTargets": { + "description": "The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass\nto `babel-preset-env` when transpiling the service worker bundle.", + "default": [ + "chrome >= 56" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "cacheId": { + "description": "An optional ID to be prepended to cache names. This is primarily useful for\nlocal development where multiple sites may be served from the same\n`http://localhost:port` origin.", + "type": [ + "null", + "string" + ] + }, + "cleanupOutdatedCaches": { + "description": "Whether or not Workbox should attempt to identify and delete any precaches\ncreated by older, incompatible versions.", + "default": false, + "type": "boolean" + }, + "clientsClaim": { + "description": "Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)\nany existing clients as soon as it activates.", + "default": false, + "type": "boolean" + }, + "directoryIndex": { + "description": "If a navigation request for a URL ending in `/` fails to match a precached\nURL, this value will be appended to the URL and that will be checked for a\nprecache match. This should be set to what your web server is using for its\ndirectory index.", + "type": [ + "null", + "string" + ] + }, + "disableDevLogs": { + "default": false, + "type": "boolean" + }, + "ignoreURLParametersMatching": { + "description": "Any search parameter names that match against one of the RegExp in this\narray will be removed before looking for a precache match. This is useful\nif your users might request URLs that contain, for example, URL parameters\nused to track the source of the traffic. If not provided, the default value\nis `[/^utm_/, /^fbclid$/]`.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "importScripts": { + "description": "A list of JavaScript files that should be passed to\n[`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)\ninside the generated service worker file. This is useful when you want to\nlet Workbox create your top-level service worker file, but want to include\nsome additional code, such as a push event listener.", + "type": "array", + "items": { + "type": "string" + } + }, + "inlineWorkboxRuntime": { + "description": "Whether the runtime code for the Workbox library should be included in the\ntop-level service worker, or split into a separate file that needs to be\ndeployed alongside the service worker. Keeping the runtime separate means\nthat users will not have to re-download the Workbox code each time your\ntop-level service worker changes.", + "default": false, + "type": "boolean" + }, + "mode": { + "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `process.env.NODE_ENV` value will be used, and failing that, it\nwill fall back to `'production'`.", + "default": "production", + "type": [ + "null", + "string" + ] + }, + "navigateFallback": { + "description": "If specified, all\n[navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)\nfor URLs that aren't precached will be fulfilled with the HTML at the URL\nprovided. You must pass in the URL of an HTML document that is listed in\nyour precache manifest. This is meant to be used in a Single Page App\nscenario, in which you want all navigations to use common\n[App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).", + "default": null, + "type": [ + "null", + "string" + ] + }, + "navigateFallbackAllowlist": { + "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedent.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "navigateFallbackDenylist": { + "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedence.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "navigationPreload": { + "description": "Whether or not to enable\n[navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)\nin the generated service worker. When set to true, you must also use\n`runtimeCaching` to set up an appropriate response strategy that will match\nnavigation requests, and make use of the preloaded response.", + "default": false, + "type": "boolean" + }, + "offlineGoogleAnalytics": { + "description": "Controls whether or not to include support for\n[offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).\nWhen `true`, the call to `workbox-google-analytics`'s `initialize()` will\nbe added to your generated service worker. When set to an `Object`, that\nobject will be passed in to the `initialize()` call, allowing you to\ncustomize the behavior.", + "default": false, + "anyOf": [ + { + "$ref": "#/definitions/GoogleAnalyticsInitializeOptions" + }, + { + "type": "boolean" + } + ] + }, + "runtimeCaching": { + "description": "When using Workbox's build tools to generate your service worker, you can\nspecify one or more runtime caching configurations. These are then\ntranslated to {@link workbox-routing.registerRoute} calls using the match\nand handler configuration you define.\n\nFor all of the options, see the {@link workbox-build.RuntimeCaching}\ndocumentation. The example below shows a typical configuration, with two\nruntime routes defined:", + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeCaching" + } + }, + "skipWaiting": { + "description": "Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)\nto the generated service worker. If `false`, then a `message` listener will\nbe added instead, allowing client pages to trigger `skipWaiting()` by\ncalling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.", + "default": false, + "type": "boolean" + }, + "sourcemap": { + "description": "Whether to create a sourcemap for the generated service worker files.", + "default": true, + "type": "boolean" + }, + "swDest": { + "description": "The path and filename of the service worker file that will be created by\nthe build process, relative to the current working directory. It must end\nin '.js'.", + "type": "string" + }, + "globDirectory": { + "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.", + "type": "string" + } + }, + "required": [ + "swDest" + ], + "definitions": { + "ManifestEntry": { + "type": "object", + "properties": { + "integrity": { + "type": "string" + }, + "revision": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url" + ] + }, + "RegExp": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "ignoreCase": { + "type": "boolean" + }, + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "number" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode" + ] + }, + "GoogleAnalyticsInitializeOptions": { + "type": "object", + "properties": { + "cacheName": { + "type": "string" + }, + "parameterOverrides": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "hitFilter": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "RuntimeCaching": { + "type": "object", + "properties": { + "handler": { + "description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.", + "anyOf": [ + { + "$ref": "#/definitions/RouteHandlerCallback" + }, + { + "$ref": "#/definitions/RouteHandlerObject" + }, + { + "enum": [ + "CacheFirst", + "CacheOnly", + "NetworkFirst", + "NetworkOnly", + "StaleWhileRevalidate" + ], + "type": "string" + } + ] + }, + "method": { + "description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.", + "default": "GET", + "enum": [ + "DELETE", + "GET", + "HEAD", + "PATCH", + "POST", + "PUT" + ], + "type": "string" + }, + "options": { + "type": "object", + "properties": { + "backgroundSync": { + "description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/QueueOptions" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "broadcastUpdate": { + "description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "channelName": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/BroadcastCacheUpdateOptions" + } + }, + "additionalProperties": false, + "required": [ + "options" + ] + }, + "cacheableResponse": { + "description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/CacheableResponseOptions" + }, + "cacheName": { + "description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.", + "type": [ + "null", + "string" + ] + }, + "expiration": { + "description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/ExpirationPluginOptions" + }, + "networkTimeoutSeconds": { + "description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.", + "type": "number" + }, + "plugins": { + "description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkboxPlugin" + } + }, + "precacheFallback": { + "description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "fallbackURL": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "fallbackURL" + ] + }, + "rangeRequests": { + "description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "type": "boolean" + }, + "fetchOptions": { + "description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/RequestInit" + }, + "matchOptions": { + "description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/CacheQueryOptions" + } + }, + "additionalProperties": false + }, + "urlPattern": { + "description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.", + "anyOf": [ + { + "$ref": "#/definitions/RegExp" + }, + { + "$ref": "#/definitions/RouteMatchCallback" + }, + { + "type": "string" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "handler", + "urlPattern" + ] + }, + "RouteHandlerCallback": {}, + "RouteHandlerObject": { + "description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).", + "type": "object", + "properties": { + "handle": { + "$ref": "#/definitions/RouteHandlerCallback" + } + }, + "additionalProperties": false, + "required": [ + "handle" + ] + }, + "QueueOptions": { + "type": "object", + "properties": { + "forceSyncFallback": { + "type": "boolean" + }, + "maxRetentionTime": { + "type": "number" + }, + "onSync": { + "$ref": "#/definitions/OnSyncCallback" + } + }, + "additionalProperties": false + }, + "OnSyncCallback": {}, + "BroadcastCacheUpdateOptions": { + "type": "object", + "properties": { + "headersToCheck": { + "type": "array", + "items": { + "type": "string" + } + }, + "generatePayload": { + "type": "object", + "additionalProperties": false + }, + "notifyAllClients": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CacheableResponseOptions": { + "type": "object", + "properties": { + "statuses": { + "type": "array", + "items": { + "type": "number" + } + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ExpirationPluginOptions": { + "type": "object", + "properties": { + "maxEntries": { + "type": "number" + }, + "maxAgeSeconds": { + "type": "number" + }, + "matchOptions": { + "$ref": "#/definitions/CacheQueryOptions" + }, + "purgeOnQuotaError": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CacheQueryOptions": { + "type": "object", + "properties": { + "ignoreMethod": { + "type": "boolean" + }, + "ignoreSearch": { + "type": "boolean" + }, + "ignoreVary": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "WorkboxPlugin": { + "description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.", + "type": "object", + "properties": { + "cacheDidUpdate": {}, + "cachedResponseWillBeUsed": {}, + "cacheKeyWillBeUsed": {}, + "cacheWillUpdate": {}, + "fetchDidFail": {}, + "fetchDidSucceed": {}, + "handlerDidComplete": {}, + "handlerDidError": {}, + "handlerDidRespond": {}, + "handlerWillRespond": {}, + "handlerWillStart": {}, + "requestWillFetch": {} + }, + "additionalProperties": false + }, + "CacheDidUpdateCallback": { + "type": "object", + "additionalProperties": false + }, + "CachedResponseWillBeUsedCallback": { + "type": "object", + "additionalProperties": false + }, + "CacheKeyWillBeUsedCallback": { + "type": "object", + "additionalProperties": false + }, + "CacheWillUpdateCallback": { + "type": "object", + "additionalProperties": false + }, + "FetchDidFailCallback": { + "type": "object", + "additionalProperties": false + }, + "FetchDidSucceedCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidCompleteCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidErrorCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidRespondCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerWillRespondCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerWillStartCallback": { + "type": "object", + "additionalProperties": false + }, + "RequestWillFetchCallback": { + "type": "object", + "additionalProperties": false + }, + "RequestInit": { + "type": "object", + "properties": { + "body": { + "anyOf": [ + { + "$ref": "#/definitions/ArrayBuffer" + }, + { + "$ref": "#/definitions/ArrayBufferView" + }, + { + "$ref": "#/definitions/ReadableStream" + }, + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/FormData" + }, + { + "$ref": "#/definitions/URLSearchParams" + }, + { + "type": [ + "null", + "string" + ] + } + ] + }, + "cache": { + "enum": [ + "default", + "force-cache", + "no-cache", + "no-store", + "only-if-cached", + "reload" + ], + "type": "string" + }, + "credentials": { + "enum": [ + "include", + "omit", + "same-origin" + ], + "type": "string" + }, + "headers": { + "anyOf": [ + { + "$ref": "#/definitions/Record" + }, + { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + { + "$ref": "#/definitions/Headers" + } + ] + }, + "integrity": { + "type": "string" + }, + "keepalive": { + "type": "boolean" + }, + "method": { + "type": "string" + }, + "mode": { + "enum": [ + "cors", + "navigate", + "no-cors", + "same-origin" + ], + "type": "string" + }, + "redirect": { + "enum": [ + "error", + "follow", + "manual" + ], + "type": "string" + }, + "referrer": { + "type": "string" + }, + "referrerPolicy": { + "enum": [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "origin", + "origin-when-cross-origin", + "same-origin", + "strict-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ], + "type": "string" + }, + "signal": { + "anyOf": [ + { + "$ref": "#/definitions/AbortSignal" + }, + { + "type": "null" + } + ] + }, + "window": { + "type": "null" + } + }, + "additionalProperties": false + }, + "ArrayBuffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + }, + "__@toStringTag@32": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "__@toStringTag@32", + "byteLength" + ] + }, + "ArrayBufferView": { + "type": "object", + "properties": { + "buffer": { + "$ref": "#/definitions/ArrayBufferLike" + }, + "byteLength": { + "type": "number" + }, + "byteOffset": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "buffer", + "byteLength", + "byteOffset" + ] + }, + "ArrayBufferLike": { + "anyOf": [ + { + "$ref": "#/definitions/ArrayBuffer" + }, + { + "$ref": "#/definitions/SharedArrayBuffer" + } + ] + }, + "SharedArrayBuffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + }, + "__@species@492": { + "$ref": "#/definitions/SharedArrayBuffer" + }, + "__@toStringTag@32": { + "type": "string", + "const": "SharedArrayBuffer" + } + }, + "additionalProperties": false, + "required": [ + "__@species@492", + "__@toStringTag@32", + "byteLength" + ] + }, + "ReadableStream": { + "type": "object", + "properties": { + "locked": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "locked" + ] + }, + "Blob": { + "type": "object", + "properties": { + "size": { + "type": "number" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "size", + "type" + ] + }, + "FormData": { + "type": "object", + "additionalProperties": false + }, + "URLSearchParams": { + "type": "object", + "properties": { + "size": { + "description": "The total number of parameter entries.", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "size" + ] + }, + "Record": { + "type": "object", + "additionalProperties": false + }, + "Headers": { + "type": "object", + "additionalProperties": false + }, + "AbortSignal": {}, + "RouteMatchCallback": {} + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/tools/ui/node_modules/workbox-build/build/schema/GetManifestOptions.json b/tools/ui/node_modules/workbox-build/build/schema/GetManifestOptions.json new file mode 100644 index 0000000000000000000000000000000000000000..e569ddba18ff3e1d9e8d0f5d97cd7c7755f574af --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/schema/GetManifestOptions.json @@ -0,0 +1,163 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "additionalManifestEntries": { + "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ManifestEntry" + }, + { + "type": "string" + } + ] + } + }, + "dontCacheBustURLsMatching": { + "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.", + "$ref": "#/definitions/RegExp" + }, + "manifestTransforms": { + "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.", + "type": "array", + "items": {} + }, + "maximumFileSizeToCacheInBytes": { + "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.", + "default": 2097152, + "type": "number" + }, + "modifyURLPrefix": { + "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "globFollow": { + "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": true, + "type": "boolean" + }, + "globIgnores": { + "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": [ + "**/node_modules/**/*" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "globPatterns": { + "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).", + "default": [ + "**/*.{js,wasm,css,html}" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "templatedURLs": { + "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.", + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + }, + "globDirectory": { + "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.", + "type": "string" + } + }, + "required": [ + "globDirectory" + ], + "definitions": { + "ManifestEntry": { + "type": "object", + "properties": { + "integrity": { + "type": "string" + }, + "revision": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url" + ] + }, + "RegExp": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "ignoreCase": { + "type": "boolean" + }, + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "number" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/tools/ui/node_modules/workbox-build/build/schema/InjectManifestOptions.json b/tools/ui/node_modules/workbox-build/build/schema/InjectManifestOptions.json new file mode 100644 index 0000000000000000000000000000000000000000..403d2a4a218528ece216aebec83c25f8edc952bf --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/schema/InjectManifestOptions.json @@ -0,0 +1,178 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "additionalManifestEntries": { + "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ManifestEntry" + }, + { + "type": "string" + } + ] + } + }, + "dontCacheBustURLsMatching": { + "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.", + "$ref": "#/definitions/RegExp" + }, + "manifestTransforms": { + "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.", + "type": "array", + "items": {} + }, + "maximumFileSizeToCacheInBytes": { + "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.", + "default": 2097152, + "type": "number" + }, + "modifyURLPrefix": { + "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "globFollow": { + "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": true, + "type": "boolean" + }, + "globIgnores": { + "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).", + "default": [ + "**/node_modules/**/*" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "globPatterns": { + "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).", + "default": [ + "**/*.{js,wasm,css,html}" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "templatedURLs": { + "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.", + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + }, + "injectionPoint": { + "description": "The string to find inside of the `swSrc` file. Once found, it will be\nreplaced by the generated precache manifest.", + "default": "self.__WB_MANIFEST", + "type": "string" + }, + "swSrc": { + "description": "The path and filename of the service worker file that will be read during\nthe build process, relative to the current working directory.", + "type": "string" + }, + "swDest": { + "description": "The path and filename of the service worker file that will be created by\nthe build process, relative to the current working directory. It must end\nin '.js'.", + "type": "string" + }, + "globDirectory": { + "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.", + "type": "string" + } + }, + "required": [ + "globDirectory", + "swDest", + "swSrc" + ], + "definitions": { + "ManifestEntry": { + "type": "object", + "properties": { + "integrity": { + "type": "string" + }, + "revision": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url" + ] + }, + "RegExp": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "ignoreCase": { + "type": "boolean" + }, + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "number" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/tools/ui/node_modules/workbox-build/build/schema/WebpackGenerateSWOptions.json b/tools/ui/node_modules/workbox-build/build/schema/WebpackGenerateSWOptions.json new file mode 100644 index 0000000000000000000000000000000000000000..ef797d6a92597d95cb08340406bc48d8c0c94f50 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/schema/WebpackGenerateSWOptions.json @@ -0,0 +1,861 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "additionalManifestEntries": { + "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ManifestEntry" + }, + { + "type": "string" + } + ] + } + }, + "dontCacheBustURLsMatching": { + "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.", + "$ref": "#/definitions/RegExp" + }, + "manifestTransforms": { + "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.", + "type": "array", + "items": {} + }, + "maximumFileSizeToCacheInBytes": { + "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.", + "default": 2097152, + "type": "number" + }, + "modifyURLPrefix": { + "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "chunks": { + "description": "One or more chunk names whose corresponding output files should be included\nin the precache manifest.", + "type": "array", + "items": { + "type": "string" + } + }, + "exclude": { + "description": "One or more specifiers used to exclude assets from the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `exclude` option.\nIf not provided, the default value is `[/\\.map$/, /^manifest.*\\.js$]`.", + "type": "array", + "items": {} + }, + "excludeChunks": { + "description": "One or more chunk names whose corresponding output files should be excluded\nfrom the precache manifest.", + "type": "array", + "items": { + "type": "string" + } + }, + "include": { + "description": "One or more specifiers used to include assets in the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `include` option.", + "type": "array", + "items": {} + }, + "mode": { + "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `process.env.NODE_ENV` value will be used, and failing that, it\nwill fall back to `'production'`.", + "default": "production", + "type": [ + "null", + "string" + ] + }, + "babelPresetEnvTargets": { + "description": "The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass\nto `babel-preset-env` when transpiling the service worker bundle.", + "default": [ + "chrome >= 56" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "cacheId": { + "description": "An optional ID to be prepended to cache names. This is primarily useful for\nlocal development where multiple sites may be served from the same\n`http://localhost:port` origin.", + "type": [ + "null", + "string" + ] + }, + "cleanupOutdatedCaches": { + "description": "Whether or not Workbox should attempt to identify and delete any precaches\ncreated by older, incompatible versions.", + "default": false, + "type": "boolean" + }, + "clientsClaim": { + "description": "Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)\nany existing clients as soon as it activates.", + "default": false, + "type": "boolean" + }, + "directoryIndex": { + "description": "If a navigation request for a URL ending in `/` fails to match a precached\nURL, this value will be appended to the URL and that will be checked for a\nprecache match. This should be set to what your web server is using for its\ndirectory index.", + "type": [ + "null", + "string" + ] + }, + "disableDevLogs": { + "default": false, + "type": "boolean" + }, + "ignoreURLParametersMatching": { + "description": "Any search parameter names that match against one of the RegExp in this\narray will be removed before looking for a precache match. This is useful\nif your users might request URLs that contain, for example, URL parameters\nused to track the source of the traffic. If not provided, the default value\nis `[/^utm_/, /^fbclid$/]`.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "importScripts": { + "description": "A list of JavaScript files that should be passed to\n[`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)\ninside the generated service worker file. This is useful when you want to\nlet Workbox create your top-level service worker file, but want to include\nsome additional code, such as a push event listener.", + "type": "array", + "items": { + "type": "string" + } + }, + "inlineWorkboxRuntime": { + "description": "Whether the runtime code for the Workbox library should be included in the\ntop-level service worker, or split into a separate file that needs to be\ndeployed alongside the service worker. Keeping the runtime separate means\nthat users will not have to re-download the Workbox code each time your\ntop-level service worker changes.", + "default": false, + "type": "boolean" + }, + "navigateFallback": { + "description": "If specified, all\n[navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)\nfor URLs that aren't precached will be fulfilled with the HTML at the URL\nprovided. You must pass in the URL of an HTML document that is listed in\nyour precache manifest. This is meant to be used in a Single Page App\nscenario, in which you want all navigations to use common\n[App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).", + "default": null, + "type": [ + "null", + "string" + ] + }, + "navigateFallbackAllowlist": { + "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedent.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "navigateFallbackDenylist": { + "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedence.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.", + "type": "array", + "items": { + "$ref": "#/definitions/RegExp" + } + }, + "navigationPreload": { + "description": "Whether or not to enable\n[navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)\nin the generated service worker. When set to true, you must also use\n`runtimeCaching` to set up an appropriate response strategy that will match\nnavigation requests, and make use of the preloaded response.", + "default": false, + "type": "boolean" + }, + "offlineGoogleAnalytics": { + "description": "Controls whether or not to include support for\n[offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).\nWhen `true`, the call to `workbox-google-analytics`'s `initialize()` will\nbe added to your generated service worker. When set to an `Object`, that\nobject will be passed in to the `initialize()` call, allowing you to\ncustomize the behavior.", + "default": false, + "anyOf": [ + { + "$ref": "#/definitions/GoogleAnalyticsInitializeOptions" + }, + { + "type": "boolean" + } + ] + }, + "runtimeCaching": { + "description": "When using Workbox's build tools to generate your service worker, you can\nspecify one or more runtime caching configurations. These are then\ntranslated to {@link workbox-routing.registerRoute} calls using the match\nand handler configuration you define.\n\nFor all of the options, see the {@link workbox-build.RuntimeCaching}\ndocumentation. The example below shows a typical configuration, with two\nruntime routes defined:", + "type": "array", + "items": { + "$ref": "#/definitions/RuntimeCaching" + } + }, + "skipWaiting": { + "description": "Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)\nto the generated service worker. If `false`, then a `message` listener will\nbe added instead, allowing client pages to trigger `skipWaiting()` by\ncalling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.", + "default": false, + "type": "boolean" + }, + "sourcemap": { + "description": "Whether to create a sourcemap for the generated service worker files.", + "default": true, + "type": "boolean" + }, + "importScriptsViaChunks": { + "description": "One or more names of webpack chunks. The content of those chunks will be\nincluded in the generated service worker, via a call to `importScripts()`.", + "type": "array", + "items": { + "type": "string" + } + }, + "swDest": { + "description": "The asset name of the service worker file created by this plugin.", + "default": "service-worker.js", + "type": "string" + } + }, + "definitions": { + "ManifestEntry": { + "type": "object", + "properties": { + "integrity": { + "type": "string" + }, + "revision": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url" + ] + }, + "RegExp": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "ignoreCase": { + "type": "boolean" + }, + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "number" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode" + ] + }, + "GoogleAnalyticsInitializeOptions": { + "type": "object", + "properties": { + "cacheName": { + "type": "string" + }, + "parameterOverrides": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "hitFilter": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "RuntimeCaching": { + "type": "object", + "properties": { + "handler": { + "description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.", + "anyOf": [ + { + "$ref": "#/definitions/RouteHandlerCallback" + }, + { + "$ref": "#/definitions/RouteHandlerObject" + }, + { + "enum": [ + "CacheFirst", + "CacheOnly", + "NetworkFirst", + "NetworkOnly", + "StaleWhileRevalidate" + ], + "type": "string" + } + ] + }, + "method": { + "description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.", + "default": "GET", + "enum": [ + "DELETE", + "GET", + "HEAD", + "PATCH", + "POST", + "PUT" + ], + "type": "string" + }, + "options": { + "type": "object", + "properties": { + "backgroundSync": { + "description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/QueueOptions" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "broadcastUpdate": { + "description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "channelName": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/BroadcastCacheUpdateOptions" + } + }, + "additionalProperties": false, + "required": [ + "options" + ] + }, + "cacheableResponse": { + "description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/CacheableResponseOptions" + }, + "cacheName": { + "description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.", + "type": [ + "null", + "string" + ] + }, + "expiration": { + "description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/ExpirationPluginOptions" + }, + "networkTimeoutSeconds": { + "description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.", + "type": "number" + }, + "plugins": { + "description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkboxPlugin" + } + }, + "precacheFallback": { + "description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "type": "object", + "properties": { + "fallbackURL": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "fallbackURL" + ] + }, + "rangeRequests": { + "description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.", + "type": "boolean" + }, + "fetchOptions": { + "description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/RequestInit" + }, + "matchOptions": { + "description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.", + "$ref": "#/definitions/CacheQueryOptions" + } + }, + "additionalProperties": false + }, + "urlPattern": { + "description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.", + "anyOf": [ + { + "$ref": "#/definitions/RegExp" + }, + { + "$ref": "#/definitions/RouteMatchCallback" + }, + { + "type": "string" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "handler", + "urlPattern" + ] + }, + "RouteHandlerCallback": {}, + "RouteHandlerObject": { + "description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).", + "type": "object", + "properties": { + "handle": { + "$ref": "#/definitions/RouteHandlerCallback" + } + }, + "additionalProperties": false, + "required": [ + "handle" + ] + }, + "QueueOptions": { + "type": "object", + "properties": { + "forceSyncFallback": { + "type": "boolean" + }, + "maxRetentionTime": { + "type": "number" + }, + "onSync": { + "$ref": "#/definitions/OnSyncCallback" + } + }, + "additionalProperties": false + }, + "OnSyncCallback": {}, + "BroadcastCacheUpdateOptions": { + "type": "object", + "properties": { + "headersToCheck": { + "type": "array", + "items": { + "type": "string" + } + }, + "generatePayload": { + "type": "object", + "additionalProperties": false + }, + "notifyAllClients": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CacheableResponseOptions": { + "type": "object", + "properties": { + "statuses": { + "type": "array", + "items": { + "type": "number" + } + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ExpirationPluginOptions": { + "type": "object", + "properties": { + "maxEntries": { + "type": "number" + }, + "maxAgeSeconds": { + "type": "number" + }, + "matchOptions": { + "$ref": "#/definitions/CacheQueryOptions" + }, + "purgeOnQuotaError": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CacheQueryOptions": { + "type": "object", + "properties": { + "ignoreMethod": { + "type": "boolean" + }, + "ignoreSearch": { + "type": "boolean" + }, + "ignoreVary": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "WorkboxPlugin": { + "description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.", + "type": "object", + "properties": { + "cacheDidUpdate": {}, + "cachedResponseWillBeUsed": {}, + "cacheKeyWillBeUsed": {}, + "cacheWillUpdate": {}, + "fetchDidFail": {}, + "fetchDidSucceed": {}, + "handlerDidComplete": {}, + "handlerDidError": {}, + "handlerDidRespond": {}, + "handlerWillRespond": {}, + "handlerWillStart": {}, + "requestWillFetch": {} + }, + "additionalProperties": false + }, + "CacheDidUpdateCallback": { + "type": "object", + "additionalProperties": false + }, + "CachedResponseWillBeUsedCallback": { + "type": "object", + "additionalProperties": false + }, + "CacheKeyWillBeUsedCallback": { + "type": "object", + "additionalProperties": false + }, + "CacheWillUpdateCallback": { + "type": "object", + "additionalProperties": false + }, + "FetchDidFailCallback": { + "type": "object", + "additionalProperties": false + }, + "FetchDidSucceedCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidCompleteCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidErrorCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerDidRespondCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerWillRespondCallback": { + "type": "object", + "additionalProperties": false + }, + "HandlerWillStartCallback": { + "type": "object", + "additionalProperties": false + }, + "RequestWillFetchCallback": { + "type": "object", + "additionalProperties": false + }, + "RequestInit": { + "type": "object", + "properties": { + "body": { + "anyOf": [ + { + "$ref": "#/definitions/ArrayBuffer" + }, + { + "$ref": "#/definitions/ArrayBufferView" + }, + { + "$ref": "#/definitions/ReadableStream" + }, + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/FormData" + }, + { + "$ref": "#/definitions/URLSearchParams" + }, + { + "type": [ + "null", + "string" + ] + } + ] + }, + "cache": { + "enum": [ + "default", + "force-cache", + "no-cache", + "no-store", + "only-if-cached", + "reload" + ], + "type": "string" + }, + "credentials": { + "enum": [ + "include", + "omit", + "same-origin" + ], + "type": "string" + }, + "headers": { + "anyOf": [ + { + "$ref": "#/definitions/Record" + }, + { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + { + "$ref": "#/definitions/Headers" + } + ] + }, + "integrity": { + "type": "string" + }, + "keepalive": { + "type": "boolean" + }, + "method": { + "type": "string" + }, + "mode": { + "enum": [ + "cors", + "navigate", + "no-cors", + "same-origin" + ], + "type": "string" + }, + "redirect": { + "enum": [ + "error", + "follow", + "manual" + ], + "type": "string" + }, + "referrer": { + "type": "string" + }, + "referrerPolicy": { + "enum": [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "origin", + "origin-when-cross-origin", + "same-origin", + "strict-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ], + "type": "string" + }, + "signal": { + "anyOf": [ + { + "$ref": "#/definitions/AbortSignal" + }, + { + "type": "null" + } + ] + }, + "window": { + "type": "null" + } + }, + "additionalProperties": false + }, + "ArrayBuffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + }, + "__@toStringTag@32": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "__@toStringTag@32", + "byteLength" + ] + }, + "ArrayBufferView": { + "type": "object", + "properties": { + "buffer": { + "$ref": "#/definitions/ArrayBufferLike" + }, + "byteLength": { + "type": "number" + }, + "byteOffset": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "buffer", + "byteLength", + "byteOffset" + ] + }, + "ArrayBufferLike": { + "anyOf": [ + { + "$ref": "#/definitions/ArrayBuffer" + }, + { + "$ref": "#/definitions/SharedArrayBuffer" + } + ] + }, + "SharedArrayBuffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + }, + "__@species@492": { + "$ref": "#/definitions/SharedArrayBuffer" + }, + "__@toStringTag@32": { + "type": "string", + "const": "SharedArrayBuffer" + } + }, + "additionalProperties": false, + "required": [ + "__@species@492", + "__@toStringTag@32", + "byteLength" + ] + }, + "ReadableStream": { + "type": "object", + "properties": { + "locked": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "locked" + ] + }, + "Blob": { + "type": "object", + "properties": { + "size": { + "type": "number" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "size", + "type" + ] + }, + "FormData": { + "type": "object", + "additionalProperties": false + }, + "URLSearchParams": { + "type": "object", + "properties": { + "size": { + "description": "The total number of parameter entries.", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "size" + ] + }, + "Record": { + "type": "object", + "additionalProperties": false + }, + "Headers": { + "type": "object", + "additionalProperties": false + }, + "AbortSignal": {}, + "RouteMatchCallback": {} + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/tools/ui/node_modules/workbox-build/build/schema/WebpackInjectManifestOptions.json b/tools/ui/node_modules/workbox-build/build/schema/WebpackInjectManifestOptions.json new file mode 100644 index 0000000000000000000000000000000000000000..afd5703cbef2e8f2e0ea9c3ceb55ea15cbbca498 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/schema/WebpackInjectManifestOptions.json @@ -0,0 +1,171 @@ +{ + "additionalProperties": false, + "type": "object", + "properties": { + "additionalManifestEntries": { + "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ManifestEntry" + }, + { + "type": "string" + } + ] + } + }, + "dontCacheBustURLsMatching": { + "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.", + "$ref": "#/definitions/RegExp" + }, + "manifestTransforms": { + "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.", + "type": "array", + "items": {} + }, + "maximumFileSizeToCacheInBytes": { + "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.", + "default": 2097152, + "type": "number" + }, + "modifyURLPrefix": { + "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "chunks": { + "description": "One or more chunk names whose corresponding output files should be included\nin the precache manifest.", + "type": "array", + "items": { + "type": "string" + } + }, + "exclude": { + "description": "One or more specifiers used to exclude assets from the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `exclude` option.\nIf not provided, the default value is `[/\\.map$/, /^manifest.*\\.js$]`.", + "type": "array", + "items": {} + }, + "excludeChunks": { + "description": "One or more chunk names whose corresponding output files should be excluded\nfrom the precache manifest.", + "type": "array", + "items": { + "type": "string" + } + }, + "include": { + "description": "One or more specifiers used to include assets in the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `include` option.", + "type": "array", + "items": {} + }, + "mode": { + "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `mode` value configured in the current `webpack` compilation\nwill be used.", + "type": [ + "null", + "string" + ] + }, + "injectionPoint": { + "description": "The string to find inside of the `swSrc` file. Once found, it will be\nreplaced by the generated precache manifest.", + "default": "self.__WB_MANIFEST", + "type": "string" + }, + "swSrc": { + "description": "The path and filename of the service worker file that will be read during\nthe build process, relative to the current working directory.", + "type": "string" + }, + "compileSrc": { + "description": "When `true` (the default), the `swSrc` file will be compiled by webpack.\nWhen `false`, compilation will not occur (and `webpackCompilationPlugins`\ncan't be used.) Set to `false` if you want to inject the manifest into,\ne.g., a JSON file.", + "default": true, + "type": "boolean" + }, + "swDest": { + "description": "The asset name of the service worker file that will be created by this\nplugin. If omitted, the name will be based on the `swSrc` name.", + "type": "string" + }, + "webpackCompilationPlugins": { + "description": "Optional `webpack` plugins that will be used when compiling the `swSrc`\ninput file. Only valid if `compileSrc` is `true`.", + "type": "array", + "items": {} + } + }, + "required": [ + "swSrc" + ], + "definitions": { + "ManifestEntry": { + "type": "object", + "properties": { + "integrity": { + "type": "string" + }, + "revision": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url" + ] + }, + "RegExp": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "ignoreCase": { + "type": "boolean" + }, + "multiline": { + "type": "boolean" + }, + "lastIndex": { + "type": "number" + }, + "flags": { + "type": "string" + }, + "sticky": { + "type": "boolean" + }, + "unicode": { + "type": "boolean" + }, + "dotAll": { + "type": "boolean" + }, + "hasIndices": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "dotAll", + "flags", + "global", + "hasIndices", + "ignoreCase", + "lastIndex", + "multiline", + "source", + "sticky", + "unicode" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/tools/ui/node_modules/workbox-build/build/templates/sw-template.d.ts b/tools/ui/node_modules/workbox-build/build/templates/sw-template.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc99f8fba5d2aa055f71e6f0859bcec9bd2590d2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/templates/sw-template.d.ts @@ -0,0 +1 @@ +export declare const swTemplate = "/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n<% if (importScripts) { %>\nimportScripts(\n <%= importScripts.map(JSON.stringify).join(',\\n ') %>\n);\n<% } %>\n\n<% if (navigationPreload) { %><%= use('workbox-navigation-preload', 'enable') %>();<% } %>\n\n<% if (cacheId) { %><%= use('workbox-core', 'setCacheNameDetails') %>({prefix: <%= JSON.stringify(cacheId) %>});<% } %>\n\n<% if (skipWaiting) { %>\nself.skipWaiting();\n<% } else { %>\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n<% } %>\n<% if (clientsClaim) { %><%= use('workbox-core', 'clientsClaim') %>();<% } %>\n\n<% if (Array.isArray(manifestEntries) && manifestEntries.length > 0) {%>\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\n<%= use('workbox-precaching', 'precacheAndRoute') %>(<%= JSON.stringify(manifestEntries, null, 2) %>, <%= precacheOptionsString %>);\n<% if (cleanupOutdatedCaches) { %><%= use('workbox-precaching', 'cleanupOutdatedCaches') %>();<% } %>\n<% if (navigateFallback) { %><%= use('workbox-routing', 'registerRoute') %>(new <%= use('workbox-routing', 'NavigationRoute') %>(<%= use('workbox-precaching', 'createHandlerBoundToURL') %>(<%= JSON.stringify(navigateFallback) %>)<% if (navigateFallbackAllowlist || navigateFallbackDenylist) { %>, {\n <% if (navigateFallbackAllowlist) { %>allowlist: [<%= navigateFallbackAllowlist %>],<% } %>\n <% if (navigateFallbackDenylist) { %>denylist: [<%= navigateFallbackDenylist %>],<% } %>\n}<% } %>));<% } %>\n<% } %>\n\n<% if (runtimeCaching) { runtimeCaching.forEach(runtimeCachingString => {%><%= runtimeCachingString %><% });} %>\n\n<% if (offlineAnalyticsConfigString) { %><%= use('workbox-google-analytics', 'initialize') %>(<%= offlineAnalyticsConfigString %>);<% } %>\n\n<% if (disableDevLogs) { %>self.__WB_DISABLE_DEV_LOGS = true;<% } %>"; diff --git a/tools/ui/node_modules/workbox-build/build/templates/sw-template.js b/tools/ui/node_modules/workbox-build/build/templates/sw-template.js new file mode 100644 index 0000000000000000000000000000000000000000..36adc39078f9e639ae19b5bc0d9c28cfd8cb7ecc --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/templates/sw-template.js @@ -0,0 +1,62 @@ +"use strict"; +/* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.swTemplate = void 0; +exports.swTemplate = `/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +<% if (importScripts) { %> +importScripts( + <%= importScripts.map(JSON.stringify).join(',\\n ') %> +); +<% } %> + +<% if (navigationPreload) { %><%= use('workbox-navigation-preload', 'enable') %>();<% } %> + +<% if (cacheId) { %><%= use('workbox-core', 'setCacheNameDetails') %>({prefix: <%= JSON.stringify(cacheId) %>});<% } %> + +<% if (skipWaiting) { %> +self.skipWaiting(); +<% } else { %> +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); +<% } %> +<% if (clientsClaim) { %><%= use('workbox-core', 'clientsClaim') %>();<% } %> + +<% if (Array.isArray(manifestEntries) && manifestEntries.length > 0) {%> +/** + * The precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +<%= use('workbox-precaching', 'precacheAndRoute') %>(<%= JSON.stringify(manifestEntries, null, 2) %>, <%= precacheOptionsString %>); +<% if (cleanupOutdatedCaches) { %><%= use('workbox-precaching', 'cleanupOutdatedCaches') %>();<% } %> +<% if (navigateFallback) { %><%= use('workbox-routing', 'registerRoute') %>(new <%= use('workbox-routing', 'NavigationRoute') %>(<%= use('workbox-precaching', 'createHandlerBoundToURL') %>(<%= JSON.stringify(navigateFallback) %>)<% if (navigateFallbackAllowlist || navigateFallbackDenylist) { %>, { + <% if (navigateFallbackAllowlist) { %>allowlist: [<%= navigateFallbackAllowlist %>],<% } %> + <% if (navigateFallbackDenylist) { %>denylist: [<%= navigateFallbackDenylist %>],<% } %> +}<% } %>));<% } %> +<% } %> + +<% if (runtimeCaching) { runtimeCaching.forEach(runtimeCachingString => {%><%= runtimeCachingString %><% });} %> + +<% if (offlineAnalyticsConfigString) { %><%= use('workbox-google-analytics', 'initialize') %>(<%= offlineAnalyticsConfigString %>);<% } %> + +<% if (disableDevLogs) { %>self.__WB_DISABLE_DEV_LOGS = true;<% } %>`; diff --git a/tools/ui/node_modules/workbox-build/build/types.d.ts b/tools/ui/node_modules/workbox-build/build/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..647ec8fd3d5750df5a1e25c42dbec1ee328a3b7d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/types.d.ts @@ -0,0 +1,520 @@ +import { PackageJson } from 'type-fest'; +import { BroadcastCacheUpdateOptions } from 'workbox-broadcast-update/BroadcastCacheUpdate'; +import { GoogleAnalyticsInitializeOptions } from 'workbox-google-analytics/initialize'; +import { HTTPMethod } from 'workbox-routing/utils/constants'; +import { QueueOptions } from 'workbox-background-sync/Queue'; +import { RouteHandler, RouteMatchCallback } from 'workbox-core/types'; +import { CacheableResponseOptions } from 'workbox-cacheable-response/CacheableResponse'; +import { ExpirationPluginOptions } from 'workbox-expiration/ExpirationPlugin'; +import { WorkboxPlugin } from 'workbox-core/types'; +export interface ManifestEntry { + integrity?: string; + revision: string | null; + url: string; +} +export type StrategyName = 'CacheFirst' | 'CacheOnly' | 'NetworkFirst' | 'NetworkOnly' | 'StaleWhileRevalidate'; +export interface RuntimeCaching { + /** + * This determines how the runtime route will generate a response. + * To use one of the built-in {@link workbox-strategies}, provide its name, + * like `'NetworkFirst'`. + * Alternatively, this can be a {@link workbox-core.RouteHandler} callback + * function with custom response logic. + */ + handler: RouteHandler | StrategyName; + /** + * The HTTP method to match against. The default value of `'GET'` is normally + * sufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or + * another type of request. + * @default "GET" + */ + method?: HTTPMethod; + options?: { + /** + * Configuring this will add a + * {@link workbox-background-sync.BackgroundSyncPlugin} instance to the + * {@link workbox-strategies} configured in `handler`. + */ + backgroundSync?: { + name: string; + options?: QueueOptions; + }; + /** + * Configuring this will add a + * {@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the + * {@link workbox-strategies} configured in `handler`. + */ + broadcastUpdate?: { + channelName?: string; + options: BroadcastCacheUpdateOptions; + }; + /** + * Configuring this will add a + * {@link workbox-cacheable-response.CacheableResponsePlugin} instance to + * the {@link workbox-strategies} configured in `handler`. + */ + cacheableResponse?: CacheableResponseOptions; + /** + * If provided, this will set the `cacheName` property of the + * {@link workbox-strategies} configured in `handler`. + */ + cacheName?: string | null; + /** + * Configuring this will add a + * {@link workbox-expiration.ExpirationPlugin} instance to + * the {@link workbox-strategies} configured in `handler`. + */ + expiration?: ExpirationPluginOptions; + /** + * If provided, this will set the `networkTimeoutSeconds` property of the + * {@link workbox-strategies} configured in `handler`. Note that only + * `'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`. + */ + networkTimeoutSeconds?: number; + /** + * Configuring this allows the use of one or more Workbox plugins that + * don't have "shortcut" options (like `expiration` for + * {@link workbox-expiration.ExpirationPlugin}). The plugins provided here + * will be added to the {@link workbox-strategies} configured in `handler`. + */ + plugins?: Array; + /** + * Configuring this will add a + * {@link workbox-precaching.PrecacheFallbackPlugin} instance to + * the {@link workbox-strategies} configured in `handler`. + */ + precacheFallback?: { + fallbackURL: string; + }; + /** + * Enabling this will add a + * {@link workbox-range-requests.RangeRequestsPlugin} instance to + * the {@link workbox-strategies} configured in `handler`. + */ + rangeRequests?: boolean; + /** + * Configuring this will pass along the `fetchOptions` value to + * the {@link workbox-strategies} configured in `handler`. + */ + fetchOptions?: RequestInit; + /** + * Configuring this will pass along the `matchOptions` value to + * the {@link workbox-strategies} configured in `handler`. + */ + matchOptions?: CacheQueryOptions; + }; + /** + * This match criteria determines whether the configured handler will + * generate a response for any requests that don't match one of the precached + * URLs. If multiple `RuntimeCaching` routes are defined, then the first one + * whose `urlPattern` matches will be the one that responds. + * + * This value directly maps to the first parameter passed to + * {@link workbox-routing.registerRoute}. It's recommended to use a + * {@link workbox-core.RouteMatchCallback} function for greatest flexibility. + */ + urlPattern: RegExp | string | RouteMatchCallback; +} +export interface ManifestTransformResult { + manifest: Array; + warnings?: Array; +} +export type ManifestTransform = (manifestEntries: Array, compilation?: unknown) => Promise | ManifestTransformResult; +export interface BasePartial { + /** + * A list of entries to be precached, in addition to any entries that are + * generated as part of the build configuration. + */ + additionalManifestEntries?: Array; + /** + * Assets that match this will be assumed to be uniquely versioned via their + * URL, and exempted from the normal HTTP cache-busting that's done when + * populating the precache. While not required, it's recommended that if your + * existing build process already inserts a `[hash]` value into each filename, + * you provide a RegExp that will detect that, as it will reduce the bandwidth + * consumed when precaching. + */ + dontCacheBustURLsMatching?: RegExp; + /** + * One or more functions which will be applied sequentially against the + * generated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are + * also specified, their corresponding transformations will be applied first. + */ + manifestTransforms?: Array; + /** + * This value can be used to determine the maximum size of files that will be + * precached. This prevents you from inadvertently precaching very large files + * that might have accidentally matched one of your patterns. + * @default 2097152 + */ + maximumFileSizeToCacheInBytes?: number; + /** + * An object mapping string prefixes to replacement string values. This can be + * used to, e.g., remove or add a path prefix from a manifest entry if your + * web hosting setup doesn't match your local filesystem setup. As an + * alternative with more flexibility, you can use the `manifestTransforms` + * option and provide a function that modifies the entries in the manifest + * using whatever logic you provide. + * + * Example usage: + * + * ``` + * // Replace a '/dist/' prefix with '/', and also prepend + * // '/static' to every URL. + * modifyURLPrefix: { + * '/dist/': '/', + * '': '/static', + * } + * ``` + */ + modifyURLPrefix?: { + [key: string]: string; + }; +} +export interface GeneratePartial { + /** + * The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass + * to `babel-preset-env` when transpiling the service worker bundle. + * @default ["chrome >= 56"] + */ + babelPresetEnvTargets?: Array; + /** + * An optional ID to be prepended to cache names. This is primarily useful for + * local development where multiple sites may be served from the same + * `http://localhost:port` origin. + */ + cacheId?: string | null; + /** + * Whether or not Workbox should attempt to identify and delete any precaches + * created by older, incompatible versions. + * @default false + */ + cleanupOutdatedCaches?: boolean; + /** + * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim) + * any existing clients as soon as it activates. + * @default false + */ + clientsClaim?: boolean; + /** + * If a navigation request for a URL ending in `/` fails to match a precached + * URL, this value will be appended to the URL and that will be checked for a + * precache match. This should be set to what your web server is using for its + * directory index. + */ + directoryIndex?: string | null; + /** + * @default false + */ + disableDevLogs?: boolean; + /** + * Any search parameter names that match against one of the RegExp in this + * array will be removed before looking for a precache match. This is useful + * if your users might request URLs that contain, for example, URL parameters + * used to track the source of the traffic. If not provided, the default value + * is `[/^utm_/, /^fbclid$/]`. + * + */ + ignoreURLParametersMatching?: Array; + /** + * A list of JavaScript files that should be passed to + * [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) + * inside the generated service worker file. This is useful when you want to + * let Workbox create your top-level service worker file, but want to include + * some additional code, such as a push event listener. + */ + importScripts?: Array; + /** + * Whether the runtime code for the Workbox library should be included in the + * top-level service worker, or split into a separate file that needs to be + * deployed alongside the service worker. Keeping the runtime separate means + * that users will not have to re-download the Workbox code each time your + * top-level service worker changes. + * @default false + */ + inlineWorkboxRuntime?: boolean; + /** + * If set to 'production', then an optimized service worker bundle that + * excludes debugging info will be produced. If not explicitly configured + * here, the `process.env.NODE_ENV` value will be used, and failing that, it + * will fall back to `'production'`. + * @default "production" + */ + mode?: string | null; + /** + * If specified, all + * [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) + * for URLs that aren't precached will be fulfilled with the HTML at the URL + * provided. You must pass in the URL of an HTML document that is listed in + * your precache manifest. This is meant to be used in a Single Page App + * scenario, in which you want all navigations to use common + * [App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell). + * @default null + */ + navigateFallback?: string | null; + /** + * An optional array of regular expressions that restricts which URLs the + * configured `navigateFallback` behavior applies to. This is useful if only a + * subset of your site's URLs should be treated as being part of a + * [Single Page App](https://en.wikipedia.org/wiki/Single-page_application). + * If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are + * configured, the denylist takes precedent. + * + * *Note*: These RegExps may be evaluated against every destination URL during + * a navigation. Avoid using + * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077), + * or else your users may see delays when navigating your site. + */ + navigateFallbackAllowlist?: Array; + /** + * An optional array of regular expressions that restricts which URLs the + * configured `navigateFallback` behavior applies to. This is useful if only a + * subset of your site's URLs should be treated as being part of a + * [Single Page App](https://en.wikipedia.org/wiki/Single-page_application). + * If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are + * configured, the denylist takes precedence. + * + * *Note*: These RegExps may be evaluated against every destination URL during + * a navigation. Avoid using + * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077), + * or else your users may see delays when navigating your site. + */ + navigateFallbackDenylist?: Array; + /** + * Whether or not to enable + * [navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload) + * in the generated service worker. When set to true, you must also use + * `runtimeCaching` to set up an appropriate response strategy that will match + * navigation requests, and make use of the preloaded response. + * @default false + */ + navigationPreload?: boolean; + /** + * Controls whether or not to include support for + * [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics). + * When `true`, the call to `workbox-google-analytics`'s `initialize()` will + * be added to your generated service worker. When set to an `Object`, that + * object will be passed in to the `initialize()` call, allowing you to + * customize the behavior. + * @default false + */ + offlineGoogleAnalytics?: boolean | GoogleAnalyticsInitializeOptions; + /** + * When using Workbox's build tools to generate your service worker, you can + * specify one or more runtime caching configurations. These are then + * translated to {@link workbox-routing.registerRoute} calls using the match + * and handler configuration you define. + * + * For all of the options, see the {@link workbox-build.RuntimeCaching} + * documentation. The example below shows a typical configuration, with two + * runtime routes defined: + * + * @example + * runtimeCaching: [{ + * urlPattern: ({url}) => url.origin === 'https://api.example.com', + * handler: 'NetworkFirst', + * options: { + * cacheName: 'api-cache', + * }, + * }, { + * urlPattern: ({request}) => request.destination === 'image', + * handler: 'StaleWhileRevalidate', + * options: { + * cacheName: 'images-cache', + * expiration: { + * maxEntries: 10, + * }, + * }, + * }] + */ + runtimeCaching?: Array; + /** + * Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase) + * to the generated service worker. If `false`, then a `message` listener will + * be added instead, allowing client pages to trigger `skipWaiting()` by + * calling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker. + * @default false + */ + skipWaiting?: boolean; + /** + * Whether to create a sourcemap for the generated service worker files. + * @default true + */ + sourcemap?: boolean; +} +export interface RequiredGlobDirectoryPartial { + /** + * The local directory you wish to match `globPatterns` against. The path is + * relative to the current directory. + */ + globDirectory: string; +} +export interface OptionalGlobDirectoryPartial { + /** + * The local directory you wish to match `globPatterns` against. The path is + * relative to the current directory. + */ + globDirectory?: string; +} +export interface GlobPartial { + /** + * Determines whether or not symlinks are followed when generating the + * precache manifest. For more information, see the definition of `follow` in + * the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * @default true + */ + globFollow?: boolean; + /** + * A set of patterns matching files to always exclude when generating the + * precache manifest. For more information, see the definition of `ignore` in + * the `glob` [documentation](https://github.com/isaacs/node-glob#options). + * @default ["**\/node_modules\/**\/*"] + */ + globIgnores?: Array; + /** + * Files matching any of these patterns will be included in the precache + * manifest. For more information, see the + * [`glob` primer](https://github.com/isaacs/node-glob#glob-primer). + * @default ["**\/*.{js,wasm,css,html}"] + */ + globPatterns?: Array; + /** + * If a URL is rendered based on some server-side logic, its contents may + * depend on multiple files or on some other unique string value. The keys in + * this object are server-rendered URLs. If the values are an array of + * strings, they will be interpreted as `glob` patterns, and the contents of + * any files matching the patterns will be used to uniquely version the URL. + * If used with a single string, it will be interpreted as unique versioning + * information that you've generated for a given URL. + */ + templatedURLs?: { + [key: string]: string | Array; + }; +} +export interface InjectPartial { + /** + * The string to find inside of the `swSrc` file. Once found, it will be + * replaced by the generated precache manifest. + * @default "self.__WB_MANIFEST" + */ + injectionPoint?: string; + /** + * The path and filename of the service worker file that will be read during + * the build process, relative to the current working directory. + */ + swSrc: string; +} +export interface WebpackPartial { + /** + * One or more chunk names whose corresponding output files should be included + * in the precache manifest. + */ + chunks?: Array; + /** + * One or more specifiers used to exclude assets from the precache manifest. + * This is interpreted following + * [the same rules](https://webpack.js.org/configuration/module/#condition) + * as `webpack`'s standard `exclude` option. + * If not provided, the default value is `[/\.map$/, /^manifest.*\.js$]`. + */ + exclude?: Array boolean)>; + /** + * One or more chunk names whose corresponding output files should be excluded + * from the precache manifest. + */ + excludeChunks?: Array; + /** + * One or more specifiers used to include assets in the precache manifest. + * This is interpreted following + * [the same rules](https://webpack.js.org/configuration/module/#condition) + * as `webpack`'s standard `include` option. + */ + include?: Array boolean)>; + /** + * If set to 'production', then an optimized service worker bundle that + * excludes debugging info will be produced. If not explicitly configured + * here, the `mode` value configured in the current `webpack` compilation + * will be used. + */ + mode?: string | null; +} +export interface RequiredSWDestPartial { + /** + * The path and filename of the service worker file that will be created by + * the build process, relative to the current working directory. It must end + * in '.js'. + */ + swDest: string; +} +export interface WebpackGenerateSWPartial { + /** + * One or more names of webpack chunks. The content of those chunks will be + * included in the generated service worker, via a call to `importScripts()`. + */ + importScriptsViaChunks?: Array; + /** + * The asset name of the service worker file created by this plugin. + * @default "service-worker.js" + */ + swDest?: string; +} +export interface WebpackInjectManifestPartial { + /** + * When `true` (the default), the `swSrc` file will be compiled by webpack. + * When `false`, compilation will not occur (and `webpackCompilationPlugins` + * can't be used.) Set to `false` if you want to inject the manifest into, + * e.g., a JSON file. + * @default true + */ + compileSrc?: boolean; + /** + * The asset name of the service worker file that will be created by this + * plugin. If omitted, the name will be based on the `swSrc` name. + */ + swDest?: string; + /** + * Optional `webpack` plugins that will be used when compiling the `swSrc` + * input file. Only valid if `compileSrc` is `true`. + */ + webpackCompilationPlugins?: Array; +} +export type GenerateSWOptions = BasePartial & GlobPartial & GeneratePartial & RequiredSWDestPartial & OptionalGlobDirectoryPartial; +export type GetManifestOptions = BasePartial & GlobPartial & RequiredGlobDirectoryPartial; +export type InjectManifestOptions = BasePartial & GlobPartial & InjectPartial & RequiredSWDestPartial & RequiredGlobDirectoryPartial; +export type WebpackGenerateSWOptions = BasePartial & WebpackPartial & GeneratePartial & WebpackGenerateSWPartial; +export type WebpackInjectManifestOptions = BasePartial & WebpackPartial & InjectPartial & WebpackInjectManifestPartial; +export interface GetManifestResult { + count: number; + manifestEntries: Array; + size: number; + warnings: Array; +} +export type BuildResult = Omit & { + filePaths: Array; +}; +/** + * @private + */ +export interface FileDetails { + file: string; + hash: string; + size: number; +} +/** + * @private + */ +export type BuildType = 'dev' | 'prod'; +/** + * @private + */ +export interface WorkboxPackageJSON extends PackageJson { + workbox?: { + browserNamespace?: string; + packageType?: string; + prodOnly?: boolean; + }; +} diff --git a/tools/ui/node_modules/workbox-build/build/types.js b/tools/ui/node_modules/workbox-build/build/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/workbox-build/node_modules/.bin/glob b/tools/ui/node_modules/workbox-build/node_modules/.bin/glob new file mode 100644 index 0000000000000000000000000000000000000000..d4511ae0c3c17c740a81ae4cac62327162bd67eb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/.bin/glob @@ -0,0 +1,346 @@ +#!/usr/bin/env node +import { foregroundChild } from 'foreground-child'; +import { existsSync } from 'fs'; +import { jack } from 'jackspeak'; +import { loadPackageJson } from 'package-json-from-dist'; +import { basename, join } from 'path'; +import { globStream } from './index.js'; +const { version } = loadPackageJson(import.meta.url, '../package.json'); +const j = jack({ + usage: 'glob [options] [ [ ...]]', +}) + .description(` + Glob v${version} + + Expand the positional glob expression arguments into any matching file + system paths found. + `) + .opt({ + cmd: { + short: 'c', + hint: 'command', + description: `Run the command provided, passing the glob expression + matches as arguments.`, + }, +}) + .opt({ + default: { + short: 'p', + hint: 'pattern', + description: `If no positional arguments are provided, glob will use + this pattern`, + }, +}) + .flag({ + shell: { + default: false, + description: `Interpret the command as a shell command by passing it + to the shell, with all matched filesystem paths appended, + **even if this cannot be done safely**. + + This is **not** unsafe (and usually unnecessary) when using + the known Unix shells sh, bash, zsh, and fish, as these can + all be executed in such a way as to pass positional + arguments safely. + + **Note**: THIS IS UNSAFE IF THE FILE PATHS ARE UNTRUSTED, + because a path like \`'some/path/\\$\\(cmd)'\` will be + executed by the shell. + + If you do have positional arguments that you wish to pass to + the command ahead of the glob pattern matches, use the + \`--cmd-arg\`/\`-g\` option instead. + + The next major release of glob will fully remove the ability + to use this option unsafely.`, + }, +}) + .optList({ + 'cmd-arg': { + short: 'g', + hint: 'arg', + default: [], + description: `Pass the provided values to the supplied command, ahead of + the glob matches. + + For example, the command: + + glob -c echo -g"hello" -g"world" *.txt + + might output: + + hello world a.txt b.txt + + This is a safer (and future-proof) alternative than putting + positional arguments in the \`-c\`/\`--cmd\` option.`, + }, +}) + .flag({ + all: { + short: 'A', + description: `By default, the glob cli command will not expand any + arguments that are an exact match to a file on disk. + + This prevents double-expanding, in case the shell expands + an argument whose filename is a glob expression. + + For example, if 'app/*.ts' would match 'app/[id].ts', then + on Windows powershell or cmd.exe, 'glob app/*.ts' will + expand to 'app/[id].ts', as expected. However, in posix + shells such as bash or zsh, the shell will first expand + 'app/*.ts' to a list of filenames. Then glob will look + for a file matching 'app/[id].ts' (ie, 'app/i.ts' or + 'app/d.ts'), which is unexpected. + + Setting '--all' prevents this behavior, causing glob + to treat ALL patterns as glob expressions to be expanded, + even if they are an exact match to a file on disk. + + When setting this option, be sure to enquote arguments + so that the shell will not expand them prior to passing + them to the glob command process. + `, + }, + absolute: { + short: 'a', + description: 'Expand to absolute paths', + }, + 'dot-relative': { + short: 'd', + description: `Prepend './' on relative matches`, + }, + mark: { + short: 'm', + description: `Append a / on any directories matched`, + }, + posix: { + short: 'x', + description: `Always resolve to posix style paths, using '/' as the + directory separator, even on Windows. Drive letter + absolute matches on Windows will be expanded to their + full resolved UNC paths, eg instead of 'C:\\foo\\bar', + it will expand to '//?/C:/foo/bar'. + `, + }, + follow: { + short: 'f', + description: `Follow symlinked directories when expanding '**'`, + }, + realpath: { + short: 'R', + description: `Call 'fs.realpath' on all of the results. In the case + of an entry that cannot be resolved, the entry is + omitted. This incurs a slight performance penalty, of + course, because of the added system calls.`, + }, + stat: { + short: 's', + description: `Call 'fs.lstat' on all entries, whether required or not + to determine if it's a valid match.`, + }, + 'match-base': { + short: 'b', + description: `Perform a basename-only match if the pattern does not + contain any slash characters. That is, '*.js' would be + treated as equivalent to '**/*.js', matching js files + in all directories. + `, + }, + dot: { + description: `Allow patterns to match files/directories that start + with '.', even if the pattern does not start with '.' + `, + }, + nobrace: { + description: 'Do not expand {...} patterns', + }, + nocase: { + description: `Perform a case-insensitive match. This defaults to + 'true' on macOS and Windows platforms, and false on + all others. + + Note: 'nocase' should only be explicitly set when it is + known that the filesystem's case sensitivity differs + from the platform default. If set 'true' on + case-insensitive file systems, then the walk may return + more or less results than expected. + `, + }, + nodir: { + description: `Do not match directories, only files. + + Note: to *only* match directories, append a '/' at the + end of the pattern. + `, + }, + noext: { + description: `Do not expand extglob patterns, such as '+(a|b)'`, + }, + noglobstar: { + description: `Do not expand '**' against multiple path portions. + Ie, treat it as a normal '*' instead.`, + }, + 'windows-path-no-escape': { + description: `Use '\\' as a path separator *only*, and *never* as an + escape character. If set, all '\\' characters are + replaced with '/' in the pattern.`, + }, +}) + .num({ + 'max-depth': { + short: 'D', + description: `Maximum depth to traverse from the current + working directory`, + }, +}) + .opt({ + cwd: { + short: 'C', + description: 'Current working directory to execute/match in', + default: process.cwd(), + }, + root: { + short: 'r', + description: `A string path resolved against the 'cwd', which is + used as the starting point for absolute patterns that + start with '/' (but not drive letters or UNC paths + on Windows). + + Note that this *doesn't* necessarily limit the walk to + the 'root' directory, and doesn't affect the cwd + starting point for non-absolute patterns. A pattern + containing '..' will still be able to traverse out of + the root directory, if it is not an actual root directory + on the filesystem, and any non-absolute patterns will + still be matched in the 'cwd'. + + To start absolute and non-absolute patterns in the same + path, you can use '--root=' to set it to the empty + string. However, be aware that on Windows systems, a + pattern like 'x:/*' or '//host/share/*' will *always* + start in the 'x:/' or '//host/share/' directory, + regardless of the --root setting. + `, + }, + platform: { + description: `Defaults to the value of 'process.platform' if + available, or 'linux' if not. Setting --platform=win32 + on non-Windows systems may cause strange behavior!`, + validOptions: [ + 'aix', + 'android', + 'darwin', + 'freebsd', + 'haiku', + 'linux', + 'openbsd', + 'sunos', + 'win32', + 'cygwin', + 'netbsd', + ], + }, +}) + .optList({ + ignore: { + short: 'i', + description: `Glob patterns to ignore`, + }, +}) + .flag({ + debug: { + short: 'v', + description: `Output a huge amount of noisy debug information about + patterns as they are parsed and used to match files.`, + }, + version: { + short: 'V', + description: `Output the version (${version})`, + }, + help: { + short: 'h', + description: 'Show this usage information', + }, +}); +try { + const { positionals, values } = j.parse(); + const { cmd, shell, all, default: def, version: showVersion, help, absolute, cwd, dot, 'dot-relative': dotRelative, follow, ignore, 'match-base': matchBase, 'max-depth': maxDepth, mark, nobrace, nocase, nodir, noext, noglobstar, platform, realpath, root, stat, debug, posix, 'cmd-arg': cmdArg, } = values; + if (showVersion) { + console.log(version); + process.exit(0); + } + if (help) { + console.log(j.usage()); + process.exit(0); + } + //const { shell, help } = values + if (positionals.length === 0 && !def) + throw 'No patterns provided'; + if (positionals.length === 0 && def) + positionals.push(def); + const patterns = all ? positionals : positionals.filter(p => !existsSync(p)); + const matches = all ? [] : positionals.filter(p => existsSync(p)).map(p => join(p)); + const stream = globStream(patterns, { + absolute, + cwd, + dot, + dotRelative, + follow, + ignore, + mark, + matchBase, + maxDepth, + nobrace, + nocase, + nodir, + noext, + noglobstar, + platform: platform, + realpath, + root, + stat, + debug, + posix, + }); + if (!cmd) { + matches.forEach(m => console.log(m)); + stream.on('data', f => console.log(f)); + } + else { + cmdArg.push(...matches); + stream.on('data', f => cmdArg.push(f)); + // Attempt to support commands that contain spaces and otherwise require + // shell interpretation, but do NOT shell-interpret the arguments, to avoid + // injections via filenames. This affordance can only be done on known Unix + // shells, unfortunately. + // + // 'bash', ['-c', cmd + ' "$@"', 'bash', ...matches] + // 'zsh', ['-c', cmd + ' "$@"', 'zsh', ...matches] + // 'fish', ['-c', cmd + ' "$argv"', ...matches] + const { SHELL = 'unknown' } = process.env; + const shellBase = basename(SHELL); + const knownShells = ['sh', 'ksh', 'zsh', 'bash', 'fish']; + if ((shell || /[ "']/.test(cmd)) && + knownShells.includes(shellBase)) { + const cmdWithArgs = `${cmd} "\$${shellBase === 'fish' ? 'argv' : '@'}"`; + if (shellBase !== 'fish') { + cmdArg.unshift(SHELL); + } + cmdArg.unshift('-c', cmdWithArgs); + stream.on('end', () => foregroundChild(SHELL, cmdArg)); + } + else { + if (shell) { + process.emitWarning('The --shell option is unsafe, and will be removed. To pass ' + + 'positional arguments to the subprocess, use -g/--cmd-arg instead.', 'DeprecationWarning', 'GLOB_SHELL'); + } + stream.on('end', () => foregroundChild(cmd, cmdArg, { shell })); + } + } +} +catch (e) { + console.error(j.usage()); + console.error(e instanceof Error ? e.message : String(e)); + process.exit(1); +} +//# sourceMappingURL=bin.mjs.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2420762a0285598c938e7e1a2ec87b6de23731a7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/LICENSE.md @@ -0,0 +1,63 @@ +Several modules are vendored under `./src`, which are used and +distributed according to their respective licenses, each provided +in the same directory as the code. + +Everything else is released under the following license. + +---- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/README.md b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b9a45c52e29f541239a99a64bfcf9333b7292604 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/README.md @@ -0,0 +1,151 @@ +# @isaacs/cliui + +Fork of [cliui](http://npm.im/cliui). Fully CommonJS/ESM +hybridized, with all dependencies vendored and optimized for +minimal bundle size without sacrificing functionality. + +easily create complex multi-column command-line-interfaces. + +## Changes in v9 + +The default export is no longer exported. So, intead of `import +cliui from '@isaacs/cliui'`, you'll do `import { cliui } from +'@isaacs/cliui'`. This is done in order to minimize typescript +oddness between the CommonJS and ESM versions. + +A minified export is provided at `@isaacs/cliui/min`. If you are +concerned about bundle size, that's the thing to use. + +## Example + +```js +import { cliui } from '@isaacs/cliui' +// or: const { cliui } = require('cliui') +const ui = cliui() + +ui.div('Usage: $0 [command] [options]') + +ui.div({ + text: 'Options:', + padding: [2, 0, 1, 0], +}) + +ui.div( + { + text: '-f, --file', + width: 20, + padding: [0, 4, 0, 4], + }, + { + text: + 'the file to load.' + + chalk.green('(if this description is long it wraps).'), + width: 20, + }, + { + text: chalk.red('[required]'), + align: 'right', + }, +) + +console.log(ui.toString()) +``` + +## Deno/ESM Support + +Load the minified version from unpkg. + +```typescript +import { cliui } from 'https://unpkg.com/@isaacs/cliui/dist/esm/index.min.js' + +const ui = cliui({}) + +ui.div('Usage: $0 [command] [options]') + +ui.div({ + text: 'Options:', + padding: [2, 0, 1, 0], +}) + +ui.div({ + text: '-f, --file', + width: 20, + padding: [0, 4, 0, 4], +}) + +console.log(ui.toString()) +``` + + + +## Layout DSL + +cliui exposes a simple layout DSL: + +If you create a single `ui.div`, passing a string rather than an +object: + +- `\n`: characters will be interpreted as new rows. +- `\t`: characters will be interpreted as new columns. +- `\s`: characters will be interpreted as padding. + +**as an example...** + +```js +var ui = require('./')({ + width: 60, +}) + +ui.div( + 'Usage: node ./bin/foo.js\n' + + ' \t provide a regex\n' + + ' \t provide a glob\t [required]', +) + +console.log(ui.toString()) +``` + +**will output:** + +```shell +Usage: node ./bin/foo.js + provide a regex + provide a glob [required] +``` + +## Methods + +```js +cliui = require('@isaacs/cliui') +``` + +### cliui({width: integer}) + +Specify the maximum width of the UI being generated. +If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. + +### cliui({wrap: boolean}) + +Enable or disable the wrapping of text in a column. + +### cliui.div(column, column, column) + +Create a row with any number of columns, a column +can either be a string, or an object with the following +options: + +- **text:** some text to place in the column. +- **width:** the width of a column. +- **align:** alignment, `right` or `center`. +- **padding:** `[top, right, bottom, left]`. +- **border:** should a border be placed around the div? + +### cliui.span(column, column, column) + +Similar to `div`, except the next row will be appended without +a new line being created. + +### cliui.resetOutput() + +Resets the UI elements of the current cliui instance, maintaining the values +set for `width` and `wrap`. diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d345a07b3aeced8695bfb7fa6356d56459dddd68 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts @@ -0,0 +1,4 @@ +export declare const ansiRegex: ({ onlyFirst }?: { + onlyFirst?: boolean | undefined; +}) => RegExp; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3905c2f79ef5ca7043268c18aa8eca03f083a599 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ansi-regex/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI;;CAA0B,WAcnD,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js new file mode 100644 index 0000000000000000000000000000000000000000..95d50d4b9e0f438f796e159038f89771724012c6 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js @@ -0,0 +1,16 @@ +"use strict"; +// TODO! cut this down? do we need the onlyFirst option? +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ansiRegex = void 0; +const ansiRegex = ({ onlyFirst = false } = {}) => { + // Valid string terminator sequences are BEL, ESC\, and 0x9c + const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; + // OSC sequences only: ESC ] ... ST (non-greedy until the first ST) + const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; + // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte + const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]"; + const pattern = `${osc}|${csi}`; + return new RegExp(pattern, onlyFirst ? undefined : "g"); +}; +exports.ansiRegex = ansiRegex; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f3d2b4ff05ffe019009ef3773483a1a1c5034e8d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ansi-regex/index.ts"],"names":[],"mappings":";AAAA,wDAAwD;;;AAEjD,MAAM,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;IACtD,4DAA4D;IAC5D,MAAM,EAAE,GAAG,oCAAoC,CAAC;IAEhD,mEAAmE;IACnE,MAAM,GAAG,GAAG,0BAA0B,EAAE,GAAG,CAAC;IAE5C,sGAAsG;IACtG,MAAM,GAAG,GACP,oFAAoF,CAAC;IAEvF,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IAEhC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAC;AAdW,QAAA,SAAS,aAcpB","sourcesContent":["// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f1a9ecf48a4feb6122f431e9973a839fa0b4c4d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts @@ -0,0 +1,34 @@ +export declare const modifierNames: string[]; +export declare const foregroundColorNames: string[]; +export declare const backgroundColorNames: string[]; +export declare const colorNames: string[]; +export declare const codes: Map; +export declare const ansiStyles: { + [x: string]: unknown; + codes: Map; + modifier: { + [k: string]: { + open: string; + close: string; + }; + }; + color: { + close: string; + ansi: (code: number) => string; + ansi256: (code: number) => string; + ansi16m: (red: number, green: number, blue: number) => string; + }; + bgColor: { + close: string; + ansi: (code: number) => string; + ansi256: (code: number) => string; + ansi16m: (red: number, green: number, blue: number) => string; + }; + rgbToAnsi256(red: number, green: number, blue: number): number; + hexToRgb(hex: number): [number, number, number]; + hexToAnsi256(hex: number): number; + ansi256ToAnsi(code: number): number; + rgbToAnsi(red: number, green: number, blue: number): number; + hexToAnsi(hex: number): number; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..571d0527ba2c87d05f1eb62862dda3070d27cda2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ansi-styles/index.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,aAAa,UAA+B,CAAC;AAC1D,eAAO,MAAM,oBAAoB,UAA4B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,UAA8B,CAAC;AAChE,eAAO,MAAM,UAAU,UAAqD,CAAC;AAK7E,eAAO,MAAM,KAAK,qBAA4B,CAAC;AAe/C,eAAO,MAAM,UAAU;;;;;;;;;;;qBAQN,MAAM;wBACH,MAAM;uBACP,MAAM,SAAS,MAAM,QAAQ,MAAM;;;;qBAOrC,MAAM;wBACH,MAAM;uBACP,MAAM,SAAS,MAAM,QAAQ,MAAM;;sBAIlC,MAAM,SAAS,MAAM,QAAQ,MAAM;kBAiBvC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;sBAuB7B,MAAM;wBAGJ,MAAM;mBA2CX,MAAM,SAAS,MAAM,QAAQ,MAAM;mBAGnC,MAAM;CAGnB,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js new file mode 100644 index 0000000000000000000000000000000000000000..49625069de4ffe89ec765da9a695eff662ba7449 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js @@ -0,0 +1,170 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ansiStyles = exports.codes = exports.colorNames = exports.backgroundColorNames = exports.foregroundColorNames = exports.modifierNames = void 0; +const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + 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], + // Bright color + blackBright: [90, 39], + gray: [90, 39], // Alias of `blackBright` + grey: [90, 39], // Alias of `blackBright` + 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], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], // Alias of `bgBlackBright` + bgGrey: [100, 49], // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49], + }, +}; +exports.modifierNames = Object.keys(styles.modifier); +exports.foregroundColorNames = Object.keys(styles.color); +exports.backgroundColorNames = Object.keys(styles.bgColor); +exports.colorNames = [...exports.foregroundColorNames, ...exports.backgroundColorNames]; +class AnsiStyles { +} +exports.codes = new Map(); +const ingest = (set) => Object.fromEntries(Object.entries(set).map(([key, [open, close]]) => { + exports.codes.set(open, close); + return [ + key, + (AnsiStyles.prototype[key] = { + open: `\u001B[${open}m`, + close: `\u001B[${close}m`, + }), + ]; +})); +exports.ansiStyles = new (class extends AnsiStyles { + codes = exports.codes; + modifier = ingest(styles.modifier); + color = { + ...ingest(styles.color), + close: "\x1B[39m", + ansi: (code) => `\u001B[${code}m`, + ansi256: (code) => `\u001B[${38};5;${code}m`, + ansi16m: (red, green, blue) => `\u001B[${38};2;${red};${green};${blue}m`, + }; + bgColor = { + ...ingest(styles.bgColor), + close: "\u001B[49m", + ansi: (code) => `\u001B[${code + 10}m`, + ansi256: (code) => `\u001B[${48};5;${code}m`, + ansi16m: (red, green, blue) => `\u001B[${48};2;${red};${green};${blue}m`, + }; + rgbToAnsi256(red, green, blue) { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) + return 16; + if (red > 248) + return 231; + return Math.round(((red - 8) / 247) * 24) + 232; + } + return (16 + + 36 * Math.round((red / 255) * 5) + + 6 * Math.round((green / 255) * 5) + + Math.round((blue / 255) * 5)); + } + hexToRgb(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString] + .map((character) => character + character) + .join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + (integer >> 16) & 0xff, + (integer >> 8) & 0xff, + integer & 0xff, + ]; + } + hexToAnsi256(hex) { + return this.rgbToAnsi256(...this.hexToRgb(hex)); + } + ansi256ToAnsi(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } + else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + } + rgbToAnsi(red, green, blue) { + return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue)); + } + hexToAnsi(hex) { + return this.ansi256ToAnsi(this.hexToAnsi256(hex)); + } +})(); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..4b946da622037645f95fec157b1540ef7cdb9c09 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ansi-styles/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG;IACb,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,uDAAuD;QACvD,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACb,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACf,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;KACvB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACf,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACb,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACf,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAChB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACd,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACjB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACd,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAEf,eAAe;QACf,WAAW,EAAE,CAAC,EAAE,EAAE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AY;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,SAAS,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,EAAE,CAAC","sourcesContent":["const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e5cdfdc21be18f8b5764a907b86aa39512ea55b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts @@ -0,0 +1,6 @@ +export declare const eastAsianWidth: (character: string) => "F" | "H" | "W" | "Na" | "A" | "N"; +export declare const characterLength: (character: string) => 2 | 1; +export declare const stringToArray: (str: string) => RegExpMatchArray | []; +export declare const length: (str: string) => number; +export declare const slice: (text: string, start: number, end: number) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d1dbd81ade31f92dc2fea01893f558782e009c92 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eastasianwidth/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,uCAqQ/C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,UAOhD,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,0BAExC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,WAOjC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,WAyB7D,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fb06459d82ac9c8482ec3e23bf081df2fc5bc84a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js @@ -0,0 +1,307 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.slice = exports.length = exports.stringToArray = exports.characterLength = exports.eastAsianWidth = void 0; +const eastAsianWidth = (character) => { + var x = character.charCodeAt(0); + var y = character.length == 2 ? character.charCodeAt(1) : 0; + var codePoint = x; + if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) { + x &= 0x3ff; + y &= 0x3ff; + codePoint = (x << 10) | y; + codePoint += 0x10000; + } + if (0x3000 == codePoint || + (0xff01 <= codePoint && codePoint <= 0xff60) || + (0xffe0 <= codePoint && codePoint <= 0xffe6)) { + return "F"; + } + if (0x20a9 == codePoint || + (0xff61 <= codePoint && codePoint <= 0xffbe) || + (0xffc2 <= codePoint && codePoint <= 0xffc7) || + (0xffca <= codePoint && codePoint <= 0xffcf) || + (0xffd2 <= codePoint && codePoint <= 0xffd7) || + (0xffda <= codePoint && codePoint <= 0xffdc) || + (0xffe8 <= codePoint && codePoint <= 0xffee)) { + return "H"; + } + if ((0x1100 <= codePoint && codePoint <= 0x115f) || + (0x11a3 <= codePoint && codePoint <= 0x11a7) || + (0x11fa <= codePoint && codePoint <= 0x11ff) || + (0x2329 <= codePoint && codePoint <= 0x232a) || + (0x2e80 <= codePoint && codePoint <= 0x2e99) || + (0x2e9b <= codePoint && codePoint <= 0x2ef3) || + (0x2f00 <= codePoint && codePoint <= 0x2fd5) || + (0x2ff0 <= codePoint && codePoint <= 0x2ffb) || + (0x3001 <= codePoint && codePoint <= 0x303e) || + (0x3041 <= codePoint && codePoint <= 0x3096) || + (0x3099 <= codePoint && codePoint <= 0x30ff) || + (0x3105 <= codePoint && codePoint <= 0x312d) || + (0x3131 <= codePoint && codePoint <= 0x318e) || + (0x3190 <= codePoint && codePoint <= 0x31ba) || + (0x31c0 <= codePoint && codePoint <= 0x31e3) || + (0x31f0 <= codePoint && codePoint <= 0x321e) || + (0x3220 <= codePoint && codePoint <= 0x3247) || + (0x3250 <= codePoint && codePoint <= 0x32fe) || + (0x3300 <= codePoint && codePoint <= 0x4dbf) || + (0x4e00 <= codePoint && codePoint <= 0xa48c) || + (0xa490 <= codePoint && codePoint <= 0xa4c6) || + (0xa960 <= codePoint && codePoint <= 0xa97c) || + (0xac00 <= codePoint && codePoint <= 0xd7a3) || + (0xd7b0 <= codePoint && codePoint <= 0xd7c6) || + (0xd7cb <= codePoint && codePoint <= 0xd7fb) || + (0xf900 <= codePoint && codePoint <= 0xfaff) || + (0xfe10 <= codePoint && codePoint <= 0xfe19) || + (0xfe30 <= codePoint && codePoint <= 0xfe52) || + (0xfe54 <= codePoint && codePoint <= 0xfe66) || + (0xfe68 <= codePoint && codePoint <= 0xfe6b) || + (0x1b000 <= codePoint && codePoint <= 0x1b001) || + (0x1f200 <= codePoint && codePoint <= 0x1f202) || + (0x1f210 <= codePoint && codePoint <= 0x1f23a) || + (0x1f240 <= codePoint && codePoint <= 0x1f248) || + (0x1f250 <= codePoint && codePoint <= 0x1f251) || + (0x20000 <= codePoint && codePoint <= 0x2f73f) || + (0x2b740 <= codePoint && codePoint <= 0x2fffd) || + (0x30000 <= codePoint && codePoint <= 0x3fffd)) { + return "W"; + } + if ((0x0020 <= codePoint && codePoint <= 0x007e) || + (0x00a2 <= codePoint && codePoint <= 0x00a3) || + (0x00a5 <= codePoint && codePoint <= 0x00a6) || + 0x00ac == codePoint || + 0x00af == codePoint || + (0x27e6 <= codePoint && codePoint <= 0x27ed) || + (0x2985 <= codePoint && codePoint <= 0x2986)) { + return "Na"; + } + if (0x00a1 == codePoint || + 0x00a4 == codePoint || + (0x00a7 <= codePoint && codePoint <= 0x00a8) || + 0x00aa == codePoint || + (0x00ad <= codePoint && codePoint <= 0x00ae) || + (0x00b0 <= codePoint && codePoint <= 0x00b4) || + (0x00b6 <= codePoint && codePoint <= 0x00ba) || + (0x00bc <= codePoint && codePoint <= 0x00bf) || + 0x00c6 == codePoint || + 0x00d0 == codePoint || + (0x00d7 <= codePoint && codePoint <= 0x00d8) || + (0x00de <= codePoint && codePoint <= 0x00e1) || + 0x00e6 == codePoint || + (0x00e8 <= codePoint && codePoint <= 0x00ea) || + (0x00ec <= codePoint && codePoint <= 0x00ed) || + 0x00f0 == codePoint || + (0x00f2 <= codePoint && codePoint <= 0x00f3) || + (0x00f7 <= codePoint && codePoint <= 0x00fa) || + 0x00fc == codePoint || + 0x00fe == codePoint || + 0x0101 == codePoint || + 0x0111 == codePoint || + 0x0113 == codePoint || + 0x011b == codePoint || + (0x0126 <= codePoint && codePoint <= 0x0127) || + 0x012b == codePoint || + (0x0131 <= codePoint && codePoint <= 0x0133) || + 0x0138 == codePoint || + (0x013f <= codePoint && codePoint <= 0x0142) || + 0x0144 == codePoint || + (0x0148 <= codePoint && codePoint <= 0x014b) || + 0x014d == codePoint || + (0x0152 <= codePoint && codePoint <= 0x0153) || + (0x0166 <= codePoint && codePoint <= 0x0167) || + 0x016b == codePoint || + 0x01ce == codePoint || + 0x01d0 == codePoint || + 0x01d2 == codePoint || + 0x01d4 == codePoint || + 0x01d6 == codePoint || + 0x01d8 == codePoint || + 0x01da == codePoint || + 0x01dc == codePoint || + 0x0251 == codePoint || + 0x0261 == codePoint || + 0x02c4 == codePoint || + 0x02c7 == codePoint || + (0x02c9 <= codePoint && codePoint <= 0x02cb) || + 0x02cd == codePoint || + 0x02d0 == codePoint || + (0x02d8 <= codePoint && codePoint <= 0x02db) || + 0x02dd == codePoint || + 0x02df == codePoint || + (0x0300 <= codePoint && codePoint <= 0x036f) || + (0x0391 <= codePoint && codePoint <= 0x03a1) || + (0x03a3 <= codePoint && codePoint <= 0x03a9) || + (0x03b1 <= codePoint && codePoint <= 0x03c1) || + (0x03c3 <= codePoint && codePoint <= 0x03c9) || + 0x0401 == codePoint || + (0x0410 <= codePoint && codePoint <= 0x044f) || + 0x0451 == codePoint || + 0x2010 == codePoint || + (0x2013 <= codePoint && codePoint <= 0x2016) || + (0x2018 <= codePoint && codePoint <= 0x2019) || + (0x201c <= codePoint && codePoint <= 0x201d) || + (0x2020 <= codePoint && codePoint <= 0x2022) || + (0x2024 <= codePoint && codePoint <= 0x2027) || + 0x2030 == codePoint || + (0x2032 <= codePoint && codePoint <= 0x2033) || + 0x2035 == codePoint || + 0x203b == codePoint || + 0x203e == codePoint || + 0x2074 == codePoint || + 0x207f == codePoint || + (0x2081 <= codePoint && codePoint <= 0x2084) || + 0x20ac == codePoint || + 0x2103 == codePoint || + 0x2105 == codePoint || + 0x2109 == codePoint || + 0x2113 == codePoint || + 0x2116 == codePoint || + (0x2121 <= codePoint && codePoint <= 0x2122) || + 0x2126 == codePoint || + 0x212b == codePoint || + (0x2153 <= codePoint && codePoint <= 0x2154) || + (0x215b <= codePoint && codePoint <= 0x215e) || + (0x2160 <= codePoint && codePoint <= 0x216b) || + (0x2170 <= codePoint && codePoint <= 0x2179) || + 0x2189 == codePoint || + (0x2190 <= codePoint && codePoint <= 0x2199) || + (0x21b8 <= codePoint && codePoint <= 0x21b9) || + 0x21d2 == codePoint || + 0x21d4 == codePoint || + 0x21e7 == codePoint || + 0x2200 == codePoint || + (0x2202 <= codePoint && codePoint <= 0x2203) || + (0x2207 <= codePoint && codePoint <= 0x2208) || + 0x220b == codePoint || + 0x220f == codePoint || + 0x2211 == codePoint || + 0x2215 == codePoint || + 0x221a == codePoint || + (0x221d <= codePoint && codePoint <= 0x2220) || + 0x2223 == codePoint || + 0x2225 == codePoint || + (0x2227 <= codePoint && codePoint <= 0x222c) || + 0x222e == codePoint || + (0x2234 <= codePoint && codePoint <= 0x2237) || + (0x223c <= codePoint && codePoint <= 0x223d) || + 0x2248 == codePoint || + 0x224c == codePoint || + 0x2252 == codePoint || + (0x2260 <= codePoint && codePoint <= 0x2261) || + (0x2264 <= codePoint && codePoint <= 0x2267) || + (0x226a <= codePoint && codePoint <= 0x226b) || + (0x226e <= codePoint && codePoint <= 0x226f) || + (0x2282 <= codePoint && codePoint <= 0x2283) || + (0x2286 <= codePoint && codePoint <= 0x2287) || + 0x2295 == codePoint || + 0x2299 == codePoint || + 0x22a5 == codePoint || + 0x22bf == codePoint || + 0x2312 == codePoint || + (0x2460 <= codePoint && codePoint <= 0x24e9) || + (0x24eb <= codePoint && codePoint <= 0x254b) || + (0x2550 <= codePoint && codePoint <= 0x2573) || + (0x2580 <= codePoint && codePoint <= 0x258f) || + (0x2592 <= codePoint && codePoint <= 0x2595) || + (0x25a0 <= codePoint && codePoint <= 0x25a1) || + (0x25a3 <= codePoint && codePoint <= 0x25a9) || + (0x25b2 <= codePoint && codePoint <= 0x25b3) || + (0x25b6 <= codePoint && codePoint <= 0x25b7) || + (0x25bc <= codePoint && codePoint <= 0x25bd) || + (0x25c0 <= codePoint && codePoint <= 0x25c1) || + (0x25c6 <= codePoint && codePoint <= 0x25c8) || + 0x25cb == codePoint || + (0x25ce <= codePoint && codePoint <= 0x25d1) || + (0x25e2 <= codePoint && codePoint <= 0x25e5) || + 0x25ef == codePoint || + (0x2605 <= codePoint && codePoint <= 0x2606) || + 0x2609 == codePoint || + (0x260e <= codePoint && codePoint <= 0x260f) || + (0x2614 <= codePoint && codePoint <= 0x2615) || + 0x261c == codePoint || + 0x261e == codePoint || + 0x2640 == codePoint || + 0x2642 == codePoint || + (0x2660 <= codePoint && codePoint <= 0x2661) || + (0x2663 <= codePoint && codePoint <= 0x2665) || + (0x2667 <= codePoint && codePoint <= 0x266a) || + (0x266c <= codePoint && codePoint <= 0x266d) || + 0x266f == codePoint || + (0x269e <= codePoint && codePoint <= 0x269f) || + (0x26be <= codePoint && codePoint <= 0x26bf) || + (0x26c4 <= codePoint && codePoint <= 0x26cd) || + (0x26cf <= codePoint && codePoint <= 0x26e1) || + 0x26e3 == codePoint || + (0x26e8 <= codePoint && codePoint <= 0x26ff) || + 0x273d == codePoint || + 0x2757 == codePoint || + (0x2776 <= codePoint && codePoint <= 0x277f) || + (0x2b55 <= codePoint && codePoint <= 0x2b59) || + (0x3248 <= codePoint && codePoint <= 0x324f) || + (0xe000 <= codePoint && codePoint <= 0xf8ff) || + (0xfe00 <= codePoint && codePoint <= 0xfe0f) || + 0xfffd == codePoint || + (0x1f100 <= codePoint && codePoint <= 0x1f10a) || + (0x1f110 <= codePoint && codePoint <= 0x1f12d) || + (0x1f130 <= codePoint && codePoint <= 0x1f169) || + (0x1f170 <= codePoint && codePoint <= 0x1f19a) || + (0xe0100 <= codePoint && codePoint <= 0xe01ef) || + (0xf0000 <= codePoint && codePoint <= 0xffffd) || + (0x100000 <= codePoint && codePoint <= 0x10fffd)) { + return "A"; + } + return "N"; +}; +exports.eastAsianWidth = eastAsianWidth; +const characterLength = (character) => { + var code = (0, exports.eastAsianWidth)(character); + if (code == "F" || code == "W" || code == "A") { + return 2; + } + else { + return 1; + } +}; +exports.characterLength = characterLength; +// Split a string considering surrogate-pairs. +const stringToArray = (str) => { + return str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; +}; +exports.stringToArray = stringToArray; +const length = (str) => { + var characters = (0, exports.stringToArray)(str); + var len = 0; + for (const char of characters) { + len = len + (0, exports.characterLength)(char); + } + return len; +}; +exports.length = length; +const slice = (text, start, end) => { + const textLen = (0, exports.length)(text); + start = start ? start : 0; + end = end ? end : 1; + if (start < 0) { + start = textLen + start; + } + if (end < 0) { + end = textLen + end; + } + var result = ""; + var eawLen = 0; + var chars = (0, exports.stringToArray)(text); + for (const char of chars) { + var charLen = (0, exports.length)(char); + if (eawLen >= start - (charLen == 2 ? 1 : 0)) { + if (eawLen + charLen <= end) { + result += char; + } + else { + break; + } + } + eawLen += charLen; + } + return result; +}; +exports.slice = slice; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..35a5b28ecbe3dfa7bcf880d304817c2fee5fb2f3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eastasianwidth/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAE,EAAE;IAClD,IAAI,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,SAA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IAChE,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAC7B,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;IAC1B,CAAC;IACD,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACZ,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,KAAK,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,MAAM,IAAI,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,IAAI,MAAM,GAAG,OAAO,IAAI,GAAG,EAAE,CAAC;gBAC5B,MAAM,IAAI,IAAI,CAAC;YACjB,CAAC;iBAAM,CAAC;gBACN,MAAM;YACR,CAAC;QACH,CAAC;QACD,MAAM,IAAI,OAAO,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAzBW,QAAA,KAAK,SAyBhB","sourcesContent":["export const eastAsianWidth = (character: string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6479c1382aa174104a4e081387c23a1d10addeb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts @@ -0,0 +1,2 @@ +export declare const emojiRegex: () => RegExp; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..34d930acb50c942c1962698ca0f6a67c708ba485 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/emoji-regex/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,cAC2we,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js new file mode 100644 index 0000000000000000000000000000000000000000..43ae45ac5b63a70bc870b03311ef73c7026be42c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.emojiRegex = void 0; +// https://mths.be/emoji +const emojiRegex = () => /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD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uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +exports.emojiRegex = emojiRegex; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ac71792a9e538fe98b72ccf15f89927487a794ea --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/emoji-regex/index.ts"],"names":[],"mappings":";;;AAAA,wBAAwB;AACjB,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,gyeAAgye,CAAC;AADtxe,QAAA,UAAU,cAC4we","sourcesContent":["// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\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])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE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DB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27B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D\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44d8100b2a178c81062b164ba5ef5f60051c2967 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts @@ -0,0 +1,41 @@ +export type UIOptions = { + width: number; + wrap?: boolean; + rows?: string[]; +}; +export type Column = { + text: string; + width?: number; + align?: 'right' | 'left' | 'center'; + padding?: number[]; + border?: boolean; +}; +export type ColumnArray = Column[] & { + span?: boolean; +}; +export type Line = { + hidden?: boolean; + text: string; + span?: boolean; +}; +export declare class UI { + width: number; + wrap: boolean; + rows: ColumnArray[]; + constructor(opts: UIOptions); + span(...args: ColumnArray): void; + resetOutput(): void; + div(...args: (Column | string)[]): ColumnArray; + shouldApplyLayoutDSL(...args: (Column | string)[]): boolean; + applyLayoutDSL(str: string): ColumnArray; + colFromString(text: string): Column; + measurePadding(str: string): number[]; + toString(): string; + rowToString(row: ColumnArray, lines: Line[]): Line[]; + renderInline(source: string, previousLine: Line): string; + rasterize(row: ColumnArray): string[][]; + negatePadding(col: Column): number; + columnWidths(row: ColumnArray): number[]; +} +export declare const cliui: (opts?: Partial) => UI; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5b860cfd529b2fed77810c9858fe4f701af2bcc9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,EAAE,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,EAAE;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,WAAW,EAAE,CAAA;gBAEP,IAAI,EAAE,SAAS;IAQ3B,IAAI,CAAC,GAAG,IAAI,EAAE,WAAW;IAKzB,WAAW;IAIX,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,WAAW;IA2B9C,oBAAoB,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO;IAQ3D,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IA6CxC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAOnC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAUrC,QAAQ,IAAI,MAAM;IAelB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE;IAgE3C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI;IAgC/C,SAAS,CAAC,GAAG,EAAE,WAAW;IAqD1B,aAAa,CAAC,GAAG,EAAE,MAAM;IAezB,YAAY,CAAC,GAAG,EAAE,WAAW;CAqC9B;AA2CD,eAAO,MAAM,KAAK,GAAI,OAAM,OAAO,CAAC,SAAS,CAAM,OAM/C,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fb9afd7e4f1c159cd2919abd870e795376d21932 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js @@ -0,0 +1,322 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cliui = exports.UI = void 0; +const index_js_1 = require("./string-width/index.js"); +const index_js_2 = require("./strip-ansi/index.js"); +const index_js_3 = require("./wrap-ansi/index.js"); +const align = { + right: (str, width) => `${' '.repeat(Math.max(0, width - (0, index_js_1.stringWidth)(str)))}${str}`, + center: (str, width) => `${' '.repeat(Math.max(0, width - (0, index_js_1.stringWidth)(str)) >> 1)}${str}`, +}; +const top = 0; +const right = 1; +const bottom = 2; +const left = 3; +class UI { + width; + wrap; + rows; + constructor(opts) { + this.width = opts.width; + /* c8 ignore start */ + this.wrap = opts.wrap ?? true; + /* c8 ignore stop */ + this.rows = []; + } + span(...args) { + const cols = this.div(...args); + cols.span = true; + } + resetOutput() { + this.rows = []; + } + div(...args) { + if (args.length === 0) { + this.div(''); + } + if (this.wrap && + this.shouldApplyLayoutDSL(...args) && + typeof args[0] === 'string') { + return this.applyLayoutDSL(args[0]); + } + const cols = Object.assign(args.map(arg => { + if (typeof arg === 'string') { + return this.colFromString(arg); + } + return arg; + }), { span: false }); + this.rows.push(cols); + return cols; + } + shouldApplyLayoutDSL(...args) { + return (args.length === 1 && + typeof args[0] === 'string' && + /[\t\n]/.test(args[0])); + } + applyLayoutDSL(str) { + const rows = str.split('\n').map(row => row.split('\t')); + let leftColumnWidth = 0; + // simple heuristic for layout, make sure the + // second column lines up along the left-hand. + // don't allow the first column to take up more + // than 50% of the screen. + rows.forEach(columns => { + if (columns.length > 1 && + (0, index_js_1.stringWidth)(String(columns[0])) > leftColumnWidth) { + leftColumnWidth = Math.min(Math.floor(this.width * 0.5), (0, index_js_1.stringWidth)(String(columns[0]))); + } + }); + // generate a table: + // replacing ' ' with padding calculations. + // using the algorithmically generated width. + rows.forEach(columns => { + this.div(...columns.map((r, i) => { + return { + text: r.trim(), + padding: this.measurePadding(r), + width: i === 0 && columns.length > 1 ? leftColumnWidth : undefined, + }; + })); + }); + const row = this.rows[this.rows.length - 1]; + /* c8 ignore start */ + if (!row) { + throw new Error('no rows found'); + } + /* c8 ignore stop */ + return row; + } + colFromString(text) { + return { + text, + padding: this.measurePadding(text), + }; + } + measurePadding(str) { + // measure padding without ansi escape codes + const noAnsi = (0, index_js_2.stripAnsi)(str); + const [right = '', left = ''] = [ + noAnsi.match(/\s*$/)?.[0], + noAnsi.match(/^\s*/)?.[0], + ]; + return [0, right.length, 0, left.length]; + } + toString() { + const lines = []; + this.rows.forEach(row => { + this.rowToString(row, lines); + }); + // don't display any lines with the + // hidden flag set. + return lines + .filter(line => !line.hidden) + .map(line => line.text) + .join('\n'); + } + rowToString(row, lines) { + this.rasterize(row).forEach((rrow, r) => { + let str = ''; + rrow.forEach((col, c) => { + const column = row[c]; + const { width } = column; // the width with padding. + const wrapWidth = this.negatePadding(column); // the width without padding. + let ts = col; // temporary string used during alignment/padding. + if (wrapWidth > (0, index_js_1.stringWidth)(col)) { + ts += ' '.repeat(wrapWidth - (0, index_js_1.stringWidth)(col)); + } + // align the string within its column. + if (column.align && column.align !== 'left' && this.wrap) { + const fn = align[column.align]; + ts = fn(ts.trim(), wrapWidth); + if ((0, index_js_1.stringWidth)(ts) < wrapWidth) { + /* c8 ignore start */ + const w = width || 0; + /* c8 ignore stop */ + ts += ' '.repeat(w - (0, index_js_1.stringWidth)(ts) - 1); + } + } + // apply border and padding to string. + const padding = column.padding || [0, 0, 0, 0]; + if (padding[left]) { + str += ' '.repeat(padding[left]); + } + str += addBorder(column, ts, '| '); + str += ts; + str += addBorder(column, ts, ' |'); + if (padding[right]) { + str += ' '.repeat(padding[right]); + } + // if prior row is span, try to render the + // current row on the prior line. + if (r === 0 && lines.length > 0) { + const lastLine = lines[lines.length - 1]; + /* c8 ignore start */ + if (!lastLine) { + throw new Error('last line not found'); + } + /* c8 ignore stop */ + str = this.renderInline(str, lastLine); + } + }); + // remove trailing whitespace. + lines.push({ + text: str.replace(/ +$/, ''), + span: row.span, + }); + }); + return lines; + } + // if the full 'source' can render in + // the target line, do so. + renderInline(source, previousLine) { + const match = source.match(/^ */); + /* c8 ignore start */ + const leadingWhitespace = match ? match[0].length : 0; + /* c8 ignore stop */ + const target = previousLine.text; + const targetTextWidth = (0, index_js_1.stringWidth)(target.trimEnd()); + if (!previousLine.span) { + return source; + } + // if we're not applying wrapping logic, + // just always append to the span. + if (!this.wrap) { + previousLine.hidden = true; + return target + source; + } + if (leadingWhitespace < targetTextWidth) { + return source; + } + previousLine.hidden = true; + return (target.trimEnd() + + ' '.repeat(leadingWhitespace - targetTextWidth) + + source.trimStart()); + } + rasterize(row) { + const rrows = []; + const widths = this.columnWidths(row); + let wrapped; + // word wrap all columns, and create + // a data-structure that is easy to rasterize. + row.forEach((col, c) => { + // leave room for left and right padding. + col.width = widths[c]; + if (this.wrap) { + wrapped = (0, index_js_3.wrap)(col.text, this.negatePadding(col), { + hard: true, + }).split('\n'); + } + else { + wrapped = col.text.split('\n'); + } + if (col.border) { + wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.'); + wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'"); + } + // add top and bottom padding. + if (col.padding) { + wrapped.unshift(...new Array(col.padding[top] || 0).fill('')); + wrapped.push(...new Array(col.padding[bottom] || 0).fill('')); + } + wrapped.forEach((str, r) => { + if (!rrows[r]) { + rrows.push([]); + } + /* c8 ignore start */ + const rrow = rrows[r] ?? []; + /* c8 ignore stop */ + for (let i = 0; i < c; i++) { + if (rrow[i] === undefined) { + rrow.push(''); + } + } + rrow.push(str); + }); + }); + return rrows; + } + negatePadding(col) { + /* c8 ignore start */ + let wrapWidth = col.width || 0; + /* c8 ignore stop */ + if (col.padding) { + wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); + } + if (col.border) { + wrapWidth -= 4; + } + return wrapWidth; + } + columnWidths(row) { + if (!this.wrap) { + return row.map(col => { + return col.width || (0, index_js_1.stringWidth)(col.text); + }); + } + let unset = row.length; + let remainingWidth = this.width; + // column widths can be set in config. + const widths = row.map(col => { + if (col.width) { + unset--; + remainingWidth -= col.width; + return col.width; + } + return undefined; + }); + // any unset widths should be calculated. + /* c8 ignore start */ + const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; + /* c8 ignore stop */ + return widths.map((w, i) => { + if (w === undefined) { + /* c8 ignore start */ + const col = row[i] ?? { text: '', padding: [] }; + /* c8 ignore stop */ + return Math.max(unsetWidth, _minWidth(col)); + } + return w; + }); + } +} +exports.UI = UI; +const addBorder = (col, ts, style) => { + if (col.border) { + if (/[.']-+[.']/.test(ts)) { + return ''; + } + if (ts.trim().length !== 0) { + return style; + } + return ' '; + } + return ''; +}; +// calculates the minimum width of +// a column, based on padding preferences. +const _minWidth = (col) => { + const padding = col.padding || []; + const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); + if (col.border) { + return minWidth + 4; + } + return minWidth; +}; +const getWindowWidth = () => { + /* c8 ignore start */ + if (typeof process === 'object' && + process.stdout && + process.stdout.columns) { + return process.stdout.columns; + } + return 80; +}; +/* c8 ignore stop */ +const cliui = (opts = {}) => new UI({ + /* c8 ignore start */ + width: opts?.width || getWindowWidth(), + wrap: opts?.wrap, + /* c8 ignore stop */ +}); +exports.cliui = cliui; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..500af6f0b400c02c5b1e9cbe21998c4228b811a3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":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A;IACjE,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACf,OAAO,QAAQ,GAAG,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,GAAW,EAAE;IAClC,qBAAqB;IACrB,IACE,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,CAAC,MAAM;QACd,OAAO,CAAC,MAAM,CAAC,OAAO,EACtB,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;IAC/B,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AACD,oBAAoB;AAEb,MAAM,KAAK,GAAG,CAAC,OAA2B,EAAE,EAAE,EAAE,CACrD,IAAI,EAAE,CAAC;IACL,qBAAqB;IACrB,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,cAAc,EAAE;IACtC,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,oBAAoB;CACrB,CAAC,CAAA;AANS,QAAA,KAAK,SAMd","sourcesContent":["import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n /* c8 ignore start */\n width: opts?.width || getWindowWidth(),\n wrap: opts?.wrap,\n /* c8 ignore stop */\n })\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..18f0615c7c967311e1ac570f7b6f106a60ed744c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js @@ -0,0 +1,12 @@ +"use strict";var c=(F,u)=>()=>(u||F((u={exports:{}}).exports,u),u.exports);var L=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.ansiRegex=void 0;var V=({onlyFirst:F=!1}={})=>{let t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,F?void 0:"g")};g.ansiRegex=V});var p=c(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.stripAnsi=void 0;var Y=L(),K=(0,Y.ansiRegex)(),Z=F=>F.replace(K,"");l.stripAnsi=Z});var k=c(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.slice=x.length=x.stringToArray=x.characterLength=x.eastAsianWidth=void 0;var J=F=>{var u=F.charCodeAt(0),C=F.length==2?F.charCodeAt(1):0,D=u;return 55296<=u&&u<=56319&&56320<=C&&C<=57343&&(u&=1023,C&=1023,D=u<<10|C,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"};x.eastAsianWidth=J;var Q=F=>{var u=(0,x.eastAsianWidth)(F);return u=="F"||u=="W"||u=="A"?2:1};x.characterLength=Q;var X=F=>F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[];x.stringToArray=X;var DD=F=>{var u=(0,x.stringToArray)(F),C=0;for(let D of u)C=C+(0,x.characterLength)(D);return C};x.length=DD;var uD=(F,u,C)=>{let D=(0,x.length)(F);u=u||0,C=C||1,u<0&&(u=D+u),C<0&&(C=D+C);var t="",e=0,E=(0,x.stringToArray)(F);for(let r of E){var i=(0,x.length)(r);if(e>=u-(i==2?1:0))if(e+i<=C)t+=r;else break;e+=i}return t};x.slice=uD});var R=c(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.emojiRegex=void 0;var FD=()=>/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uD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45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;b.emojiRegex=FD});var v=c($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.stringWidth=ED;var CD=p(),eD=k(),tD=R();function ED(F,u={}){if(typeof F!="string"||F.length===0||(u={ambiguousIsNarrow:!0,...u},F=(0,CD.stripAnsi)(F),F.length===0))return 0;F=F.replace((0,tD.emojiRegex)()," ");let C=u.ambiguousIsNarrow?1:2,D=0;for(let t of F){let e=t.codePointAt(0);if(!e||e<=31||e>=127&&e<=159||e>=768&&e<=879)continue;switch((0,eD.eastAsianWidth)(t)){case"F":case"W":D+=2;break;case"A":D+=C;break;default:D+=1}}return D}});var O=c(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.ansiStyles=s.codes=s.colorNames=s.backgroundColorNames=s.foregroundColorNames=s.modifierNames=void 0;var A={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.modifierNames=Object.keys(A.modifier);s.foregroundColorNames=Object.keys(A.color);s.backgroundColorNames=Object.keys(A.bgColor);s.colorNames=[...s.foregroundColorNames,...s.backgroundColorNames];var m=class{};s.codes=new Map;var M=F=>Object.fromEntries(Object.entries(F).map(([u,[C,D]])=>(s.codes.set(C,D),[u,m.prototype[u]={open:`\x1B[${C}m`,close:`\x1B[${D}m`}])));s.ansiStyles=new class extends m{codes=s.codes;modifier=M(A.modifier);color={...M(A.color),close:"\x1B[39m",ansi:F=>`\x1B[${F}m`,ansi256:F=>`\x1B[38;5;${F}m`,ansi16m:(F,u,C)=>`\x1B[38;2;${F};${u};${C}m`};bgColor={...M(A.bgColor),close:"\x1B[49m",ansi:F=>`\x1B[${F+10}m`,ansi256:F=>`\x1B[48;5;${F}m`,ansi16m:(F,u,C)=>`\x1B[48;2;${F};${u};${C}m`};rgbToAnsi256(F,u,C){return F===u&&u===C?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(C/255*5)}hexToRgb(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[C]=u;C.length===3&&(C=[...C].map(t=>t+t).join(""));let D=Number.parseInt(C,16);return[D>>16&255,D>>8&255,D&255]}hexToAnsi256(F){return this.rgbToAnsi256(...this.hexToRgb(F))}ansi256ToAnsi(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,C,D;if(F>=232)u=((F-232)*10+8)/255,C=u,D=u;else{F-=16;let E=F%36;u=Math.floor(F/36)/5,C=Math.floor(E/6)/5,D=E%6/5}let t=Math.max(u,C,D)*2;if(t===0)return 30;let e=30+(Math.round(D)<<2|Math.round(C)<<1|Math.round(u));return t===2&&(e+=60),e}rgbToAnsi(F,u,C){return this.ansi256ToAnsi(this.rgbToAnsi256(F,u,C))}hexToAnsi(F){return this.ansi256ToAnsi(this.hexToAnsi256(F))}}});var H=c(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.wrap=void 0;var h=v(),iD=p(),rD=O(),w=new Set(["\x1B","\x9B"]),nD=39,T="\x07",G="[",xD="]",z="m",P=`${xD}8;;`,I=F=>`${w.values().next().value}${G}${F}${z}`,q=F=>`${w.values().next().value}${P}${F}${T}`,sD=F=>F.split(" ").map(u=>(0,h.stringWidth)(u)),N=(F,u,C)=>{let D=[...u],t=!1,e=!1,E=(0,h.stringWidth)((0,iD.stripAnsi)(String(F[F.length-1])));for(let[i,r]of D.entries()){let f=(0,h.stringWidth)(r);if(E+f<=C?F[F.length-1]+=r:(F.push(r),E=0),w.has(r)&&(t=!0,e=D.slice(i+1).join("").startsWith(P)),t){e?r===T&&(t=!1,e=!1):r===z&&(t=!1);continue}E+=f,E===C&&i0&&F.length>1&&(F[F.length-2]=String(F[F.length-1])+F.pop())},BD=F=>{let u=F.split(" "),C=u.length;for(;C>0&&!((0,h.stringWidth)(String(u[C-1]))>0);)C--;return C===u.length?F:u.slice(0,C).join(" ")+u.slice(C).join("")},aD=(F,u,C={})=>{if(C.trim!==!1&&F.trim()==="")return"";let D="",t,e,E=sD(F),i=[""];for(let[f,B]of F.split(" ").entries()){C.trim!==!1&&(i[i.length-1]=String(i[i.length-1]).trimStart());let n=(0,h.stringWidth)(String(i[i.length-1]));f!==0&&(n>=u&&(C.wordWrap===!1||C.trim===!1)&&(i.push(""),n=0),(n>0||C.trim===!1)&&(i[i.length-1]+=" ",n++));let a=Number(E[f]);if(C.hard&&a>u){let d=u-n,j=1+Math.floor((a-d-1)/u);Math.floor((a-1)/u)u&&n>0&&a>0){if(C.wordWrap===!1&&nu&&C.wordWrap===!1){N(i,B,u);continue}i[i.length-1]+=B}C.trim!==!1&&(i=i.map(f=>BD(f)));let r=[...i.join(` +`)];for(let[f,B]of r.entries()){if(D+=B,w.has(B)){let{groups:a}=new RegExp(`(?:\\${G}(?\\d+)m|\\${P}(?.*)${T})`).exec(r.slice(f).join(""))||{groups:{}};if(a.code!==void 0){let d=Number.parseFloat(a.code);t=d===nD?void 0:d}else a.uri!==void 0&&(e=a.uri.length===0?void 0:a.uri)}let n=rD.ansiStyles.codes.get(Number(t));r[f+1]===` +`?(e&&(D+=q("")),t&&n&&(D+=I(n))):B===` +`&&(t&&n&&(D+=I(t)),e&&(D+=q(e)))}return D},fD=(F,u,C)=>String(F).normalize().replace(/\r\n/g,` +`).split(` +`).map(D=>aD(D,u,C)).join(` +`);y.wrap=fD});Object.defineProperty(exports,"__esModule",{value:!0});exports.cliui=exports.UI=void 0;var o=v(),oD=p(),dD=H(),cD={right:(F,u)=>`${" ".repeat(Math.max(0,u-(0,o.stringWidth)(F)))}${F}`,center:(F,u)=>`${" ".repeat(Math.max(0,u-(0,o.stringWidth)(F))>>1)}${F}`},AD=0,W=1,hD=2,_=3,S=class{width;wrap;rows;constructor(u){this.width=u.width,this.wrap=u.wrap??!0,this.rows=[]}span(...u){let C=this.div(...u);C.span=!0}resetOutput(){this.rows=[]}div(...u){if(u.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...u)&&typeof u[0]=="string")return this.applyLayoutDSL(u[0]);let C=Object.assign(u.map(D=>typeof D=="string"?this.colFromString(D):D),{span:!1});return this.rows.push(C),C}shouldApplyLayoutDSL(...u){return u.length===1&&typeof u[0]=="string"&&/[\t\n]/.test(u[0])}applyLayoutDSL(u){let C=u.split(` +`).map(e=>e.split(" ")),D=0;C.forEach(e=>{e.length>1&&(0,o.stringWidth)(String(e[0]))>D&&(D=Math.min(Math.floor(this.width*.5),(0,o.stringWidth)(String(e[0]))))}),C.forEach(e=>{this.div(...e.map((E,i)=>({text:E.trim(),padding:this.measurePadding(E),width:i===0&&e.length>1?D:void 0})))});let t=this.rows[this.rows.length-1];if(!t)throw new Error("no rows found");return t}colFromString(u){return{text:u,padding:this.measurePadding(u)}}measurePadding(u){let C=(0,oD.stripAnsi)(u),[D="",t=""]=[C.match(/\s*$/)?.[0],C.match(/^\s*/)?.[0]];return[0,D.length,0,t.length]}toString(){let u=[];return this.rows.forEach(C=>{this.rowToString(C,u)}),u.filter(C=>!C.hidden).map(C=>C.text).join(` +`)}rowToString(u,C){return this.rasterize(u).forEach((D,t)=>{let e="";D.forEach((E,i)=>{let r=u[i],{width:f}=r,B=this.negatePadding(r),n=E;if(B>(0,o.stringWidth)(E)&&(n+=" ".repeat(B-(0,o.stringWidth)(E))),r.align&&r.align!=="left"&&this.wrap){let d=cD[r.align];if(n=d(n.trim(),B),(0,o.stringWidth)(n)0){let d=C[C.length-1];if(!d)throw new Error("last line not found");e=this.renderInline(e,d)}}),C.push({text:e.replace(/ +$/,""),span:u.span})}),C}renderInline(u,C){let D=u.match(/^ */),t=D?D[0].length:0,e=C.text,E=(0,o.stringWidth)(e.trimEnd());return C.span?this.wrap?t{e.width=D[E],this.wrap?t=(0,dD.wrap)(e.text,this.negatePadding(e),{hard:!0}).split(` +`):t=e.text.split(` +`),e.border&&(t.unshift("."+"-".repeat(this.negatePadding(e)+2)+"."),t.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")),e.padding&&(t.unshift(...new Array(e.padding[AD]||0).fill("")),t.push(...new Array(e.padding[hD]||0).fill(""))),t.forEach((i,r)=>{C[r]||C.push([]);let f=C[r]??[];for(let B=0;BE.width||(0,o.stringWidth)(E.text));let C=u.length,D=this.width,t=u.map(E=>{if(E.width)return C--,D-=E.width,E.width}),e=C?Math.floor(D/C):0;return t.map((E,i)=>{if(E===void 0){let r=u[i]??{text:"",padding:[]};return Math.max(e,gD(r))}return E})}};exports.UI=S;var U=(F,u,C)=>F.border?/[.']-+[.']/.test(u)?"":u.trim().length!==0?C:" ":"",gD=F=>{let u=F.padding||[],C=1+(u[_]||0)+(u[W]||0);return F.border?C+4:C},lD=()=>typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80,pD=(F={})=>new S({width:F?.width||lD(),wrap:F?.wrap});exports.cliui=pD; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c8d2eaa3ca75543f157cecc8ae143920cf50765c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/ansi-regex/index.ts", "../../src/strip-ansi/index.ts", "../../src/eastasianwidth/index.ts", "../../src/emoji-regex/index.ts", "../../src/string-width/index.ts", "../../src/ansi-styles/index.ts", "../../src/wrap-ansi/index.ts", "../../src/index.ts"], + "sourcesContent": ["// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n", "import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n", "export const eastAsianWidth = (character: string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n", "// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\u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\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763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uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\uDF93\\uDFA0-\\uDFC1\\uDFC5\\uDFC6\\uDFC8\\uDFC9\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC07\\uDC09-\\uDC14\\uDC16-\\uDC3A\\uDC3C-\\uDC3E\\uDC40\\uDC44\\uDC45\\uDC51-\\uDC65\\uDC6A\\uDC79-\\uDC7B\\uDC7D-\\uDC80\\uDC84\\uDC88-\\uDC8E\\uDC90\\uDC92-\\uDCA9\\uDCAB-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDDA4\\uDDFB-\\uDE2D\\uDE2F-\\uDE34\\uDE37-\\uDE44\\uDE48-\\uDE4A\\uDE80-\\uDEA2\\uDEA4-\\uDEB3\\uDEB7-\\uDEBF\\uDEC1-\\uDEC5\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD1D\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78\\uDD7A-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCB\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\u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uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n", "import { stripAnsi } from \"../strip-ansi/index.js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n", "const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n", "import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n", "import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n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AK,EAAI,EAGhE,OAAOH,EAAO,IAAI,CAACX,EAAG,IAAK,CACzB,GAAIA,IAAM,OAAW,CAEnB,IAAMN,EAAMT,EAAI,CAAC,GAAK,CAAE,KAAM,GAAI,QAAS,CAAA,CAAE,EAE7C,OAAO,KAAK,IAAI+B,EAAYC,GAAUvB,CAAG,CAAC,CAC5C,CAEA,OAAOM,CACT,CAAC,CACH,GA9UF,QAAA,GAAArB,EAiVA,IAAMuB,EAAY,CAACR,EAAaI,EAAYoB,IACtCxB,EAAI,OACF,aAAa,KAAKI,CAAE,EACf,GAGLA,EAAG,KAAI,EAAG,SAAW,EAChBoB,EAGF,KAGF,GAKHD,GAAavB,GAAe,CAChC,IAAMO,EAAUP,EAAI,SAAW,CAAA,EACzByB,EAAW,GAAKlB,EAAQvB,CAAI,GAAK,IAAMuB,EAAQzB,CAAK,GAAK,GAC/D,OAAIkB,EAAI,OACCyB,EAAW,EAGbA,CACT,EAEMC,GAAiB,IAGnB,OAAO,SAAY,UACnB,QAAQ,QACR,QAAQ,OAAO,QAER,QAAQ,OAAO,QAEjB,GAIIC,GAAQ,CAACzC,EAA2B,CAAA,IAC/C,IAAID,EAAG,CAEL,MAAOC,GAAM,OAASwC,GAAc,EACpC,KAAMxC,GAAM,KAEb,EANU,QAAA,MAAKyC", + "names": ["ansiRegex", "onlyFirst", "pattern", "exports", "index_js_1", "regex", "stripAnsi", "str", "exports", "eastAsianWidth", "character", "x", "y", "codePoint", "exports", "characterLength", "code", "stringToArray", "str", "length", "characters", "len", "char", "slice", "text", "start", "end", "textLen", "result", "eawLen", "chars", "charLen", "emojiRegex", "exports", "exports", "stringWidth", "index_js_1", "index_js_2", "index_js_3", "str", "options", "ambiguousCharacterWidth", "width", "character", "codePoint", "styles", "exports", "AnsiStyles", "ingest", "set", "key", "open", "close", "code", "red", "green", "blue", "hex", "matches", "colorString", "character", "integer", "remainder", "value", "result", "index_js_1", "index_js_2", "index_js_3", "ESCAPES", "END_CODE", "ANSI_ESCAPE_BELL", "ANSI_CSI", "ANSI_OSC", "ANSI_SGR_TERMINATOR", "ANSI_ESCAPE_LINK", "wrapAnsiCode", "code", "wrapAnsiHyperlink", "uri", "wordLengths", "str", "character", "wrapWord", "rows", "word", "columns", "characters", "isInsideEscape", "isInsideLinkEscape", "visible", "index", "characterLength", "stringVisibleTrimSpacesRight", "words", "last", "exec", "options", "returnValue", "escapeCode", "escapeUrl", "lengths", "rowLength", "len", "remainingColumns", "breaksStartingThisLine", "row", "pre", "groups", "wrap", "line", "exports", "index_js_1", "index_js_2", "index_js_3", "align", "str", "width", "top", "right", "bottom", "left", "UI", "opts", "args", "cols", "arg", "rows", "row", "leftColumnWidth", "columns", "r", "text", "noAnsi", "lines", "line", "rrow", "col", "c", "column", "wrapWidth", "ts", "fn", "w", "padding", "addBorder", "lastLine", "source", "previousLine", "match", "leadingWhitespace", "target", "targetTextWidth", "rrows", "widths", "wrapped", "i", "unset", "remainingWidth", "unsetWidth", "_minWidth", "style", "minWidth", "getWindowWidth", "cliui"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c45de2ba2586582683b3c2c706dc076a355a1acb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts @@ -0,0 +1,5 @@ +export type Options = { + ambiguousIsNarrow?: boolean; +}; +export declare function stringWidth(str: string, options?: Options): number; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8113358988a996bc7e4aa8e2d8b546b780349eb9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string-width/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAqD7D"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9ca8909caa49ac52c6fcb94a4539cc49e3c7544d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringWidth = stringWidth; +const index_js_1 = require("../strip-ansi/index.js"); +const index_js_2 = require("../eastasianwidth/index.js"); +const index_js_3 = require("../emoji-regex/index.js"); +function stringWidth(str, options = {}) { + if (typeof str !== "string" || str.length === 0) { + return 0; + } + options = { + ambiguousIsNarrow: true, + ...options, + }; + str = (0, index_js_1.stripAnsi)(str); + if (str.length === 0) { + return 0; + } + str = str.replace((0, index_js_3.emojiRegex)(), " "); + const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2; + let width = 0; + for (const character of str) { + const codePoint = character.codePointAt(0); + // Ignore control characters + if (!codePoint || + codePoint <= 0x1f || + (codePoint >= 0x7f && codePoint <= 0x9f)) { + continue; + } + // Ignore combining characters + if (codePoint >= 0x300 && codePoint <= 0x36f) { + continue; + } + const code = (0, index_js_2.eastAsianWidth)(character); + switch (code) { + case "F": + case "W": + width += 2; + break; + case "A": + width += ambiguousCharacterWidth; + break; + default: + width += 1; + } + } + return width; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..cde91191346ebad702108f80376e793f4b8158c0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/string-width/index.ts"],"names":[],"mappings":";;AAQA,kCAqDC;AA7DD,qDAAmD;AACnD,yDAA4D;AAC5D,sDAAqD;AAMrD,SAAgB,WAAW,CAAC,GAAW,EAAE,UAAmB,EAAE;IAC5D,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,GAAG;QACR,iBAAiB,EAAE,IAAI;QACvB,GAAG,OAAO;KACX,CAAC;IAEF,GAAG,GAAG,IAAA,oBAAS,EAAC,GAAG,CAAC,CAAC;IAErB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAA,qBAAU,GAAE,EAAE,IAAI,CAAC,CAAC;IAEtC,MAAM,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,SAAS,IAAI,GAAG,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAE3C,4BAA4B;QAC5B,IACE,CAAC,SAAS;YACV,SAAS,IAAI,IAAI;YACjB,CAAC,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,EACxC,CAAC;YACD,SAAS;QACX,CAAC;QAED,8BAA8B;QAC9B,IAAI,SAAS,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7C,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,IAAA,yBAAc,EAAC,SAAS,CAAC,CAAC;QACvC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,GAAG,CAAC;YACT,KAAK,GAAG;gBACN,KAAK,IAAI,CAAC,CAAC;gBACX,MAAM;YACR,KAAK,GAAG;gBACN,KAAK,IAAI,uBAAuB,CAAC;gBACjC,MAAM;YACR;gBACE,KAAK,IAAI,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { stripAnsi } from \"../strip-ansi/index.js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e0fab4337a4c5aa33b533d55cdccb610b99082a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts @@ -0,0 +1,2 @@ +export declare const stripAnsi: (str: string) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4c23c4ed234e1ae7705a70a264945b543e98f14f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strip-ansi/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,WAA2B,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d916fc61b74848b0fc77f8d46053e9886d9529ad --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripAnsi = void 0; +const index_js_1 = require("../ansi-regex/index.js"); +const regex = (0, index_js_1.ansiRegex)(); +const stripAnsi = (str) => str.replace(regex, ""); +exports.stripAnsi = stripAnsi; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f1768a16b88883faf4de65ba2251dfdba6b84bcd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/strip-ansi/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AACnD,MAAM,KAAK,GAAG,IAAA,oBAAS,GAAE,CAAC;AACnB,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAApD,QAAA,SAAS,aAA2C","sourcesContent":["import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1159d65e764df7d20e551a0ef7de683061167054 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts @@ -0,0 +1,7 @@ +export type Options = { + trim?: boolean; + wordWrap?: boolean; + hard?: boolean; +}; +export declare const wrap: (str: string, columns: number, options: Options) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..734772de62570dfc08a5a9b610a40d1524ee6d3b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrap-ansi/index.ts"],"names":[],"mappings":"AAuGA,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAuH7E,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,OAAO,WAMpD,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js new file mode 100644 index 0000000000000000000000000000000000000000..056ffcbfd51bb64a3e8e3c6d92bdff4804a49aa0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js @@ -0,0 +1,176 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wrap = void 0; +const index_js_1 = require("../string-width/index.js"); +const index_js_2 = require("../strip-ansi/index.js"); +const index_js_3 = require("../ansi-styles/index.js"); +const ESCAPES = new Set(["\u001B", "\u009B"]); +const END_CODE = 39; +const ANSI_ESCAPE_BELL = "\u0007"; +const ANSI_CSI = "["; +const ANSI_OSC = "]"; +const ANSI_SGR_TERMINATOR = "m"; +const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; +const wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; +const wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = (str) => str.split(" ").map((character) => (0, index_js_1.stringWidth)(character)); +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; + let isInsideEscape = false; + let isInsideLinkEscape = false; + let visible = (0, index_js_1.stringWidth)((0, index_js_2.stripAnsi)(String(rows[rows.length - 1]))); + for (const [index, character] of characters.entries()) { + const characterLength = (0, index_js_1.stringWidth)(character); + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } + else { + rows.push(character); + visible = 0; + } + if (ESCAPES.has(character)) { + isInsideEscape = true; + isInsideLinkEscape = characters + .slice(index + 1) + .join("") + .startsWith(ANSI_ESCAPE_LINK); + } + if (isInsideEscape) { + if (isInsideLinkEscape) { + if (character === ANSI_ESCAPE_BELL) { + isInsideEscape = false; + isInsideLinkEscape = false; + } + } + else if (character === ANSI_SGR_TERMINATOR) { + isInsideEscape = false; + } + continue; + } + visible += characterLength; + if (visible === columns && index < characters.length - 1) { + rows.push(""); + visible = 0; + } + } + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case + if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) { + rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop(); + } +}; +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = (str) => { + const words = str.split(" "); + let last = words.length; + while (last > 0) { + if ((0, index_js_1.stringWidth)(String(words[last - 1])) > 0) { + break; + } + last--; + } + if (last === words.length) { + return str; + } + return words.slice(0, last).join(" ") + words.slice(last).join(""); +}; +const exec = (str, columns, options = {}) => { + if (options.trim !== false && str.trim() === "") { + return ""; + } + let returnValue = ""; + let escapeCode; + let escapeUrl; + const lengths = wordLengths(str); + let rows = [""]; + for (const [index, word] of str.split(" ").entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart(); + } + let rowLength = (0, index_js_1.stringWidth)(String(rows[rows.length - 1])); + if (index !== 0) { + if (rowLength >= columns && + (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(""); + rowLength = 0; + } + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += " "; + rowLength++; + } + } + // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' + const len = Number(lengths[index]); + if (options.hard && len > columns) { + const remainingColumns = columns - rowLength; + const breaksStartingThisLine = 1 + Math.floor((len - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((len - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(""); + } + wrapWord(rows, word, columns); + continue; + } + if (rowLength + len > columns && rowLength > 0 && len > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + rows.push(""); + } + if (rowLength + len > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + rows[rows.length - 1] += word; + } + if (options.trim !== false) { + rows = rows.map((row) => stringVisibleTrimSpacesRight(row)); + } + const pre = [...rows.join("\n")]; + for (const [index, character] of pre.entries()) { + returnValue += character; + if (ESCAPES.has(character)) { + const { groups } = (new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} }); + if (groups.code !== undefined) { + const code = Number.parseFloat(groups.code); + escapeCode = code === END_CODE ? undefined : code; + } + else if (groups.uri !== undefined) { + escapeUrl = groups.uri.length === 0 ? undefined : groups.uri; + } + } + const code = index_js_3.ansiStyles.codes.get(Number(escapeCode)); + if (pre[index + 1] === "\n") { + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(""); + } + if (escapeCode && code) { + returnValue += wrapAnsiCode(code); + } + } + else if (character === "\n") { + if (escapeCode && code) { + returnValue += wrapAnsiCode(escapeCode); + } + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(escapeUrl); + } + } + } + return returnValue; +}; +// For each newline, invoke the method separately +const wrap = (str, columns, options) => String(str) + .normalize() + .replace(/\r\n/g, "\n") + .split("\n") + .map((line) => exec(line, columns, options)) + .join("\n"); +exports.wrap = wrap; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..cd5294f79dd7795b82d20aefa3a4c98c5bd52e3f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wrap-ansi/index.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,qDAAmD;AACnD,sDAAqD;AAErD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE9C,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAClC,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM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AC,UAAU,CAAC,CAAC;YAC1C,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,WAAW,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,iDAAiD;AAC1C,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,OAAgB,EAAE,EAAE,CACrE,MAAM,CAAC,GAAG,CAAC;KACR,SAAS,EAAE;KACX,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;KACtB,KAAK,CAAC,IAAI,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAC3C,IAAI,CAAC,IAAI,CAAC,CAAC;AANH,QAAA,IAAI,QAMD","sourcesContent":["import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d345a07b3aeced8695bfb7fa6356d56459dddd68 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts @@ -0,0 +1,4 @@ +export declare const ansiRegex: ({ onlyFirst }?: { + onlyFirst?: boolean | undefined; +}) => RegExp; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3905c2f79ef5ca7043268c18aa8eca03f083a599 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ansi-regex/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI;;CAA0B,WAcnD,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5e601c03f18b98748f57825e04a90d2a915516a1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js @@ -0,0 +1,12 @@ +// TODO! cut this down? do we need the onlyFirst option? +export const ansiRegex = ({ onlyFirst = false } = {}) => { + // Valid string terminator sequences are BEL, ESC\, and 0x9c + const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; + // OSC sequences only: ESC ] ... ST (non-greedy until the first ST) + const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; + // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte + const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]"; + const pattern = `${osc}|${csi}`; + return new RegExp(pattern, onlyFirst ? undefined : "g"); +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..513d429232a1190a60a7198829c3af0db46780b7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ansi-regex/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;IACtD,4DAA4D;IAC5D,MAAM,EAAE,GAAG,oCAAoC,CAAC;IAEhD,mEAAmE;IACnE,MAAM,GAAG,GAAG,0BAA0B,EAAE,GAAG,CAAC;IAE5C,sGAAsG;IACtG,MAAM,GAAG,GACP,oFAAoF,CAAC;IAEvF,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IAEhC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAC","sourcesContent":["// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f1a9ecf48a4feb6122f431e9973a839fa0b4c4d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts @@ -0,0 +1,34 @@ +export declare const modifierNames: string[]; +export declare const foregroundColorNames: string[]; +export declare const backgroundColorNames: string[]; +export declare const colorNames: string[]; +export declare const codes: Map; +export declare const ansiStyles: { + [x: string]: unknown; + codes: Map; + modifier: { + [k: string]: { + open: string; + close: string; + }; + }; + color: { + close: string; + ansi: (code: number) => string; + ansi256: (code: number) => string; + ansi16m: (red: number, green: number, blue: number) => string; + }; + bgColor: { + close: string; + ansi: (code: number) => string; + ansi256: (code: number) => string; + ansi16m: (red: number, green: number, blue: number) => string; + }; + rgbToAnsi256(red: number, green: number, blue: number): number; + hexToRgb(hex: number): [number, number, number]; + hexToAnsi256(hex: number): number; + ansi256ToAnsi(code: number): number; + rgbToAnsi(red: number, green: number, blue: number): number; + hexToAnsi(hex: number): number; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..571d0527ba2c87d05f1eb62862dda3070d27cda2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ansi-styles/index.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,aAAa,UAA+B,CAAC;AAC1D,eAAO,MAAM,oBAAoB,UAA4B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,UAA8B,CAAC;AAChE,eAAO,MAAM,UAAU,UAAqD,CAAC;AAK7E,eAAO,MAAM,KAAK,qBAA4B,CAAC;AAe/C,eAAO,MAAM,UAAU;;;;;;;;;;;qBAQN,MAAM;wBACH,MAAM;uBACP,MAAM,SAAS,MAAM,QAAQ,MAAM;;;;qBAOrC,MAAM;wBACH,MAAM;uBACP,MAAM,SAAS,MAAM,QAAQ,MAAM;;sBAIlC,MAAM,SAAS,MAAM,QAAQ,MAAM;kBAiBvC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;sBAuB7B,MAAM;wBAGJ,MAAM;mBA2CX,MAAM,SAAS,MAAM,QAAQ,MAAM;mBAGnC,MAAM;CAGnB,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4d2dd9b77084818d20c2eb6b8a087b0ca6876f5a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js @@ -0,0 +1,167 @@ +const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + 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], + // Bright color + blackBright: [90, 39], + gray: [90, 39], // Alias of `blackBright` + grey: [90, 39], // Alias of `blackBright` + 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], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], // Alias of `bgBlackBright` + bgGrey: [100, 49], // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49], + }, +}; +export const modifierNames = Object.keys(styles.modifier); +export const foregroundColorNames = Object.keys(styles.color); +export const backgroundColorNames = Object.keys(styles.bgColor); +export const colorNames = [...foregroundColorNames, ...backgroundColorNames]; +class AnsiStyles { +} +export const codes = new Map(); +const ingest = (set) => Object.fromEntries(Object.entries(set).map(([key, [open, close]]) => { + codes.set(open, close); + return [ + key, + (AnsiStyles.prototype[key] = { + open: `\u001B[${open}m`, + close: `\u001B[${close}m`, + }), + ]; +})); +export const ansiStyles = new (class extends AnsiStyles { + codes = codes; + modifier = ingest(styles.modifier); + color = { + ...ingest(styles.color), + close: "\x1B[39m", + ansi: (code) => `\u001B[${code}m`, + ansi256: (code) => `\u001B[${38};5;${code}m`, + ansi16m: (red, green, blue) => `\u001B[${38};2;${red};${green};${blue}m`, + }; + bgColor = { + ...ingest(styles.bgColor), + close: "\u001B[49m", + ansi: (code) => `\u001B[${code + 10}m`, + ansi256: (code) => `\u001B[${48};5;${code}m`, + ansi16m: (red, green, blue) => `\u001B[${48};2;${red};${green};${blue}m`, + }; + rgbToAnsi256(red, green, blue) { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) + return 16; + if (red > 248) + return 231; + return Math.round(((red - 8) / 247) * 24) + 232; + } + return (16 + + 36 * Math.round((red / 255) * 5) + + 6 * Math.round((green / 255) * 5) + + Math.round((blue / 255) * 5)); + } + hexToRgb(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString] + .map((character) => character + character) + .join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + (integer >> 16) & 0xff, + (integer >> 8) & 0xff, + integer & 0xff, + ]; + } + hexToAnsi256(hex) { + return this.rgbToAnsi256(...this.hexToRgb(hex)); + } + ansi256ToAnsi(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } + else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + } + rgbToAnsi(red, green, blue) { + return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue)); + } + hexToAnsi(hex) { + return this.ansi256ToAnsi(this.hexToAnsi256(hex)); + } +})(); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..40968777dae363718e210a10b23d402bea1efe93 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ansi-styles/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,uDAAuD;QACvD,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACb,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACf,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACf,aAAa,EAAE,CAAC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AK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAE7C,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,MAAM,GACR,EAAE;YACF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAEzE,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,MAAM,IAAI,EAAE,CAAC;QACf,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,SAAS,CAAC,GAAW,EAAE,KAAa,EAAE,IAAY;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,SAAS,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,EAAE,CAAC","sourcesContent":["const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e5cdfdc21be18f8b5764a907b86aa39512ea55b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts @@ -0,0 +1,6 @@ +export declare const eastAsianWidth: (character: string) => "F" | "H" | "W" | "Na" | "A" | "N"; +export declare const characterLength: (character: string) => 2 | 1; +export declare const stringToArray: (str: string) => RegExpMatchArray | []; +export declare const length: (str: string) => number; +export declare const slice: (text: string, start: number, end: number) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d1dbd81ade31f92dc2fea01893f558782e009c92 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eastasianwidth/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,uCAqQ/C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,UAOhD,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,0BAExC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,WAOjC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,WAyB7D,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6f43a17f73e7485504f3dd274cc078ab992b04d0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js @@ -0,0 +1,299 @@ +export const eastAsianWidth = (character) => { + var x = character.charCodeAt(0); + var y = character.length == 2 ? character.charCodeAt(1) : 0; + var codePoint = x; + if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) { + x &= 0x3ff; + y &= 0x3ff; + codePoint = (x << 10) | y; + codePoint += 0x10000; + } + if (0x3000 == codePoint || + (0xff01 <= codePoint && codePoint <= 0xff60) || + (0xffe0 <= codePoint && codePoint <= 0xffe6)) { + return "F"; + } + if (0x20a9 == codePoint || + (0xff61 <= codePoint && codePoint <= 0xffbe) || + (0xffc2 <= codePoint && codePoint <= 0xffc7) || + (0xffca <= codePoint && codePoint <= 0xffcf) || + (0xffd2 <= codePoint && codePoint <= 0xffd7) || + (0xffda <= codePoint && codePoint <= 0xffdc) || + (0xffe8 <= codePoint && codePoint <= 0xffee)) { + return "H"; + } + if ((0x1100 <= codePoint && codePoint <= 0x115f) || + (0x11a3 <= codePoint && codePoint <= 0x11a7) || + (0x11fa <= codePoint && codePoint <= 0x11ff) || + (0x2329 <= codePoint && codePoint <= 0x232a) || + (0x2e80 <= codePoint && codePoint <= 0x2e99) || + (0x2e9b <= codePoint && codePoint <= 0x2ef3) || + (0x2f00 <= codePoint && codePoint <= 0x2fd5) || + (0x2ff0 <= codePoint && codePoint <= 0x2ffb) || + (0x3001 <= codePoint && codePoint <= 0x303e) || + (0x3041 <= codePoint && codePoint <= 0x3096) || + (0x3099 <= codePoint && codePoint <= 0x30ff) || + (0x3105 <= codePoint && codePoint <= 0x312d) || + (0x3131 <= codePoint && codePoint <= 0x318e) || + (0x3190 <= codePoint && codePoint <= 0x31ba) || + (0x31c0 <= codePoint && codePoint <= 0x31e3) || + (0x31f0 <= codePoint && codePoint <= 0x321e) || + (0x3220 <= codePoint && codePoint <= 0x3247) || + (0x3250 <= codePoint && codePoint <= 0x32fe) || + (0x3300 <= codePoint && codePoint <= 0x4dbf) || + (0x4e00 <= codePoint && codePoint <= 0xa48c) || + (0xa490 <= codePoint && codePoint <= 0xa4c6) || + (0xa960 <= codePoint && codePoint <= 0xa97c) || + (0xac00 <= codePoint && codePoint <= 0xd7a3) || + (0xd7b0 <= codePoint && codePoint <= 0xd7c6) || + (0xd7cb <= codePoint && codePoint <= 0xd7fb) || + (0xf900 <= codePoint && codePoint <= 0xfaff) || + (0xfe10 <= codePoint && codePoint <= 0xfe19) || + (0xfe30 <= codePoint && codePoint <= 0xfe52) || + (0xfe54 <= codePoint && codePoint <= 0xfe66) || + (0xfe68 <= codePoint && codePoint <= 0xfe6b) || + (0x1b000 <= codePoint && codePoint <= 0x1b001) || + (0x1f200 <= codePoint && codePoint <= 0x1f202) || + (0x1f210 <= codePoint && codePoint <= 0x1f23a) || + (0x1f240 <= codePoint && codePoint <= 0x1f248) || + (0x1f250 <= codePoint && codePoint <= 0x1f251) || + (0x20000 <= codePoint && codePoint <= 0x2f73f) || + (0x2b740 <= codePoint && codePoint <= 0x2fffd) || + (0x30000 <= codePoint && codePoint <= 0x3fffd)) { + return "W"; + } + if ((0x0020 <= codePoint && codePoint <= 0x007e) || + (0x00a2 <= codePoint && codePoint <= 0x00a3) || + (0x00a5 <= codePoint && codePoint <= 0x00a6) || + 0x00ac == codePoint || + 0x00af == codePoint || + (0x27e6 <= codePoint && codePoint <= 0x27ed) || + (0x2985 <= codePoint && codePoint <= 0x2986)) { + return "Na"; + } + if (0x00a1 == codePoint || + 0x00a4 == codePoint || + (0x00a7 <= codePoint && codePoint <= 0x00a8) || + 0x00aa == codePoint || + (0x00ad <= codePoint && codePoint <= 0x00ae) || + (0x00b0 <= codePoint && codePoint <= 0x00b4) || + (0x00b6 <= codePoint && codePoint <= 0x00ba) || + (0x00bc <= codePoint && codePoint <= 0x00bf) || + 0x00c6 == codePoint || + 0x00d0 == codePoint || + (0x00d7 <= codePoint && codePoint <= 0x00d8) || + (0x00de <= codePoint && codePoint <= 0x00e1) || + 0x00e6 == codePoint || + (0x00e8 <= codePoint && codePoint <= 0x00ea) || + (0x00ec <= codePoint && codePoint <= 0x00ed) || + 0x00f0 == codePoint || + (0x00f2 <= codePoint && codePoint <= 0x00f3) || + (0x00f7 <= codePoint && codePoint <= 0x00fa) || + 0x00fc == codePoint || + 0x00fe == codePoint || + 0x0101 == codePoint || + 0x0111 == codePoint || + 0x0113 == codePoint || + 0x011b == codePoint || + (0x0126 <= codePoint && codePoint <= 0x0127) || + 0x012b == codePoint || + (0x0131 <= codePoint && codePoint <= 0x0133) || + 0x0138 == codePoint || + (0x013f <= codePoint && codePoint <= 0x0142) || + 0x0144 == codePoint || + (0x0148 <= codePoint && codePoint <= 0x014b) || + 0x014d == codePoint || + (0x0152 <= codePoint && codePoint <= 0x0153) || + (0x0166 <= codePoint && codePoint <= 0x0167) || + 0x016b == codePoint || + 0x01ce == codePoint || + 0x01d0 == codePoint || + 0x01d2 == codePoint || + 0x01d4 == codePoint || + 0x01d6 == codePoint || + 0x01d8 == codePoint || + 0x01da == codePoint || + 0x01dc == codePoint || + 0x0251 == codePoint || + 0x0261 == codePoint || + 0x02c4 == codePoint || + 0x02c7 == codePoint || + (0x02c9 <= codePoint && codePoint <= 0x02cb) || + 0x02cd == codePoint || + 0x02d0 == codePoint || + (0x02d8 <= codePoint && codePoint <= 0x02db) || + 0x02dd == codePoint || + 0x02df == codePoint || + (0x0300 <= codePoint && codePoint <= 0x036f) || + (0x0391 <= codePoint && codePoint <= 0x03a1) || + (0x03a3 <= codePoint && codePoint <= 0x03a9) || + (0x03b1 <= codePoint && codePoint <= 0x03c1) || + (0x03c3 <= codePoint && codePoint <= 0x03c9) || + 0x0401 == codePoint || + (0x0410 <= codePoint && codePoint <= 0x044f) || + 0x0451 == codePoint || + 0x2010 == codePoint || + (0x2013 <= codePoint && codePoint <= 0x2016) || + (0x2018 <= codePoint && codePoint <= 0x2019) || + (0x201c <= codePoint && codePoint <= 0x201d) || + (0x2020 <= codePoint && codePoint <= 0x2022) || + (0x2024 <= codePoint && codePoint <= 0x2027) || + 0x2030 == codePoint || + (0x2032 <= codePoint && codePoint <= 0x2033) || + 0x2035 == codePoint || + 0x203b == codePoint || + 0x203e == codePoint || + 0x2074 == codePoint || + 0x207f == codePoint || + (0x2081 <= codePoint && codePoint <= 0x2084) || + 0x20ac == codePoint || + 0x2103 == codePoint || + 0x2105 == codePoint || + 0x2109 == codePoint || + 0x2113 == codePoint || + 0x2116 == codePoint || + (0x2121 <= codePoint && codePoint <= 0x2122) || + 0x2126 == codePoint || + 0x212b == codePoint || + (0x2153 <= codePoint && codePoint <= 0x2154) || + (0x215b <= codePoint && codePoint <= 0x215e) || + (0x2160 <= codePoint && codePoint <= 0x216b) || + (0x2170 <= codePoint && codePoint <= 0x2179) || + 0x2189 == codePoint || + (0x2190 <= codePoint && codePoint <= 0x2199) || + (0x21b8 <= codePoint && codePoint <= 0x21b9) || + 0x21d2 == codePoint || + 0x21d4 == codePoint || + 0x21e7 == codePoint || + 0x2200 == codePoint || + (0x2202 <= codePoint && codePoint <= 0x2203) || + (0x2207 <= codePoint && codePoint <= 0x2208) || + 0x220b == codePoint || + 0x220f == codePoint || + 0x2211 == codePoint || + 0x2215 == codePoint || + 0x221a == codePoint || + (0x221d <= codePoint && codePoint <= 0x2220) || + 0x2223 == codePoint || + 0x2225 == codePoint || + (0x2227 <= codePoint && codePoint <= 0x222c) || + 0x222e == codePoint || + (0x2234 <= codePoint && codePoint <= 0x2237) || + (0x223c <= codePoint && codePoint <= 0x223d) || + 0x2248 == codePoint || + 0x224c == codePoint || + 0x2252 == codePoint || + (0x2260 <= codePoint && codePoint <= 0x2261) || + (0x2264 <= codePoint && codePoint <= 0x2267) || + (0x226a <= codePoint && codePoint <= 0x226b) || + (0x226e <= codePoint && codePoint <= 0x226f) || + (0x2282 <= codePoint && codePoint <= 0x2283) || + (0x2286 <= codePoint && codePoint <= 0x2287) || + 0x2295 == codePoint || + 0x2299 == codePoint || + 0x22a5 == codePoint || + 0x22bf == codePoint || + 0x2312 == codePoint || + (0x2460 <= codePoint && codePoint <= 0x24e9) || + (0x24eb <= codePoint && codePoint <= 0x254b) || + (0x2550 <= codePoint && codePoint <= 0x2573) || + (0x2580 <= codePoint && codePoint <= 0x258f) || + (0x2592 <= codePoint && codePoint <= 0x2595) || + (0x25a0 <= codePoint && codePoint <= 0x25a1) || + (0x25a3 <= codePoint && codePoint <= 0x25a9) || + (0x25b2 <= codePoint && codePoint <= 0x25b3) || + (0x25b6 <= codePoint && codePoint <= 0x25b7) || + (0x25bc <= codePoint && codePoint <= 0x25bd) || + (0x25c0 <= codePoint && codePoint <= 0x25c1) || + (0x25c6 <= codePoint && codePoint <= 0x25c8) || + 0x25cb == codePoint || + (0x25ce <= codePoint && codePoint <= 0x25d1) || + (0x25e2 <= codePoint && codePoint <= 0x25e5) || + 0x25ef == codePoint || + (0x2605 <= codePoint && codePoint <= 0x2606) || + 0x2609 == codePoint || + (0x260e <= codePoint && codePoint <= 0x260f) || + (0x2614 <= codePoint && codePoint <= 0x2615) || + 0x261c == codePoint || + 0x261e == codePoint || + 0x2640 == codePoint || + 0x2642 == codePoint || + (0x2660 <= codePoint && codePoint <= 0x2661) || + (0x2663 <= codePoint && codePoint <= 0x2665) || + (0x2667 <= codePoint && codePoint <= 0x266a) || + (0x266c <= codePoint && codePoint <= 0x266d) || + 0x266f == codePoint || + (0x269e <= codePoint && codePoint <= 0x269f) || + (0x26be <= codePoint && codePoint <= 0x26bf) || + (0x26c4 <= codePoint && codePoint <= 0x26cd) || + (0x26cf <= codePoint && codePoint <= 0x26e1) || + 0x26e3 == codePoint || + (0x26e8 <= codePoint && codePoint <= 0x26ff) || + 0x273d == codePoint || + 0x2757 == codePoint || + (0x2776 <= codePoint && codePoint <= 0x277f) || + (0x2b55 <= codePoint && codePoint <= 0x2b59) || + (0x3248 <= codePoint && codePoint <= 0x324f) || + (0xe000 <= codePoint && codePoint <= 0xf8ff) || + (0xfe00 <= codePoint && codePoint <= 0xfe0f) || + 0xfffd == codePoint || + (0x1f100 <= codePoint && codePoint <= 0x1f10a) || + (0x1f110 <= codePoint && codePoint <= 0x1f12d) || + (0x1f130 <= codePoint && codePoint <= 0x1f169) || + (0x1f170 <= codePoint && codePoint <= 0x1f19a) || + (0xe0100 <= codePoint && codePoint <= 0xe01ef) || + (0xf0000 <= codePoint && codePoint <= 0xffffd) || + (0x100000 <= codePoint && codePoint <= 0x10fffd)) { + return "A"; + } + return "N"; +}; +export const characterLength = (character) => { + var code = eastAsianWidth(character); + if (code == "F" || code == "W" || code == "A") { + return 2; + } + else { + return 1; + } +}; +// Split a string considering surrogate-pairs. +export const stringToArray = (str) => { + return str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; +}; +export const length = (str) => { + var characters = stringToArray(str); + var len = 0; + for (const char of characters) { + len = len + characterLength(char); + } + return len; +}; +export const slice = (text, start, end) => { + const textLen = length(text); + start = start ? start : 0; + end = end ? end : 1; + if (start < 0) { + start = textLen + start; + } + if (end < 0) { + end = textLen + end; + } + var result = ""; + var eawLen = 0; + var chars = stringToArray(text); + for (const char of chars) { + var charLen = length(char); + if (eawLen >= start - (charLen == 2 ? 1 : 0)) { + if (eawLen + charLen <= end) { + result += char; + } + else { + break; + } + } + eawLen += charLen; + } + return result; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..d474304dc3c25c107a649e04b1d95316024108f5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/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string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6479c1382aa174104a4e081387c23a1d10addeb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts @@ -0,0 +1,2 @@ +export declare const emojiRegex: () => RegExp; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..34d930acb50c942c1962698ca0f6a67c708ba485 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/emoji-regex/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,cAC2we,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js new file mode 100644 index 0000000000000000000000000000000000000000..328208a12967b0b6d34a3ef4f36d14ff31840df9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js @@ -0,0 +1,3 @@ +// https://mths.be/emoji +export const emojiRegex = () => /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\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uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08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DC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..26ca9ed1cf831201eb94df1e26bd9a30506362f2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/emoji-regex/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,gyeAAgye,CAAC","sourcesContent":["// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC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80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\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1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u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|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44d8100b2a178c81062b164ba5ef5f60051c2967 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts @@ -0,0 +1,41 @@ +export type UIOptions = { + width: number; + wrap?: boolean; + rows?: string[]; +}; +export type Column = { + text: string; + width?: number; + align?: 'right' | 'left' | 'center'; + padding?: number[]; + border?: boolean; +}; +export type ColumnArray = Column[] & { + span?: boolean; +}; +export type Line = { + hidden?: boolean; + text: string; + span?: boolean; +}; +export declare class UI { + width: number; + wrap: boolean; + rows: ColumnArray[]; + constructor(opts: UIOptions); + span(...args: ColumnArray): void; + resetOutput(): void; + div(...args: (Column | string)[]): ColumnArray; + shouldApplyLayoutDSL(...args: (Column | string)[]): boolean; + applyLayoutDSL(str: string): ColumnArray; + colFromString(text: string): Column; + measurePadding(str: string): number[]; + toString(): string; + rowToString(row: ColumnArray, lines: Line[]): Line[]; + renderInline(source: string, previousLine: Line): string; + rasterize(row: ColumnArray): string[][]; + negatePadding(col: Column): number; + columnWidths(row: ColumnArray): number[]; +} +export declare const cliui: (opts?: Partial) => UI; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5b860cfd529b2fed77810c9858fe4f701af2bcc9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;IACnC,OAAO,CAAC,EAAE,MA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dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9d1d04972130353b9bdf40ece1b7b8585c57ea6d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.js @@ -0,0 +1,317 @@ +import { stringWidth } from './string-width/index.js'; +import { stripAnsi } from './strip-ansi/index.js'; +import { wrap } from './wrap-ansi/index.js'; +const align = { + right: (str, width) => `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`, + center: (str, width) => `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`, +}; +const top = 0; +const right = 1; +const bottom = 2; +const left = 3; +export class UI { + width; + wrap; + rows; + constructor(opts) { + this.width = opts.width; + /* c8 ignore start */ + this.wrap = opts.wrap ?? true; + /* c8 ignore stop */ + this.rows = []; + } + span(...args) { + const cols = this.div(...args); + cols.span = true; + } + resetOutput() { + this.rows = []; + } + div(...args) { + if (args.length === 0) { + this.div(''); + } + if (this.wrap && + this.shouldApplyLayoutDSL(...args) && + typeof args[0] === 'string') { + return this.applyLayoutDSL(args[0]); + } + const cols = Object.assign(args.map(arg => { + if (typeof arg === 'string') { + return this.colFromString(arg); + } + return arg; + }), { span: false }); + this.rows.push(cols); + return cols; + } + shouldApplyLayoutDSL(...args) { + return (args.length === 1 && + typeof args[0] === 'string' && + /[\t\n]/.test(args[0])); + } + applyLayoutDSL(str) { + const rows = str.split('\n').map(row => row.split('\t')); + let leftColumnWidth = 0; + // simple heuristic for layout, make sure the + // second column lines up along the left-hand. + // don't allow the first column to take up more + // than 50% of the screen. + rows.forEach(columns => { + if (columns.length > 1 && + stringWidth(String(columns[0])) > leftColumnWidth) { + leftColumnWidth = Math.min(Math.floor(this.width * 0.5), stringWidth(String(columns[0]))); + } + }); + // generate a table: + // replacing ' ' with padding calculations. + // using the algorithmically generated width. + rows.forEach(columns => { + this.div(...columns.map((r, i) => { + return { + text: r.trim(), + padding: this.measurePadding(r), + width: i === 0 && columns.length > 1 ? leftColumnWidth : undefined, + }; + })); + }); + const row = this.rows[this.rows.length - 1]; + /* c8 ignore start */ + if (!row) { + throw new Error('no rows found'); + } + /* c8 ignore stop */ + return row; + } + colFromString(text) { + return { + text, + padding: this.measurePadding(text), + }; + } + measurePadding(str) { + // measure padding without ansi escape codes + const noAnsi = stripAnsi(str); + const [right = '', left = ''] = [ + noAnsi.match(/\s*$/)?.[0], + noAnsi.match(/^\s*/)?.[0], + ]; + return [0, right.length, 0, left.length]; + } + toString() { + const lines = []; + this.rows.forEach(row => { + this.rowToString(row, lines); + }); + // don't display any lines with the + // hidden flag set. + return lines + .filter(line => !line.hidden) + .map(line => line.text) + .join('\n'); + } + rowToString(row, lines) { + this.rasterize(row).forEach((rrow, r) => { + let str = ''; + rrow.forEach((col, c) => { + const column = row[c]; + const { width } = column; // the width with padding. + const wrapWidth = this.negatePadding(column); // the width without padding. + let ts = col; // temporary string used during alignment/padding. + if (wrapWidth > stringWidth(col)) { + ts += ' '.repeat(wrapWidth - stringWidth(col)); + } + // align the string within its column. + if (column.align && column.align !== 'left' && this.wrap) { + const fn = align[column.align]; + ts = fn(ts.trim(), wrapWidth); + if (stringWidth(ts) < wrapWidth) { + /* c8 ignore start */ + const w = width || 0; + /* c8 ignore stop */ + ts += ' '.repeat(w - stringWidth(ts) - 1); + } + } + // apply border and padding to string. + const padding = column.padding || [0, 0, 0, 0]; + if (padding[left]) { + str += ' '.repeat(padding[left]); + } + str += addBorder(column, ts, '| '); + str += ts; + str += addBorder(column, ts, ' |'); + if (padding[right]) { + str += ' '.repeat(padding[right]); + } + // if prior row is span, try to render the + // current row on the prior line. + if (r === 0 && lines.length > 0) { + const lastLine = lines[lines.length - 1]; + /* c8 ignore start */ + if (!lastLine) { + throw new Error('last line not found'); + } + /* c8 ignore stop */ + str = this.renderInline(str, lastLine); + } + }); + // remove trailing whitespace. + lines.push({ + text: str.replace(/ +$/, ''), + span: row.span, + }); + }); + return lines; + } + // if the full 'source' can render in + // the target line, do so. + renderInline(source, previousLine) { + const match = source.match(/^ */); + /* c8 ignore start */ + const leadingWhitespace = match ? match[0].length : 0; + /* c8 ignore stop */ + const target = previousLine.text; + const targetTextWidth = stringWidth(target.trimEnd()); + if (!previousLine.span) { + return source; + } + // if we're not applying wrapping logic, + // just always append to the span. + if (!this.wrap) { + previousLine.hidden = true; + return target + source; + } + if (leadingWhitespace < targetTextWidth) { + return source; + } + previousLine.hidden = true; + return (target.trimEnd() + + ' '.repeat(leadingWhitespace - targetTextWidth) + + source.trimStart()); + } + rasterize(row) { + const rrows = []; + const widths = this.columnWidths(row); + let wrapped; + // word wrap all columns, and create + // a data-structure that is easy to rasterize. + row.forEach((col, c) => { + // leave room for left and right padding. + col.width = widths[c]; + if (this.wrap) { + wrapped = wrap(col.text, this.negatePadding(col), { + hard: true, + }).split('\n'); + } + else { + wrapped = col.text.split('\n'); + } + if (col.border) { + wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.'); + wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'"); + } + // add top and bottom padding. + if (col.padding) { + wrapped.unshift(...new Array(col.padding[top] || 0).fill('')); + wrapped.push(...new Array(col.padding[bottom] || 0).fill('')); + } + wrapped.forEach((str, r) => { + if (!rrows[r]) { + rrows.push([]); + } + /* c8 ignore start */ + const rrow = rrows[r] ?? []; + /* c8 ignore stop */ + for (let i = 0; i < c; i++) { + if (rrow[i] === undefined) { + rrow.push(''); + } + } + rrow.push(str); + }); + }); + return rrows; + } + negatePadding(col) { + /* c8 ignore start */ + let wrapWidth = col.width || 0; + /* c8 ignore stop */ + if (col.padding) { + wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); + } + if (col.border) { + wrapWidth -= 4; + } + return wrapWidth; + } + columnWidths(row) { + if (!this.wrap) { + return row.map(col => { + return col.width || stringWidth(col.text); + }); + } + let unset = row.length; + let remainingWidth = this.width; + // column widths can be set in config. + const widths = row.map(col => { + if (col.width) { + unset--; + remainingWidth -= col.width; + return col.width; + } + return undefined; + }); + // any unset widths should be calculated. + /* c8 ignore start */ + const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; + /* c8 ignore stop */ + return widths.map((w, i) => { + if (w === undefined) { + /* c8 ignore start */ + const col = row[i] ?? { text: '', padding: [] }; + /* c8 ignore stop */ + return Math.max(unsetWidth, _minWidth(col)); + } + return w; + }); + } +} +const addBorder = (col, ts, style) => { + if (col.border) { + if (/[.']-+[.']/.test(ts)) { + return ''; + } + if (ts.trim().length !== 0) { + return style; + } + return ' '; + } + return ''; +}; +// calculates the minimum width of +// a column, based on padding preferences. +const _minWidth = (col) => { + const padding = col.padding || []; + const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); + if (col.border) { + return minWidth + 4; + } + return minWidth; +}; +const getWindowWidth = () => { + /* c8 ignore start */ + if (typeof process === 'object' && + process.stdout && + process.stdout.columns) { + return process.stdout.columns; + } + return 80; +}; +/* c8 ignore stop */ +export const cliui = (opts = {}) => new UI({ + /* c8 ignore start */ + width: opts?.width || getWindowWidth(), + wrap: opts?.wrap, + /* c8 ignore stop */ +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9619031b0c74bf4bbe619a4789087499239e48b3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,MAAM,KAAK,GAAG;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O,OAAO,KAAK,QAAQ;QAC3B,OAAO,CAAC,MAAM;QACd,OAAO,CAAC,MAAM,CAAC,OAAO,EACtB,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;IAC/B,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AACD,oBAAoB;AAEpB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAA2B,EAAE,EAAE,EAAE,CACrD,IAAI,EAAE,CAAC;IACL,qBAAqB;IACrB,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,cAAc,EAAE;IACtC,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,oBAAoB;CACrB,CAAC,CAAA","sourcesContent":["import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n /* c8 ignore start */\n width: opts?.width || getWindowWidth(),\n wrap: opts?.wrap,\n /* c8 ignore stop */\n })\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e5daef21f68f407bf612792e267d877cc6c54cd0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js @@ -0,0 +1,12 @@ +var $=({onlyFirst:F=!1}={})=>{let t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,F?void 0:"g")};var R=$(),o=F=>F.replace(R,"");var y=F=>{var u=F.charCodeAt(0),C=F.length==2?F.charCodeAt(1):0,D=u;return 55296<=u&&u<=56319&&56320<=C&&C<=57343&&(u&=1023,C&=1023,D=u<<10|C,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"};var W=()=>/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\u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DF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uD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\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;function f(F,u={}){if(typeof F!="string"||F.length===0||(u={ambiguousIsNarrow:!0,...u},F=o(F),F.length===0))return 0;F=F.replace(W()," ");let C=u.ambiguousIsNarrow?1:2,D=0;for(let t of F){let E=t.codePointAt(0);if(!E||E<=31||E>=127&&E<=159||E>=768&&E<=879)continue;switch(y(t)){case"F":case"W":D+=2;break;case"A":D+=C;break;default:D+=1}}return D}var A={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},xD=Object.keys(A.modifier),I=Object.keys(A.color),O=Object.keys(A.bgColor),rD=[...I,...O],d=class{},T=new Map,p=F=>Object.fromEntries(Object.entries(F).map(([u,[C,D]])=>(T.set(C,D),[u,d.prototype[u]={open:`\x1B[${C}m`,close:`\x1B[${D}m`}]))),M=new class extends d{codes=T;modifier=p(A.modifier);color={...p(A.color),close:"\x1B[39m",ansi:F=>`\x1B[${F}m`,ansi256:F=>`\x1B[38;5;${F}m`,ansi16m:(F,u,C)=>`\x1B[38;2;${F};${u};${C}m`};bgColor={...p(A.bgColor),close:"\x1B[49m",ansi:F=>`\x1B[${F+10}m`,ansi256:F=>`\x1B[48;5;${F}m`,ansi16m:(F,u,C)=>`\x1B[48;2;${F};${u};${C}m`};rgbToAnsi256(F,u,C){return F===u&&u===C?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(C/255*5)}hexToRgb(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[C]=u;C.length===3&&(C=[...C].map(t=>t+t).join(""));let D=Number.parseInt(C,16);return[D>>16&255,D>>8&255,D&255]}hexToAnsi256(F){return this.rgbToAnsi256(...this.hexToRgb(F))}ansi256ToAnsi(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,C,D;if(F>=232)u=((F-232)*10+8)/255,C=u,D=u;else{F-=16;let e=F%36;u=Math.floor(F/36)/5,C=Math.floor(e/6)/5,D=e%6/5}let t=Math.max(u,C,D)*2;if(t===0)return 30;let E=30+(Math.round(D)<<2|Math.round(C)<<1|Math.round(u));return t===2&&(E+=60),E}rgbToAnsi(F,u,C){return this.ansi256ToAnsi(this.rgbToAnsi256(F,u,C))}hexToAnsi(F){return this.ansi256ToAnsi(this.hexToAnsi256(F))}};var c=new Set(["\x1B","\x9B"]),_=39,m="\x07",j="[",G="]",k="m",w=`${G}8;;`,N=F=>`${c.values().next().value}${j}${F}${k}`,v=F=>`${c.values().next().value}${w}${F}${m}`,z=F=>F.split(" ").map(u=>f(u)),b=(F,u,C)=>{let D=[...u],t=!1,E=!1,e=f(o(String(F[F.length-1])));for(let[x,r]of D.entries()){let a=f(r);if(e+a<=C?F[F.length-1]+=r:(F.push(r),e=0),c.has(r)&&(t=!0,E=D.slice(x+1).join("").startsWith(w)),t){E?r===m&&(t=!1,E=!1):r===k&&(t=!1);continue}e+=a,e===C&&x0&&F.length>1&&(F[F.length-2]=String(F[F.length-1])+F.pop())},H=F=>{let u=F.split(" "),C=u.length;for(;C>0&&!(f(String(u[C-1]))>0);)C--;return C===u.length?F:u.slice(0,C).join(" ")+u.slice(C).join("")},V=(F,u,C={})=>{if(C.trim!==!1&&F.trim()==="")return"";let D="",t,E,e=z(F),x=[""];for(let[a,i]of F.split(" ").entries()){C.trim!==!1&&(x[x.length-1]=String(x[x.length-1]).trimStart());let n=f(String(x[x.length-1]));a!==0&&(n>=u&&(C.wordWrap===!1||C.trim===!1)&&(x.push(""),n=0),(n>0||C.trim===!1)&&(x[x.length-1]+=" ",n++));let B=Number(e[a]);if(C.hard&&B>u){let s=u-n,l=1+Math.floor((B-s-1)/u);Math.floor((B-1)/u)u&&n>0&&B>0){if(C.wordWrap===!1&&nu&&C.wordWrap===!1){b(x,i,u);continue}x[x.length-1]+=i}C.trim!==!1&&(x=x.map(a=>H(a)));let r=[...x.join(` +`)];for(let[a,i]of r.entries()){if(D+=i,c.has(i)){let{groups:B}=new RegExp(`(?:\\${j}(?\\d+)m|\\${w}(?.*)${m})`).exec(r.slice(a).join(""))||{groups:{}};if(B.code!==void 0){let s=Number.parseFloat(B.code);t=s===_?void 0:s}else B.uri!==void 0&&(E=B.uri.length===0?void 0:B.uri)}let n=M.codes.get(Number(t));r[a+1]===` +`?(E&&(D+=v("")),t&&n&&(D+=N(n))):i===` +`&&(t&&n&&(D+=N(t)),E&&(D+=v(E)))}return D},L=(F,u,C)=>String(F).normalize().replace(/\r\n/g,` +`).split(` +`).map(D=>V(D,u,C)).join(` +`);var Y={right:(F,u)=>`${" ".repeat(Math.max(0,u-f(F)))}${F}`,center:(F,u)=>`${" ".repeat(Math.max(0,u-f(F))>>1)}${F}`},q=0,h=1,K=2,g=3,S=class{width;wrap;rows;constructor(u){this.width=u.width,this.wrap=u.wrap??!0,this.rows=[]}span(...u){let C=this.div(...u);C.span=!0}resetOutput(){this.rows=[]}div(...u){if(u.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...u)&&typeof u[0]=="string")return this.applyLayoutDSL(u[0]);let C=Object.assign(u.map(D=>typeof D=="string"?this.colFromString(D):D),{span:!1});return this.rows.push(C),C}shouldApplyLayoutDSL(...u){return u.length===1&&typeof u[0]=="string"&&/[\t\n]/.test(u[0])}applyLayoutDSL(u){let C=u.split(` +`).map(E=>E.split(" ")),D=0;C.forEach(E=>{E.length>1&&f(String(E[0]))>D&&(D=Math.min(Math.floor(this.width*.5),f(String(E[0]))))}),C.forEach(E=>{this.div(...E.map((e,x)=>({text:e.trim(),padding:this.measurePadding(e),width:x===0&&E.length>1?D:void 0})))});let t=this.rows[this.rows.length-1];if(!t)throw new Error("no rows found");return t}colFromString(u){return{text:u,padding:this.measurePadding(u)}}measurePadding(u){let C=o(u),[D="",t=""]=[C.match(/\s*$/)?.[0],C.match(/^\s*/)?.[0]];return[0,D.length,0,t.length]}toString(){let u=[];return this.rows.forEach(C=>{this.rowToString(C,u)}),u.filter(C=>!C.hidden).map(C=>C.text).join(` +`)}rowToString(u,C){return this.rasterize(u).forEach((D,t)=>{let E="";D.forEach((e,x)=>{let r=u[x],{width:a}=r,i=this.negatePadding(r),n=e;if(i>f(e)&&(n+=" ".repeat(i-f(e))),r.align&&r.align!=="left"&&this.wrap){let s=Y[r.align];if(n=s(n.trim(),i),f(n)0){let s=C[C.length-1];if(!s)throw new Error("last line not found");E=this.renderInline(E,s)}}),C.push({text:E.replace(/ +$/,""),span:u.span})}),C}renderInline(u,C){let D=u.match(/^ */),t=D?D[0].length:0,E=C.text,e=f(E.trimEnd());return C.span?this.wrap?t{E.width=D[e],this.wrap?t=L(E.text,this.negatePadding(E),{hard:!0}).split(` +`):t=E.text.split(` +`),E.border&&(t.unshift("."+"-".repeat(this.negatePadding(E)+2)+"."),t.push("'"+"-".repeat(this.negatePadding(E)+2)+"'")),E.padding&&(t.unshift(...new Array(E.padding[q]||0).fill("")),t.push(...new Array(E.padding[K]||0).fill(""))),t.forEach((x,r)=>{C[r]||C.push([]);let a=C[r]??[];for(let i=0;ie.width||f(e.text));let C=u.length,D=this.width,t=u.map(e=>{if(e.width)return C--,D-=e.width,e.width}),E=C?Math.floor(D/C):0;return t.map((e,x)=>{if(e===void 0){let r=u[x]??{text:"",padding:[]};return Math.max(E,Z(r))}return e})}},P=(F,u,C)=>F.border?/[.']-+[.']/.test(u)?"":u.trim().length!==0?C:" ":"",Z=F=>{let u=F.padding||[],C=1+(u[g]||0)+(u[h]||0);return F.border?C+4:C},J=()=>typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80,cD=(F={})=>new S({width:F?.width||J(),wrap:F?.wrap});export{S as UI,cD as cliui}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7f6cd19d1bbadb9e756ea4a865d1f492811c4319 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/ansi-regex/index.ts", "../../src/strip-ansi/index.ts", "../../src/eastasianwidth/index.ts", "../../src/emoji-regex/index.ts", "../../src/string-width/index.ts", "../../src/ansi-styles/index.ts", "../../src/wrap-ansi/index.ts", "../../src/index.ts"], + "sourcesContent": ["// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n", "import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n", "export const eastAsianWidth = (character: string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n", "// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDF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DAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\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D34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\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9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n", "import { stripAnsi } from \"../strip-ansi/index.js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n", "const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n", "import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n", "import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n /* c8 ignore start */\n width: opts?.width || getWindowWidth(),\n wrap: opts?.wrap,\n /* c8 ignore stop */\n })\n"], + "mappings": "AAEO,IAAMA,EAAY,CAAC,CAAE,UAAAC,EAAY,EAAK,EAAK,CAAA,IAAM,CAWtD,IAAMC,EAAU,gJAEhB,OAAO,IAAI,OAAOA,EAASD,EAAY,OAAY,GAAG,CACxD,ECfA,IAAME,EAAQC,EAAS,EACVC,EAAaC,GAAgBA,EAAI,QAAQH,EAAO,EAAE,ECFxD,IAAMI,EAAkBC,GAAqB,CAClD,IAAIC,EAAID,EAAU,WAAW,CAAC,EAC1BE,EAAIF,EAAU,QAAU,EAAIA,EAAU,WAAW,CAAC,EAAI,EACtDG,EAAYF,EAQhB,MAPI,QAAUA,GAAKA,GAAK,OAAU,OAAUC,GAAKA,GAAK,QACpDD,GAAK,K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,EAAG,CAEL,MAAOC,GAAM,OAAS0C,EAAc,EACpC,KAAM1C,GAAM,KAEb", + "names": ["ansiRegex", "onlyFirst", "pattern", "regex", "ansiRegex", "stripAnsi", "str", "eastAsianWidth", "character", "x", "y", "codePoint", "emojiRegex", "stringWidth", "str", "options", "stripAnsi", "emojiRegex", "ambiguousCharacterWidth", "width", "character", "codePoint", "eastAsianWidth", "styles", "modifierNames", "foregroundColorNames", "backgroundColorNames", "colorNames", "AnsiStyles", "codes", "ingest", "set", "key", "open", "close", "ansiStyles", "code", "red", "green", "blue", "hex", "matches", "colorString", "character", "integer", "remainder", "value", "result", "ESCAPES", "END_CODE", "ANSI_ESCAPE_BELL", "ANSI_CSI", "ANSI_OSC", "ANSI_SGR_TERMINATOR", "ANSI_ESCAPE_LINK", "wrapAnsiCode", "code", "wrapAnsiHyperlink", "uri", "wordLengths", "str", "character", "stringWidth", "wrapWord", "rows", "word", "columns", "characters", "isInsideEscape", "isInsideLinkEscape", "visible", "stripAnsi", "index", "characterLength", "stringVisibleTrimSpacesRight", "words", "last", "exec", "options", "returnValue", "escapeCode", "escapeUrl", "lengths", "rowLength", "len", "remainingColumns", "breaksStartingThisLine", "row", "pre", "groups", "ansiStyles", "wrap", "line", "align", "str", "width", "stringWidth", "top", "right", "bottom", "left", "UI", "opts", "args", "cols", "arg", "rows", "row", "leftColumnWidth", "columns", "r", "i", "text", "noAnsi", "stripAnsi", "lines", "line", "rrow", "col", "c", "column", "wrapWidth", "ts", "fn", "w", "padding", "addBorder", "lastLine", "source", "previousLine", "match", "leadingWhitespace", "target", "targetTextWidth", "rrows", "widths", "wrapped", "wrap", "unset", "remainingWidth", "unsetWidth", "_minWidth", "style", "minWidth", "getWindowWidth", "cliui"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c45de2ba2586582683b3c2c706dc076a355a1acb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts @@ -0,0 +1,5 @@ +export type Options = { + ambiguousIsNarrow?: boolean; +}; +export declare function stringWidth(str: string, options?: Options): number; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8113358988a996bc7e4aa8e2d8b546b780349eb9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string-width/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAqD7D"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ec8f108b770ea7df752947abdb6d7bdf7afcfec2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js @@ -0,0 +1,46 @@ +import { stripAnsi } from "../strip-ansi/index.js"; +import { eastAsianWidth } from "../eastasianwidth/index.js"; +import { emojiRegex } from "../emoji-regex/index.js"; +export function stringWidth(str, options = {}) { + if (typeof str !== "string" || str.length === 0) { + return 0; + } + options = { + ambiguousIsNarrow: true, + ...options, + }; + str = stripAnsi(str); + if (str.length === 0) { + return 0; + } + str = str.replace(emojiRegex(), " "); + const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2; + let width = 0; + for (const character of str) { + const codePoint = character.codePointAt(0); + // Ignore control characters + if (!codePoint || + codePoint <= 0x1f || + (codePoint >= 0x7f && codePoint <= 0x9f)) { + continue; + } + // Ignore combining characters + if (codePoint >= 0x300 && codePoint <= 0x36f) { + continue; + } + const code = eastAsianWidth(character); + switch (code) { + case "F": + case "W": + width += 2; + break; + case "A": + width += ambiguousCharacterWidth; + break; + default: + width += 1; + } + } + return width; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..44d1902b210da7b10d8b5629ce7467e9f8f5b4e5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/string-width/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMrD,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,UAAmB,EAAE;IAC5D,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,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js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e0fab4337a4c5aa33b533d55cdccb610b99082a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts @@ -0,0 +1,2 @@ +export declare const stripAnsi: (str: string) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4c23c4ed234e1ae7705a70a264945b543e98f14f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strip-ansi/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,WAA2B,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c9f2b63bc406575eb0a57a0280c39502333200bc --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js @@ -0,0 +1,4 @@ +import { ansiRegex } from "../ansi-regex/index.js"; +const regex = ansiRegex(); +export const stripAnsi = (str) => str.replace(regex, ""); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1ade64d28f260fefcc40b9d07e980de49908fcae --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/strip-ansi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;AAC1B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1159d65e764df7d20e551a0ef7de683061167054 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts @@ -0,0 +1,7 @@ +export type Options = { + trim?: boolean; + wordWrap?: boolean; + hard?: boolean; +}; +export declare const wrap: (str: string, columns: number, options: Options) => string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..734772de62570dfc08a5a9b610a40d1524ee6d3b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrap-ansi/index.ts"],"names":[],"mappings":"AAuGA,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAuH7E,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,OAAO,WAMpD,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4427550d0a6d46a9fc4fd0fe3848f3c92f63cada --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js @@ -0,0 +1,172 @@ +import { stringWidth } from "../string-width/index.js"; +import { stripAnsi } from "../strip-ansi/index.js"; +import { ansiStyles } from "../ansi-styles/index.js"; +const ESCAPES = new Set(["\u001B", "\u009B"]); +const END_CODE = 39; +const ANSI_ESCAPE_BELL = "\u0007"; +const ANSI_CSI = "["; +const ANSI_OSC = "]"; +const ANSI_SGR_TERMINATOR = "m"; +const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; +const wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; +const wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = (str) => str.split(" ").map((character) => stringWidth(character)); +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; + let isInsideEscape = false; + let isInsideLinkEscape = false; + let visible = stringWidth(stripAnsi(String(rows[rows.length - 1]))); + for (const [index, character] of characters.entries()) { + const characterLength = stringWidth(character); + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } + else { + rows.push(character); + visible = 0; + } + if (ESCAPES.has(character)) { + isInsideEscape = true; + isInsideLinkEscape = characters + .slice(index + 1) + .join("") + .startsWith(ANSI_ESCAPE_LINK); + } + if (isInsideEscape) { + if (isInsideLinkEscape) { + if (character === ANSI_ESCAPE_BELL) { + isInsideEscape = false; + isInsideLinkEscape = false; + } + } + else if (character === ANSI_SGR_TERMINATOR) { + isInsideEscape = false; + } + continue; + } + visible += characterLength; + if (visible === columns && index < characters.length - 1) { + rows.push(""); + visible = 0; + } + } + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case + if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) { + rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop(); + } +}; +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = (str) => { + const words = str.split(" "); + let last = words.length; + while (last > 0) { + if (stringWidth(String(words[last - 1])) > 0) { + break; + } + last--; + } + if (last === words.length) { + return str; + } + return words.slice(0, last).join(" ") + words.slice(last).join(""); +}; +const exec = (str, columns, options = {}) => { + if (options.trim !== false && str.trim() === "") { + return ""; + } + let returnValue = ""; + let escapeCode; + let escapeUrl; + const lengths = wordLengths(str); + let rows = [""]; + for (const [index, word] of str.split(" ").entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart(); + } + let rowLength = stringWidth(String(rows[rows.length - 1])); + if (index !== 0) { + if (rowLength >= columns && + (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(""); + rowLength = 0; + } + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += " "; + rowLength++; + } + } + // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' + const len = Number(lengths[index]); + if (options.hard && len > columns) { + const remainingColumns = columns - rowLength; + const breaksStartingThisLine = 1 + Math.floor((len - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((len - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(""); + } + wrapWord(rows, word, columns); + continue; + } + if (rowLength + len > columns && rowLength > 0 && len > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + rows.push(""); + } + if (rowLength + len > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + rows[rows.length - 1] += word; + } + if (options.trim !== false) { + rows = rows.map((row) => stringVisibleTrimSpacesRight(row)); + } + const pre = [...rows.join("\n")]; + for (const [index, character] of pre.entries()) { + returnValue += character; + if (ESCAPES.has(character)) { + const { groups } = (new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} }); + if (groups.code !== undefined) { + const code = Number.parseFloat(groups.code); + escapeCode = code === END_CODE ? undefined : code; + } + else if (groups.uri !== undefined) { + escapeUrl = groups.uri.length === 0 ? undefined : groups.uri; + } + } + const code = ansiStyles.codes.get(Number(escapeCode)); + if (pre[index + 1] === "\n") { + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(""); + } + if (escapeCode && code) { + returnValue += wrapAnsiCode(code); + } + } + else if (character === "\n") { + if (escapeCode && code) { + returnValue += wrapAnsiCode(escapeCode); + } + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(escapeUrl); + } + } + } + return returnValue; +}; +// For each newline, invoke the method separately +export const wrap = (str, columns, options) => String(str) + .normalize() + .replace(/\r\n/g, "\n") + .split("\n") + .map((line) => exec(line, columns, options)) + .join("\n"); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..127b4d56110839b2e763261043737efbefe03d68 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wrap-ansi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAA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IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;aAAM,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YAC9B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,WAAW,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;YAC1C,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,WAAW,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,iDAAiD;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,OAAgB,EAAE,EAAE,CACrE,MAAM,CAAC,GAAG,CAAC;KACR,SAAS,EAAE;KACX,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;KACtB,KAAK,CAAC,IAAI,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAC3C,IAAI,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/package.json b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/package.json new file mode 100644 index 0000000000000000000000000000000000000000..79523be951352ad7fd7bdfd9b56f8c4f43aceb9a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/@isaacs/cliui/package.json @@ -0,0 +1,163 @@ +{ + "name": "@isaacs/cliui", + "version": "9.0.0", + "description": "easily create complex multi-column command-line-interfaces", + "type": "module", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./ansi-regex": { + "import": { + "types": "./dist/esm/ansi-regex/index.d.ts", + "default": "./dist/esm/ansi-regex/index.js" + }, + "require": { + "types": "./dist/commonjs/ansi-regex/index.d.ts", + "default": "./dist/commonjs/ansi-regex/index.js" + } + }, + "./ansi-styles": { + "import": { + "types": "./dist/esm/ansi-styles/index.d.ts", + "default": "./dist/esm/ansi-styles/index.js" + }, + "require": { + "types": "./dist/commonjs/ansi-styles/index.d.ts", + "default": "./dist/commonjs/ansi-styles/index.js" + } + }, + "./eastasianwidth": { + "import": { + "types": "./dist/esm/eastasianwidth/index.d.ts", + "default": "./dist/esm/eastasianwidth/index.js" + }, + "require": { + "types": "./dist/commonjs/eastasianwidth/index.d.ts", + "default": "./dist/commonjs/eastasianwidth/index.js" + } + }, + "./emoji-regex": { + "import": { + "types": "./dist/esm/emoji-regex/index.d.ts", + "default": "./dist/esm/emoji-regex/index.js" + }, + "require": { + "types": "./dist/commonjs/emoji-regex/index.d.ts", + "default": "./dist/commonjs/emoji-regex/index.js" + } + }, + "./string-width": { + "import": { + "types": "./dist/esm/string-width/index.d.ts", + "default": "./dist/esm/string-width/index.js" + }, + "require": { + "types": "./dist/commonjs/string-width/index.d.ts", + "default": "./dist/commonjs/string-width/index.js" + } + }, + "./strip-ansi": { + "import": { + "types": "./dist/esm/strip-ansi/index.d.ts", + "default": "./dist/esm/strip-ansi/index.js" + }, + "require": { + "types": "./dist/commonjs/strip-ansi/index.d.ts", + "default": "./dist/commonjs/strip-ansi/index.js" + } + }, + "./wrap-ansi": { + "import": { + "types": "./dist/esm/wrap-ansi/index.d.ts", + "default": "./dist/esm/wrap-ansi/index.js" + }, + "require": { + "types": "./dist/commonjs/wrap-ansi/index.d.ts", + "default": "./dist/commonjs/wrap-ansi/index.js" + } + }, + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy && bash build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc" + }, + "repository": "git+ssh://git@github.com:isaacs/cliui", + "keywords": [ + "cli", + "command-line", + "layout", + "design", + "console", + "wrap", + "table" + ], + "license": "BlueOak-1.0.0", + "devDependencies": { + "@types/node": "^25.2.1", + "esbuild": "^0.27.2", + "prettier": "^3.8.1", + "tap": "^21.5.0", + "tshy": "^3.1.0", + "typedoc": "^0.28.16" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "tshy": { + "selfLink": false, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./ansi-regex": "./src/ansi-regex/index.ts", + "./ansi-styles": "./src/ansi-styles/index.ts", + "./eastasianwidth": "./src/eastasianwidth/index.ts", + "./emoji-regex": "./src/emoji-regex/index.ts", + "./string-width": "./src/string-width/index.ts", + "./strip-ansi": "./src/strip-ansi/index.ts", + "./wrap-ansi": "./src/wrap-ansi/index.ts", + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + } +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..61ece8cc92afb41fdb1552ec1f72ac147b9eaceb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,23 @@ +(MIT) + +Original code Copyright Julian Gruber + +Port to TypeScript Copyright Isaac Z. Schlueter + +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/tools/ui/node_modules/workbox-build/node_modules/balanced-match/README.md b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f3bb3773a5320cef4378cdde9bc78adb5e646552 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/README.md @@ -0,0 +1,57 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and +``. Supports regular expressions as well! + +## Example + +Get the first matching pair of braces: + +```js +import { balanced } from 'balanced-match' + +console.log(balanced('{', '}', 'pre{in{nested}}post')) +console.log(balanced('{', '}', 'pre{first}between{second}post')) +console.log( + balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'), +) +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### const m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +- **start** the index of the first match of `a` +- **end** the index of the matching `b` +- **pre** the preamble, `a` and `b` not included +- **body** the match, `a` and `b` not included +- **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### const r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f819cfd016012ff5607febb82aaab715244f8fab --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6306762c77d77b909214a5d7af014b2eb156bbb3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0c9014bac153187d5b0e3d1d214a5d1c71eefd32 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.range = exports.balanced = void 0; +const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +exports.balanced = balanced; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +exports.range = range; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..83f547ca9d33d5e0cc5a6e38b1dab4b9060a2bc7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,OAAO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K,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f819cfd016012ff5607febb82aaab715244f8fab --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6306762c77d77b909214a5d7af014b2eb156bbb3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fe81200f9d676da19bf1bf088ecef7944290e38a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js @@ -0,0 +1,54 @@ +export const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && range(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +export const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b476cae229324756c8359ea6545e7494f13e63d7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;I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AC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/balanced-match/package.json b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/package.json new file mode 100644 index 0000000000000000000000000000000000000000..48f1a638d0b67d3187e9d6dbaee454df4b302f23 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/balanced-match/package.json @@ -0,0 +1,68 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "4.0.4", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/LICENSE b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..46e7b75c91ced041ae473299398af2b0472dc352 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter + +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/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/README.md b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..073aceb3177ae7babf06970ec4238c00f2527419 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/README.md @@ -0,0 +1,105 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +## Example + +```js +import { expand } from 'brace-expansion' + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +import { expand } from 'brace-expansion' +``` + +### const expanded = expand(str, [options]) + +Return an array of all possible and valid expansions of `str`. If +none are found, `[str]` is returned. + +The `options` object can provide a `max` value to cap the number +of expansions allowed. This is limited to `100_000` by default, +to prevent DoS attacks. + +```js +const expansions = expand('{1..100}'.repeat(5), { + max: 100, +}) +// expansions.length will be 100, not 100^5 +``` + +The `options` object can also provide a `maxLength` value to cap the +total number of characters across all expansions. This is limited to +`4_000_000` by default, to prevent memory exhaustion from inputs whose +result count stays under `max` while each result grows very long. + +```js +const expansions = expand('{a,b}'.repeat(1500), { + maxLength: 10_000, +}) +``` + +Valid expansions are: + +```js +;/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3e2de9d87e1ce462517e49f35733bed8bdf85af --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts @@ -0,0 +1,8 @@ +export declare const EXPANSION_MAX = 100000; +export declare const EXPANSION_MAX_LENGTH = 4000000; +export type BraceExpansionOptions = { + max?: number; + maxLength?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c0ff8dc158ab44082d0c3de029606fcb7b84eb88 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..869a6bee23807b9f01c18c99ab8e952b4b242f97 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; +exports.expand = expand; +const balanced_match_1 = require("balanced-match"); +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; + } + } + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + isTop = true; + continue; + } + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); + } + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; + if (isSequence) { + values = expandSequence(m.body, isAlphaSequence, max, maxLength); + } + else { + let n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, maxLength, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; + } + /* c8 ignore stop */ + } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } + } + } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + } + return acc; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..658bba38ad60d96289e5ed98b330aa29c6fcc483 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA2FA,wBAkBC;AA7GD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAA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,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YAAE,MAAK;QACzB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n acc: string[],\n pre: string,\n values: string[],\n max: number,\n maxLength: number,\n dropEmpties: boolean,\n): string[] {\n const out: string[] = []\n let length = 0\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max) return out\n const expansion = (acc[a] as string) + pre + values[v]\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion) continue\n if (length + expansion.length > maxLength) return out\n out.push(expansion)\n length += expansion.length\n }\n }\n return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n body: string,\n isAlphaSequence: boolean,\n max: number,\n maxLength: number,\n): string[] {\n const n = body.split(/\\.\\./)\n const N: string[] = []\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N\n }\n /* c8 ignore stop */\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n let length = 0\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n if (length + c.length > maxLength) break\n N.push(c)\n length += c.length\n }\n return N\n}\n\nfunction expand_(\n str: string,\n max: number,\n maxLength: number,\n isTop: boolean,\n): string[] {\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc: string[] = ['']\n\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false\n let firstGroup = true\n\n for (;;) {\n const m = balanced('{', '}', str)\n\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties)\n }\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(pre)) {\n acc = combine(\n acc,\n pre + '{' + m.body + '}',\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n firstGroup = false\n if (!m.post.length) break\n str = m.post\n continue\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(\n acc,\n pre + '{' + m.body + '}' + m.post,\n [''],\n max,\n maxLength,\n dropEmpties,\n )\n }\n\n if (firstGroup) {\n dropEmpties = isTop && !isSequence\n firstGroup = false\n }\n\n let values: string[]\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n } else {\n let n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(\n acc,\n pre + n[0],\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n if (!m.post.length) break\n str = m.post\n continue\n }\n /* c8 ignore stop */\n }\n\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false\n }\n }\n\n values = []\n let valuesLength = 0\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j] as string, max, maxLength, false)\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k] as string\n if (dropsEmpties && !v) continue\n if (values.length >= max || valuesLength + v.length > maxLength) {\n break outer\n }\n values.push(v)\n valuesLength += v.length\n }\n }\n }\n\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n if (!m.post.length) break\n str = m.post\n }\n\n return acc\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3e2de9d87e1ce462517e49f35733bed8bdf85af --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts @@ -0,0 +1,8 @@ +export declare const EXPANSION_MAX = 100000; +export declare const EXPANSION_MAX_LENGTH = 4000000; +export type BraceExpansionOptions = { + max?: number; + maxLength?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c0ff8dc158ab44082d0c3de029606fcb7b84eb88 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fd68f57029207ac1bcafe7fb1c14ad5305b3ffa4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js @@ -0,0 +1,285 @@ +import { balanced } from 'balanced-match'; +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +export const EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +export const EXPANSION_MAX_LENGTH = 4_000_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = balanced('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +export function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; + } + } + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = balanced('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + isTop = true; + continue; + } + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); + } + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; + if (isSequence) { + values = expandSequence(m.body, isAlphaSequence, max, maxLength); + } + else { + let n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, maxLength, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; + } + /* c8 ignore stop */ + } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } + } + } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + } + return acc; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..17b5e434eead5a29e21b1930e783aa7b29c0b610 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,OAAO,CAAA;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAA;AAEpC,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE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C,GAAG,QAAQ,CAAC,CAAC,CAAW,CAAA;oBAC/B,IAAI,YAAY,IAAI,CAAC,CAAC;wBAAE,SAAQ;oBAChC,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;wBAChE,MAAM,KAAK,CAAA;oBACb,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;oBACd,YAAY,IAAI,CAAC,CAAC,MAAM,CAAA;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YAAE,MAAK;QACzB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n acc: string[],\n pre: string,\n values: string[],\n max: number,\n maxLength: number,\n dropEmpties: boolean,\n): string[] {\n const out: string[] = []\n let length = 0\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max) return out\n const expansion = (acc[a] as string) + pre + values[v]\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion) continue\n if (length + expansion.length > maxLength) return out\n out.push(expansion)\n length += expansion.length\n }\n }\n return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n body: string,\n isAlphaSequence: boolean,\n max: number,\n maxLength: number,\n): string[] {\n const n = body.split(/\\.\\./)\n const N: string[] = []\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N\n }\n /* c8 ignore stop */\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n let length = 0\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n if (length + c.length > maxLength) break\n N.push(c)\n length += c.length\n }\n return N\n}\n\nfunction expand_(\n str: string,\n max: number,\n maxLength: number,\n isTop: boolean,\n): string[] {\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc: string[] = ['']\n\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false\n let firstGroup = true\n\n for (;;) {\n const m = balanced('{', '}', str)\n\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties)\n }\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(pre)) {\n acc = combine(\n acc,\n pre + '{' + m.body + '}',\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n firstGroup = false\n if (!m.post.length) break\n str = m.post\n continue\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(\n acc,\n pre + '{' + m.body + '}' + m.post,\n [''],\n max,\n maxLength,\n dropEmpties,\n )\n }\n\n if (firstGroup) {\n dropEmpties = isTop && !isSequence\n firstGroup = false\n }\n\n let values: string[]\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n } else {\n let n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(\n acc,\n pre + n[0],\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n if (!m.post.length) break\n str = m.post\n continue\n }\n /* c8 ignore stop */\n }\n\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false\n }\n }\n\n values = []\n let valuesLength = 0\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j] as string, max, maxLength, false)\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k] as string\n if (dropsEmpties && !v) continue\n if (values.length >= max || valuesLength + v.length > maxLength) {\n break outer\n }\n values.push(v)\n valuesLength += v.length\n }\n }\n }\n\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n if (!m.post.length) break\n str = m.post\n }\n\n return acc\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/package.json b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4376400796c951434ba3036b784822cd70083a00 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/brace-expansion/package.json @@ -0,0 +1,64 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "5.0.9", + "files": [ + "dist" + ], + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "license": "MIT", + "engines": { + "node": "20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/juliangruber/brace-expansion.git" + } +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/glob/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..881248b6d7f0ca2c4f65c41c0af5e02bb0680601 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/LICENSE.md @@ -0,0 +1,63 @@ +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/README.md b/tools/ui/node_modules/workbox-build/node_modules/glob/README.md new file mode 100644 index 0000000000000000000000000000000000000000..642254fd016bb839857a0d4d43b507d9b81b1f1b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/README.md @@ -0,0 +1,1294 @@ +# Glob + +Match files using the patterns the shell uses. + +The most correct and second fastest glob implementation in +JavaScript. (See [**Comparison to Other JavaScript Glob +Implementations**](#comparisons-to-other-fnmatchglob-implementations) +at the bottom of this readme.) + +![a fun cartoon logo made of glob +characters](https://github.com/isaacs/node-glob/raw/main/logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +> [!NOTE] +> The npm package name is _not_ `node-glob` that's a +> different thing that was abandoned years ago. Just `glob`. + +```js +// load using import +import { glob, globSync, globStream, globStreamSync, Glob } from 'glob' +// or using commonjs, that's fine, too +const { + glob, + globSync, + globStream, + globStreamSync, + Glob, +} = require('glob') + +// the main glob() and globSync() resolve/return array of filenames + +// all js files, but don't look in node_modules +const jsfiles = await glob('**/*.js', { ignore: 'node_modules/**' }) + +// pass in a signal to cancel the glob walk +const stopAfter100ms = await glob('**/*.css', { + signal: AbortSignal.timeout(100), +}) + +// multiple patterns supported as well +const images = await glob(['css/*.{png,jpeg}', 'public/*.{png,jpeg}']) + +// but of course you can do that with the glob pattern also +// the sync function is the same, just returns a string[] instead +// of Promise +const imagesAlt = globSync('{css,public}/*.{png,jpeg}') + +// you can also stream them, this is a Minipass stream +const filesStream = globStream(['**/*.dat', 'logs/**/*.log']) + +// construct a Glob object if you wanna do it that way, which +// allows for much faster walks if you have to look in the same +// folder multiple times. +const g = new Glob('**/foo', {}) +// glob objects are async iterators, can also do globIterate() or +// g.iterate(), same deal +for await (const file of g) { + console.log('found a foo file:', file) +} +// pass a glob as the glob options to reuse its settings and caches +const g2 = new Glob('**/bar', g) +// sync iteration works as well +for (const file of g2) { + console.log('found a bar file:', file) +} + +// you can also pass withFileTypes: true to get Path objects +// these are like a fs.Dirent, but with some more added powers +// check out https://isaacs.github.io/path-scurry/classes/PathBase.html +// for more info on their API +const g3 = new Glob('**/baz/**', { withFileTypes: true }) +g3.stream().on('data', path => { + console.log( + 'got a path object', + path.fullpath(), + path.isDirectory(), + path.readdirSync().map(e => e.name), + ) +}) + +// if you use stat:true and withFileTypes, you can sort results +// by things like modified time, filter by permission mode, etc. +// All Stats fields will be available in that case. Slightly +// slower, though. +// For example: +const results = await glob('**', { stat: true, withFileTypes: true }) + +const timeSortedFiles = results + .sort((a, b) => a.mtimeMs - b.mtimeMs) + .map(path => path.fullpath()) + +const groupReadableFiles = results + .filter(path => path.mode & 0o040) + .map(path => path.fullpath()) + +// custom ignores can be done like this, for example by saying +// you'll ignore all markdown files, and all folders named 'docs' +const customIgnoreResults = await glob('**', { + ignore: { + ignored: p => /\.md$/.test(p.name), + childrenIgnored: p => p.isNamed('docs'), + }, +}) + +// another fun use case, only return files with the same name as +// their parent folder, plus either `.ts` or `.js` +const folderNamedModules = await glob('**/*.{ts,js}', { + ignore: { + ignored: p => { + const pp = p.parent + return !(p.isNamed(pp.name + '.ts') || p.isNamed(pp.name + '.js')) + }, + }, +}) + +// find all files edited in the last hour, to do this, we ignore +// all of them that are more than an hour old +const newFiles = await glob('**', { + // need stat so we have mtime + stat: true, + // only want the files, not the dirs + nodir: true, + ignore: { + ignored: p => { + return new Date() - p.mtime > 60 * 60 * 1000 + }, + // could add similar childrenIgnored here as well, but + // directory mtime is inconsistent across platforms, so + // probably better not to, unless you know the system + // tracks this reliably. + }, +}) +``` + +> [!NOTE] +> Glob patterns should always use `/` as a path separator, +> even on Windows systems, as `\` is used to escape glob +> characters. If you wish to use `\` as a path separator _instead +> of_ using it as an escape character on Windows platforms, you may +> set `windowsPathsNoEscape:true` in the options. In this mode, +> special glob characters cannot be escaped, making it impossible +> to match a literal `*` `?` and so on in filenames. + +## Command Line Interface + +``` +$ glob -h + +Usage: + glob [options] [ [ ...]] + +Expand the positional glob expression arguments into any matching file system +paths found. + + -c --cmd= + Run the command provided, passing the glob expression + matches as arguments. + + -A --all By default, the glob cli command will not expand any + arguments that are an exact match to a file on disk. + + This prevents double-expanding, in case the shell + expands an argument whose filename is a glob + expression. + + For example, if 'app/*.ts' would match 'app/[id].ts', + then on Windows powershell or cmd.exe, 'glob app/*.ts' + will expand to 'app/[id].ts', as expected. However, in + posix shells such as bash or zsh, the shell will first + expand 'app/*.ts' to a list of filenames. Then glob + will look for a file matching 'app/[id].ts' (ie, + 'app/i.ts' or 'app/d.ts'), which is unexpected. + + Setting '--all' prevents this behavior, causing glob to + treat ALL patterns as glob expressions to be expanded, + even if they are an exact match to a file on disk. + + When setting this option, be sure to enquote arguments + so that the shell will not expand them prior to passing + them to the glob command process. + + -a --absolute Expand to absolute paths + -d --dot-relative Prepend './' on relative matches + -m --mark Append a / on any directories matched + -x --posix Always resolve to posix style paths, using '/' as the + directory separator, even on Windows. Drive letter + absolute matches on Windows will be expanded to their + full resolved UNC paths, eg instead of 'C:\foo\bar', it + will expand to '//?/C:/foo/bar'. + + -f --follow Follow symlinked directories when expanding '**' + -R --realpath Call 'fs.realpath' on all of the results. In the case + of an entry that cannot be resolved, the entry is + omitted. This incurs a slight performance penalty, of + course, because of the added system calls. + + -s --stat Call 'fs.lstat' on all entries, whether required or not + to determine if it's a valid match. + + -b --match-base Perform a basename-only match if the pattern does not + contain any slash characters. That is, '*.js' would be + treated as equivalent to '**/*.js', matching js files + in all directories. + + --dot Allow patterns to match files/directories that start + with '.', even if the pattern does not start with '.' + + --nobrace Do not expand {...} patterns + --nocase Perform a case-insensitive match. This defaults to + 'true' on macOS and Windows platforms, and false on all + others. + + Note: 'nocase' should only be explicitly set when it is + known that the filesystem's case sensitivity differs + from the platform default. If set 'true' on + case-insensitive file systems, then the walk may return + more or less results than expected. + + --nodir Do not match directories, only files. + + Note: to *only* match directories, append a '/' at the + end of the pattern. + + --noext Do not expand extglob patterns, such as '+(a|b)' + --noglobstar Do not expand '**' against multiple path portions. Ie, + treat it as a normal '*' instead. + + --windows-path-no-escape + Use '\' as a path separator *only*, and *never* as an + escape character. If set, all '\' characters are + replaced with '/' in the pattern. + + -D --max-depth= Maximum depth to traverse from the current working + directory + + -C --cwd= Current working directory to execute/match in + -r --root= A string path resolved against the 'cwd', which is used + as the starting point for absolute patterns that start + with '/' (but not drive letters or UNC paths on + Windows). + + Note that this *doesn't* necessarily limit the walk to + the 'root' directory, and doesn't affect the cwd + starting point for non-absolute patterns. A pattern + containing '..' will still be able to traverse out of + the root directory, if it is not an actual root + directory on the filesystem, and any non-absolute + patterns will still be matched in the 'cwd'. + + To start absolute and non-absolute patterns in the same + path, you can use '--root=' to set it to the empty + string. However, be aware that on Windows systems, a + pattern like 'x:/*' or '//host/share/*' will *always* + start in the 'x:/' or '//host/share/' directory, + regardless of the --root setting. + + --platform= Defaults to the value of 'process.platform' if + available, or 'linux' if not. Setting --platform=win32 + on non-Windows systems may cause strange behavior! + + -i --ignore= + Glob patterns to ignore Can be set multiple times + -v --debug Output a huge amount of noisy debug information about + patterns as they are parsed and used to match files. + + -h --help Show this usage information +``` + +## `glob(pattern: string | string[], options?: GlobOptions) => Promise` + +Perform an asynchronous glob search for the pattern(s) specified. +Returns +[Path](https://isaacs.github.io/path-scurry/classes/PathBase) +objects if the `withFileTypes` option is set to `true`. See below +for full options field desciptions. + +## `globSync(pattern: string | string[], options?: GlobOptions) => string[] | Path[]` + +Synchronous form of `glob()`. + +Alias: `glob.sync()` + +## `globIterate(pattern: string | string[], options?: GlobOptions) => AsyncGenerator` + +Return an async iterator for walking glob pattern matches. + +Alias: `glob.iterate()` + +## `globIterateSync(pattern: string | string[], options?: GlobOptions) => Generator` + +Return a sync iterator for walking glob pattern matches. + +Alias: `glob.iterate.sync()`, `glob.sync.iterate()` + +## `globStream(pattern: string | string[], options?: GlobOptions) => Minipass` + +Return a stream that emits all the strings or `Path` objects and +then emits `end` when completed. + +Alias: `glob.stream()` + +## `globStreamSync(pattern: string | string[], options?: GlobOptions) => Minipass` + +Syncronous form of `globStream()`. Will read all the matches as +fast as you consume them, even all in a single tick if you +consume them immediately, but will still respond to backpressure +if they're not consumed immediately. + +Alias: `glob.stream.sync()`, `glob.sync.stream()` + +## `hasMagic(pattern: string | string[], options?: GlobOptions) => boolean` + +Returns `true` if the provided pattern contains any "magic" glob +characters, given the options provided. + +Brace expansion is not considered "magic" unless the +`magicalBraces` option is set, as brace expansion just turns one +string into an array of strings. So a pattern like `'x{a,b}y'` +would return `false`, because `'xay'` and `'xby'` both do not +contain any magic glob characters, and it's treated the same as +if you had called it on `['xay', 'xby']`. When +`magicalBraces:true` is in the options, brace expansion _is_ +treated as a pattern having magic. + +## `escape(pattern: string, options?: GlobOptions) => string` + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +## `unescape(pattern: string, options?: GlobOptions) => string` + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +## Class `Glob` + +An object that can perform glob pattern traversals. + +### `const g = new Glob(pattern: string | string[], options: GlobOptions)` + +Options object is required. + +See full options descriptions below. + +> [!NOTE] +> A previous `Glob` object can be passed as the +> `GlobOptions` to another `Glob` instantiation to re-use settings +> and caches with a new pattern. + +Traversal functions can be called multiple times to run the walk +again. + +### `g.stream()` + +Stream results asynchronously. + +### `g.streamSync()` + +Stream results synchronously. + +### `g.iterate()` + +Default async iteration function. Returns an AsyncGenerator that +iterates over the results. + +### `g.iterateSync()` + +Default sync iteration function. Returns a Generator that +iterates over the results. + +### `g.walk()` + +Returns a Promise that resolves to the results array. + +### `g.walkSync()` + +Returns a results array. + +### Properties + +All options are stored as properties on the `Glob` object. + +- `opts` The options provided to the constructor. +- `patterns` An array of parsed immutable `Pattern` objects. + +## Options + +Exported as `GlobOptions` TypeScript interface. A `GlobOptions` +object may be provided to any of the exported methods, and must +be provided to the `Glob` constructor. + +All options are optional, boolean, and false by default, unless +otherwise noted. + +All resolved options are added to the Glob object as properties. + +If you are running many `glob` operations, you can pass a Glob +object as the `options` argument to a subsequent operation to +share the previously loaded cache. + +- `cwd` String path or `file://` string or URL object. The + current working directory in which to search. Defaults to + `process.cwd()`. See also: "Windows, CWDs, Drive Letters, and + UNC Paths", below. + + This option may be either a string path or a `file://` URL + object or string. + +- `root` A string path resolved against the `cwd` option, which + is used as the starting point for absolute patterns that start + with `/`, (but not drive letters or UNC paths on Windows). + + To start absolute and non-absolute patterns in the same path, + you can use `{root:''}`. However, be aware that on Windows + systems, a pattern like `x:/*` or `//host/share/*` will + _always_ start in the `x:/` or `//host/share` directory, + regardless of the `root` setting. + +> [!NOTE] This _doesn't_ necessarily limit the walk to the +> `root` directory, and doesn't affect the cwd starting point +> for non-absolute patterns. A pattern containing `..` will +> still be able to traverse out of the root directory, if it +> is not an actual root directory on the filesystem, and any +> non-absolute patterns will be matched in the `cwd`. For +> example, the pattern `/../*` with `{root:'/some/path'}` +> will return all files in `/some`, not all files in +> `/some/path`. The pattern `*` with `{root:'/some/path'}` +> will return all the entries in the cwd, not the entries in +> `/some/path`. + +- `windowsPathsNoEscape` Use `\\` as a path separator _only_, and + _never_ as an escape character. If set, all `\\` characters are + replaced with `/` in the pattern. + +> [!NOTE] +> This makes it **impossible** to match against paths +> containing literal glob pattern characters, but allows matching +> with patterns constructed using `path.join()` and +> `path.resolve()` on Windows platforms, mimicking the (buggy!) +> behavior of Glob v7 and before on Windows. Please use with +> caution, and be mindful of [the caveat below about Windows +> paths](#windows). (For legacy reasons, this is also set if +> `allowWindowsEscape` is set to the exact value `false`.) + +- `dot` Include `.dot` files in normal matches and `globstar` + matches. Note that an explicit dot in a portion of the pattern + will always match dot files. + +- `magicalBraces` Treat brace expansion like `{a,b}` as a "magic" + pattern. Has no effect if {@link nobrace} is set. + + Only has effect on the {@link hasMagic} function, no effect on + glob pattern matching itself. + +- `dotRelative` Prepend all relative path strings with `./` (or + `.\` on Windows). + + Without this option, returned relative paths are "bare", so + instead of returning `'./foo/bar'`, they are returned as + `'foo/bar'`. + + Relative patterns starting with `'../'` are not prepended with + `./`, even if this option is set. + +- `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. + +- `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. + +- `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) + +- `noext` Do not match "extglob" patterns such as `+(a|b)`. + +- `nocase` Perform a case-insensitive match. This defaults to + `true` on macOS and Windows systems, and `false` on all others. + +> [!NOTE] +> `nocase` should only be explicitly set when it is +> known that the filesystem's case sensitivity differs from the +> platform default. If set `true` on case-sensitive file +> systems, or `false` on case-insensitive file systems, then the +> walk may return more or less results than expected. + +- `maxDepth` Specify a number to limit the depth of the directory + traversal to this many levels below the `cwd`. + +- `matchBase` Perform a basename-only match if the pattern does + not contain any slash characters. That is, `*.js` would be + treated as equivalent to `**/*.js`, matching all js files in + all directories. + +- `nodir` Do not match directories, only files. (Note: to match + _only_ directories, put a `/` at the end of the pattern.) + +> [!NOTE] +> When `follow` and `nodir` are both set, then symbolic +> links to directories are also omitted. + +- `stat` Call `lstat()` on all entries, whether required or not + to determine whether it's a valid match. When used with + `withFileTypes`, this means that matches will include data such + as modified time, permissions, and so on. Note that this will + incur a performance cost due to the added system calls. + +- `ignore` string or string[], or an object with `ignored` and + `childrenIgnored` methods. + + If a string or string[] is provided, then this is treated as + a glob pattern or array of glob patterns to exclude from + matches. To ignore all children within a directory, as well + as the entry itself, append `'/**'` to the ignore pattern. + + If an object is provided that has `ignored(path)` and/or + `childrenIgnored(path)` methods, then these methods will be + called to determine whether any Path is a match or if its + children should be traversed, respectively. + + The `path` argument to the methods will be a + [`path-scurry`](https://isaacs.github.io/path-scurry/index.html) + [`Path`](https://isaacs.github.io/path-scurry/classes/PathBase) + object, which extends + [`fs.Dirent`](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent) + with additional useful methods like + [`.fullpath()`](https://isaacs.github.io/path-scurry/classes/PathBase.html#fullpath), + [`.relative()`](https://isaacs.github.io/path-scurry/classes/PathBase.html#relative), + and more. + +> [!NOTE] +> `ignore` patterns are _always_ in `dot:true` mode, +> regardless of any other settings. + +- `follow` Follow symlinked directories when expanding `**` + patterns. This can result in a lot of duplicate references in + the presence of cyclic links, and make performance quite bad. + + By default, a `**` in a pattern will follow 1 symbolic link if + it is not the first item in the pattern, or none if it is the + first item in the pattern, following the same behavior as Bash. + +> [!NOTE] +> When `follow` and `nodir` are both set, then symbolic +> links to directories are also omitted. + +- `realpath` Set to true to call `fs.realpath` on all of the + results. In the case of an entry that cannot be resolved, the + entry is omitted. This incurs a slight performance penalty, of + course, because of the added system calls. + +- `absolute` Set to true to always receive absolute paths for + matched files. Set to `false` to always receive relative paths + for matched files. + + By default, when this option is not set, absolute paths are + returned for patterns that are absolute, and otherwise paths + are returned that are relative to the `cwd` setting. + + This does _not_ make an extra system call to get the realpath, + it only does string path resolution. + + `absolute` may not be used along with `withFileTypes`. + +- `posix` Set to true to use `/` as the path separator in + returned results. On POSIX systems, this has no effect. On + Windows systems, this will return `/` delimited path results, + and absolute paths will be returned in their fully resolved UNC + path form, e.g. instead of `'C:\\foo\\bar'`, it will return + `//?/C:/foo/bar`. + +- `platform` Defaults to the value of `process.platform` if + available, or `'linux'` if not. Setting `platform:'win32'` on + non-Windows systems may cause strange behavior. + +- `withFileTypes` Return + [`path-scurry`](http://npm.im/path-scurry) + [`Path`](https://isaacs.github.io/path-scurry/classes/PathBase.html) + objects instead of strings. These are similar to a NodeJS + `fs.Dirent` object, but with additional methods and properties. + + `withFileTypes` may not be used along with `absolute`. + +- `signal` An AbortSignal which will cancel the Glob walk when + triggered. + +- `fs` An override object to pass in custom filesystem methods. + See [`path-scurry` + docs](https://isaacs.github.io/path-scurry/interfaces/FSOption.html) + for what can be overridden. + +- `scurry` A + [`PathScurry`](https://isaacs.github.io/path-scurry/classes/PathScurryBase.html) + object used to traverse the file system. If the `nocase` option + is set explicitly, then any provided `scurry` object must match + this setting. + +- `includeChildMatches` boolean, default `true`. Do not match any + children of any matches. For example, the pattern `**\/foo` + would match `a/foo`, but not `a/foo/b/foo` in this mode. + + This is especially useful for cases like "find all + `node_modules` folders, but not the ones in `node_modules`". + + In order to support this, the `Ignore` implementation must + support an `add(pattern: string)` method. If using the default + `Ignore` class, then this is fine, but if this is set to + `false`, and a custom `Ignore` is provided that does not have + an `add()` method, then it will throw an error. + + For example: + + ```js + const results = await glob( + [ + // likely to match first, since it's just a stat + 'a/b/c/d/e/f', + + // this pattern is more complicated! It must to various readdir() + // calls and test the results against a regular expression, and that + // is certainly going to take a little bit longer. + // + // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + // late to ignore a/b/c/d/e/f, because it's already been emitted. + 'a/[bdf]/?/[a-z]/*', + ], + { includeChildMatches: false }, + ) + ``` + + It's best to only set this to `false` if you can be reasonably + sure that no components of the pattern will potentially match + one another's file system descendants, or if the occasional + included child entry will not cause problems. + +> [!NOTE] +> It _only_ ignores matches that would be a descendant +> of a previous match, and only if that descendant is matched +> _after_ the ancestor is encountered. Since the file system walk +> happens in indeterminate order, it's possible that a match will +> already be added before its ancestor, if multiple or braced +> patterns are used. + + +## Glob Primer + +Much more information about glob pattern expansion can be found +by running `man bash` and searching for `Pattern Matching`. + +"Globs" are the patterns you type when you do stuff like `ls +*.js` on the command line, or put `build/*` in a `.gitignore` +file. + +Before parsing the path part patterns, braced sections are +expanded into a set. Braced sections start with `{` and end with +`}`, with 2 or more comma-delimited sections within. Braced +sections may contain slash characters, so `a{/b/c,bcd}` would +expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in +a path portion. With the exception of `**`, none of these match +path separators (ie, `/` on all platforms, and `\` on Windows). + +- `*` Matches 0 or more characters in a single path portion. + When alone in a path portion, it must match at least 1 + character. If `dot:true` is not specified, then `*` will not + match against a `.` character at the start of a path portion. +- `?` Matches 1 character. If `dot:true` is not specified, then + `?` will not match against a `.` character at the start of a + path portion. +- `[...]` Matches a range of characters, similar to a RegExp + range. If the first character of the range is `!` or `^` then + it matches any character not in the range. If the first + character is `]`, then it will be considered the same as `\]`, + rather than the end of the character class. +- `!(pattern|pattern|pattern)` Matches anything that does not + match any of the patterns provided. May _not_ contain `/` + characters. Similar to `*`, if alone in a path portion, then + the path portion must have at least one character. +- `?(pattern|pattern|pattern)` Matches zero or one occurrence of + the patterns provided. May _not_ contain `/` characters. +- `+(pattern|pattern|pattern)` Matches one or more occurrences of + the patterns provided. May _not_ contain `/` characters. +- `*(a|b|c)` Matches zero or more occurrences of the patterns + provided. May _not_ contain `/` characters. +- `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided. May _not_ contain `/` characters. +- `**` If a "globstar" is alone in a path portion, then it + matches zero or more directories and subdirectories searching + for matches. It does not crawl symlinked directories, unless + `{follow:true}` is passed in the options object. A pattern + like `a/b/**` will only match `a/b` if it is a directory. + Follows 1 symbolic link if not the first item in the pattern, + or 0 if it is the first item, unless `follow:true` is set, in + which case it follows all symbolic links. + +`[:class:]` patterns are supported by this implementation, but +`[=c=]` and `[.symbol.]` style class patterns are not. + +### Dots + +If a file or directory path portion has a `.` as the first +character, then it will not match any glob pattern unless that +pattern's corresponding path part also has a `.` as its first +character. + +For example, the pattern `a/.*/c` would match the file at +`a/.b/c`. However the pattern `a/*/c` would not, because `*` does +not start with a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has +no slashes in it, then it will seek for any file anywhere in the +tree with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. +This differs from the shell, where the pattern itself is +returned. For example: + +```sh +$ echo a*s*d*f +a*s*d*f +``` + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between node-glob and +other implementations, and are intentional. + +The double-star character `**` is supported by default, unless +the `noglobstar` flag is set. This is supported in the manner of +bsdglob and bash 5, where `**` only has special significance if +it is the only thing in a path part. That is, `a/**/b` will match +`a/x/y/b`, but `a/**b` will not. + +> [!NOTE] +> Symlinked directories are not traversed as part of a +> `**`, though their contents may match against subsequent portions +> of the pattern. This prevents infinite loops and duplicates and +> the like. You can force glob to traverse symlinks with `**` by +> setting `{follow:true}` in the options. + +There is no equivalent of the `nonull` option. A pattern that +does not find any matches simply resolves to nothing. (An empty +array, immediately ended stream, etc.) + +If brace expansion is not disabled, then it is performed before +any other interpretation of the glob pattern. Thus, a pattern +like `+(a|{b),c)}`, which would not be valid in bash or zsh, is +expanded **first** into the set of `+(a|b)` and `+(a|c)`, and +those patterns are checked for validity. Since those two are +valid, matching proceeds. + +The character class patterns `[:class:]` (POSIX standard named +classes) style class patterns are supported and Unicode-aware, +but `[=c=]` (locale-specific character collation weight), and +`[.symbol.]` (collating symbol), are not. + +### Repeated Slashes + +Unlike Bash and zsh, repeated `/` are always coalesced into a +single path separator. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if +it started with a `#` character, or a "negated" pattern if it +started with a `!` character. + +These options were deprecated in version 5, and removed in +version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though Windows uses either `/` or `\` as its path separator, only +`/` characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will +always be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto +the root setting using `path.join`. On Windows, this will by +default result in `/foo/*` matching `C:\foo\bar.txt`. + +To automatically coerce all `\` characters to `/` in pattern +strings, **thus making it impossible to escape literal glob +characters**, you may set the `windowsPathsNoEscape` option to +`true`. + +### Windows, CWDs, Drive Letters, and UNC Paths + +On POSIX systems, when a pattern starts with `/`, any `cwd` +option is ignored, and the traversal starts at `/`, plus any +non-magic path portions specified in the pattern. + +On Windows systems, the behavior is similar, but the concept of +an "absolute path" is somewhat more involved. + +#### UNC Paths + +A UNC path may be used as the start of a pattern on Windows +platforms. For example, a pattern like: `//?/x:/*` will return +all file entries in the root of the `x:` drive. A pattern like +`//ComputerName/Share/*` will return all files in the associated +share. + +UNC path roots are always compared case insensitively. + +#### Drive Letters + +A pattern starting with a drive letter, like `c:/*`, will search +in that drive, regardless of any `cwd` option provided. + +If the pattern starts with `/`, and is not a UNC path, and there +is an explicit `cwd` option set with a drive letter, then the +drive letter in the `cwd` is used as the root of the directory +traversal. + +For example, `glob('/tmp', { cwd: 'c:/any/thing' })` will return +`['c:/tmp']` as the result. + +If an explicit `cwd` option is not provided, and the pattern +starts with `/`, then the traversal will run on the root of the +drive provided as the `cwd` option. (That is, it is the result of +`path.resolve('/')`.) + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race +conditions, since it relies on directory walking. + +As a result, it is possible that a file that exists when glob +looks for it may have been deleted or modified by the time it +returns the result. + +By design, this implementation caches all readdir calls that it +makes, in order to cut down on system overhead. However, this +also makes it even more susceptible to races, especially if the +cache object is reused between glob calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast +majority of operations, this is never a problem. + +### See Also: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` +- [minimatch documentation](https://github.com/isaacs/minimatch) + +## Glob Logo + +Glob's logo was created by [Tanya +Brassie](http://tanyabrassie.com/). Logo files can be found +[here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons +Attribution-ShareAlike 4.0 International +License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a +test. + +Patches that fail tests or reduce performance will be rejected. + +```sh +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# run the benchmarks +npm run bench + +# to profile javascript +npm run prof +``` + +## Comparison to Other JavaScript Glob Implementations + +**tl;dr** + +- If you want glob matching that is as faithful as possible to + Bash pattern expansion semantics, and as fast as possible + within that constraint, _use this module_. +- If you are reasonably sure that the patterns you will encounter + are relatively simple, and want the absolutely fastest glob + matcher out there, _use [fast-glob](http://npm.im/fast-glob)_. +- If you are reasonably sure that the patterns you will encounter + are relatively simple, and want the convenience of + automatically respecting `.gitignore` files, _use + [globby](http://npm.im/globby)_. + +There are some other glob matcher libraries on npm, but these +three are (in my opinion, as of 2023) the best. + +--- + +**full explanation** + +Every library reflects a set of opinions and priorities in the +trade-offs it makes. Other than this library, I can personally +recommend both [globby](http://npm.im/globby) and +[fast-glob](http://npm.im/fast-glob), though they differ in their +benefits and drawbacks. + +Both have very nice APIs and are reasonably fast. + +`fast-glob` is, as far as I am aware, the fastest glob +implementation in JavaScript today. However, there are many +cases where the choices that `fast-glob` makes in pursuit of +speed mean that its results differ from the results returned by +Bash and other sh-like shells, which may be surprising. + +In my testing, `fast-glob` is around 10-20% faster than this +module when walking over 200k files nested 4 directories +deep[1](#fn-webscale). However, there are some inconsistencies +with Bash matching behavior that this module does not suffer +from: + +- `**` only matches files, not directories +- `..` path portions are not handled unless they appear at the + start of the pattern +- `./!()` will not match any files that _start_ with + ``, even if they do not match ``. For + example, `!(9).txt` will not match `9999.txt`. +- Some brace patterns in the middle of a pattern will result in + failing to find certain matches. +- Extglob patterns are allowed to contain `/` characters. + +Globby exhibits all of the same pattern semantics as fast-glob, +(as it is a wrapper around fast-glob) and is slightly slower than +node-glob (by about 10-20% in the benchmark test set, or in other +words, anywhere from 20-50% slower than fast-glob). However, it +adds some API conveniences that may be worth the costs. + +- Support for `.gitignore` and other ignore files. +- Support for negated globs (ie, patterns starting with `!` + rather than using a separate `ignore` option). + +The priority of this module is "correctness" in the sense of +performing a glob pattern expansion as faithfully as possible to +the behavior of Bash and other sh-like shells, with as much speed +as possible. + +> [!NOTE] +> Prior versions of `node-glob` are _not_ on this list. +> Former versions of this module are far too slow for any cases +> where performance matters at all, and were designed with APIs +> that are extremely dated by current JavaScript standards. + +--- + +[1]: In the cases where this module +returns results and `fast-glob` doesn't, it's even faster, of +course. + +![lumpy space princess saying 'oh my GLOB'](https://github.com/isaacs/node-glob/raw/main/oh-my-glob.gif) + +### Benchmark Results + +The first number is time, smaller is better. + +The second number is the count of results returned. + +``` +--- pattern: '**' --- +~~ sync ~~ +node fast-glob sync 0m0.598s 200364 +node globby sync 0m0.765s 200364 +node current globSync mjs 0m0.683s 222656 +node current glob syncStream 0m0.649s 222656 +~~ async ~~ +node fast-glob async 0m0.350s 200364 +node globby async 0m0.509s 200364 +node current glob async mjs 0m0.463s 222656 +node current glob stream 0m0.411s 222656 + +--- pattern: '**/..' --- +~~ sync ~~ +node fast-glob sync 0m0.486s 0 +node globby sync 0m0.769s 200364 +node current globSync mjs 0m0.564s 2242 +node current glob syncStream 0m0.583s 2242 +~~ async ~~ +node fast-glob async 0m0.283s 0 +node globby async 0m0.512s 200364 +node current glob async mjs 0m0.299s 2242 +node current glob stream 0m0.312s 2242 + +--- pattern: './**/0/**/0/**/0/**/0/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.490s 10 +node globby sync 0m0.517s 10 +node current globSync mjs 0m0.540s 10 +node current glob syncStream 0m0.550s 10 +~~ async ~~ +node fast-glob async 0m0.290s 10 +node globby async 0m0.296s 10 +node current glob async mjs 0m0.278s 10 +node current glob stream 0m0.302s 10 + +--- pattern: './**/[01]/**/[12]/**/[23]/**/[45]/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.500s 160 +node globby sync 0m0.528s 160 +node current globSync mjs 0m0.556s 160 +node current glob syncStream 0m0.573s 160 +~~ async ~~ +node fast-glob async 0m0.283s 160 +node globby async 0m0.301s 160 +node current glob async mjs 0m0.306s 160 +node current glob stream 0m0.322s 160 + +--- pattern: './**/0/**/0/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.502s 5230 +node globby sync 0m0.527s 5230 +node current globSync mjs 0m0.544s 5230 +node current glob syncStream 0m0.557s 5230 +~~ async ~~ +node fast-glob async 0m0.285s 5230 +node globby async 0m0.305s 5230 +node current glob async mjs 0m0.304s 5230 +node current glob stream 0m0.310s 5230 + +--- pattern: '**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.580s 200023 +node globby sync 0m0.771s 200023 +node current globSync mjs 0m0.685s 200023 +node current glob syncStream 0m0.649s 200023 +~~ async ~~ +node fast-glob async 0m0.349s 200023 +node globby async 0m0.509s 200023 +node current glob async mjs 0m0.427s 200023 +node current glob stream 0m0.388s 200023 + +--- pattern: '{**/*.txt,**/?/**/*.txt,**/?/**/?/**/*.txt,**/?/**/?/**/?/**/*.txt,**/?/**/?/**/?/**/?/**/*.txt}' --- +~~ sync ~~ +node fast-glob sync 0m0.589s 200023 +node globby sync 0m0.771s 200023 +node current globSync mjs 0m0.716s 200023 +node current glob syncStream 0m0.684s 200023 +~~ async ~~ +node fast-glob async 0m0.351s 200023 +node globby async 0m0.518s 200023 +node current glob async mjs 0m0.462s 200023 +node current glob stream 0m0.468s 200023 + +--- pattern: '**/5555/0000/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.496s 1000 +node globby sync 0m0.519s 1000 +node current globSync mjs 0m0.539s 1000 +node current glob syncStream 0m0.567s 1000 +~~ async ~~ +node fast-glob async 0m0.285s 1000 +node globby async 0m0.299s 1000 +node current glob async mjs 0m0.305s 1000 +node current glob stream 0m0.301s 1000 + +--- pattern: './**/0/**/../[01]/**/0/../**/0/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.484s 0 +node globby sync 0m0.507s 0 +node current globSync mjs 0m0.577s 4880 +node current glob syncStream 0m0.586s 4880 +~~ async ~~ +node fast-glob async 0m0.280s 0 +node globby async 0m0.298s 0 +node current glob async mjs 0m0.327s 4880 +node current glob stream 0m0.324s 4880 + +--- pattern: '**/????/????/????/????/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.547s 100000 +node globby sync 0m0.673s 100000 +node current globSync mjs 0m0.626s 100000 +node current glob syncStream 0m0.618s 100000 +~~ async ~~ +node fast-glob async 0m0.315s 100000 +node globby async 0m0.414s 100000 +node current glob async mjs 0m0.366s 100000 +node current glob stream 0m0.345s 100000 + +--- pattern: './{**/?{/**/?{/**/?{/**/?,,,,},,,,},,,,},,,}/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.588s 100000 +node globby sync 0m0.670s 100000 +node current globSync mjs 0m0.717s 200023 +node current glob syncStream 0m0.687s 200023 +~~ async ~~ +node fast-glob async 0m0.343s 100000 +node globby async 0m0.418s 100000 +node current glob async mjs 0m0.519s 200023 +node current glob stream 0m0.451s 200023 + +--- pattern: '**/!(0|9).txt' --- +~~ sync ~~ +node fast-glob sync 0m0.573s 160023 +node globby sync 0m0.731s 160023 +node current globSync mjs 0m0.680s 180023 +node current glob syncStream 0m0.659s 180023 +~~ async ~~ +node fast-glob async 0m0.345s 160023 +node globby async 0m0.476s 160023 +node current glob async mjs 0m0.427s 180023 +node current glob stream 0m0.388s 180023 + +--- pattern: './{*/**/../{*/**/../{*/**/../{*/**/../{*/**,,,,},,,,},,,,},,,,},,,,}/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.483s 0 +node globby sync 0m0.512s 0 +node current globSync mjs 0m0.811s 200023 +node current glob syncStream 0m0.773s 200023 +~~ async ~~ +node fast-glob async 0m0.280s 0 +node globby async 0m0.299s 0 +node current glob async mjs 0m0.617s 200023 +node current glob stream 0m0.568s 200023 + +--- pattern: './*/**/../*/**/../*/**/../*/**/../*/**/../*/**/../*/**/../*/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.485s 0 +node globby sync 0m0.507s 0 +node current globSync mjs 0m0.759s 200023 +node current glob syncStream 0m0.740s 200023 +~~ async ~~ +node fast-glob async 0m0.281s 0 +node globby async 0m0.297s 0 +node current glob async mjs 0m0.544s 200023 +node current glob stream 0m0.464s 200023 + +--- pattern: './*/**/../*/**/../*/**/../*/**/../*/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.486s 0 +node globby sync 0m0.513s 0 +node current globSync mjs 0m0.734s 200023 +node current glob syncStream 0m0.696s 200023 +~~ async ~~ +node fast-glob async 0m0.286s 0 +node globby async 0m0.296s 0 +node current glob async mjs 0m0.506s 200023 +node current glob stream 0m0.483s 200023 + +--- pattern: './0/**/../1/**/../2/**/../3/**/../4/**/../5/**/../6/**/../7/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.060s 0 +node globby sync 0m0.074s 0 +node current globSync mjs 0m0.067s 0 +node current glob syncStream 0m0.066s 0 +~~ async ~~ +node fast-glob async 0m0.060s 0 +node globby async 0m0.075s 0 +node current glob async mjs 0m0.066s 0 +node current glob stream 0m0.067s 0 + +--- pattern: './**/?/**/?/**/?/**/?/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.568s 100000 +node globby sync 0m0.651s 100000 +node current globSync mjs 0m0.619s 100000 +node current glob syncStream 0m0.617s 100000 +~~ async ~~ +node fast-glob async 0m0.332s 100000 +node globby async 0m0.409s 100000 +node current glob async mjs 0m0.372s 100000 +node current glob stream 0m0.351s 100000 + +--- pattern: '**/*/**/*/**/*/**/*/**' --- +~~ sync ~~ +node fast-glob sync 0m0.603s 200113 +node globby sync 0m0.798s 200113 +node current globSync mjs 0m0.730s 222137 +node current glob syncStream 0m0.693s 222137 +~~ async ~~ +node fast-glob async 0m0.356s 200113 +node globby async 0m0.525s 200113 +node current glob async mjs 0m0.508s 222137 +node current glob stream 0m0.455s 222137 + +--- pattern: './**/*/**/*/**/*/**/*/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.622s 200000 +node globby sync 0m0.792s 200000 +node current globSync mjs 0m0.722s 200000 +node current glob syncStream 0m0.695s 200000 +~~ async ~~ +node fast-glob async 0m0.369s 200000 +node globby async 0m0.527s 200000 +node current glob async mjs 0m0.502s 200000 +node current glob stream 0m0.481s 200000 + +--- pattern: '**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.588s 200023 +node globby sync 0m0.771s 200023 +node current globSync mjs 0m0.684s 200023 +node current glob syncStream 0m0.658s 200023 +~~ async ~~ +node fast-glob async 0m0.352s 200023 +node globby async 0m0.516s 200023 +node current glob async mjs 0m0.432s 200023 +node current glob stream 0m0.384s 200023 + +--- pattern: './**/**/**/**/**/**/**/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.589s 200023 +node globby sync 0m0.766s 200023 +node current globSync mjs 0m0.682s 200023 +node current glob syncStream 0m0.652s 200023 +~~ async ~~ +node fast-glob async 0m0.352s 200023 +node globby async 0m0.523s 200023 +node current glob async mjs 0m0.436s 200023 +node current glob stream 0m0.380s 200023 + +--- pattern: '**/*/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.592s 200023 +node globby sync 0m0.776s 200023 +node current globSync mjs 0m0.691s 200023 +node current glob syncStream 0m0.659s 200023 +~~ async ~~ +node fast-glob async 0m0.357s 200023 +node globby async 0m0.513s 200023 +node current glob async mjs 0m0.471s 200023 +node current glob stream 0m0.424s 200023 + +--- pattern: '**/*/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.585s 200023 +node globby sync 0m0.766s 200023 +node current globSync mjs 0m0.694s 200023 +node current glob syncStream 0m0.664s 200023 +~~ async ~~ +node fast-glob async 0m0.350s 200023 +node globby async 0m0.514s 200023 +node current glob async mjs 0m0.472s 200023 +node current glob stream 0m0.424s 200023 + +--- pattern: '**/[0-9]/**/*.txt' --- +~~ sync ~~ +node fast-glob sync 0m0.544s 100000 +node globby sync 0m0.636s 100000 +node current globSync mjs 0m0.626s 100000 +node current glob syncStream 0m0.621s 100000 +~~ async ~~ +node fast-glob async 0m0.322s 100000 +node globby async 0m0.404s 100000 +node current glob async mjs 0m0.360s 100000 +node current glob stream 0m0.352s 100000 +``` diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..314ad1f5ccd3ccdadff2f3cc5bba5136db5a0d03 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts @@ -0,0 +1,388 @@ +import { Minimatch } from 'minimatch'; +import { Minipass } from 'minipass'; +import { FSOption, Path, PathScurry } from 'path-scurry'; +import { IgnoreLike } from './ignore.js'; +import { Pattern } from './pattern.js'; +export type MatchSet = Minimatch['set']; +export type GlobParts = Exclude; +/** + * A `GlobOptions` object may be provided to any of the exported methods, and + * must be provided to the `Glob` constructor. + * + * All options are optional, boolean, and false by default, unless otherwise + * noted. + * + * All resolved options are added to the Glob object as properties. + * + * If you are running many `glob` operations, you can pass a Glob object as the + * `options` argument to a subsequent operation to share the previously loaded + * cache. + */ +export interface GlobOptions { + /** + * Set to `true` to always receive absolute paths for + * matched files. Set to `false` to always return relative paths. + * + * When this option is not set, absolute paths are returned for patterns + * that are absolute, and otherwise paths are returned that are relative + * to the `cwd` setting. + * + * This does _not_ make an extra system call to get + * the realpath, it only does string path resolution. + * + * Conflicts with {@link withFileTypes} + */ + absolute?: boolean; + /** + * Set to false to enable {@link windowsPathsNoEscape} + * + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * The current working directory in which to search. Defaults to + * `process.cwd()`. + * + * May be eiher a string path or a `file://` URL object or string. + */ + cwd?: string | URL; + /** + * Include `.dot` files in normal matches and `globstar` + * matches. Note that an explicit dot in a portion of the pattern + * will always match dot files. + */ + dot?: boolean; + /** + * Prepend all relative path strings with `./` (or `.\` on Windows). + * + * Without this option, returned relative paths are "bare", so instead of + * returning `'./foo/bar'`, they are returned as `'foo/bar'`. + * + * Relative patterns starting with `'../'` are not prepended with `./`, even + * if this option is set. + */ + dotRelative?: boolean; + /** + * Follow symlinked directories when expanding `**` + * patterns. This can result in a lot of duplicate references in + * the presence of cyclic links, and make performance quite bad. + * + * By default, a `**` in a pattern will follow 1 symbolic link if + * it is not the first item in the pattern, or none if it is the + * first item in the pattern, following the same behavior as Bash. + */ + follow?: boolean; + /** + * string or string[], or an object with `ignored` and `childrenIgnored` + * methods. + * + * If a string or string[] is provided, then this is treated as a glob + * pattern or array of glob patterns to exclude from matches. To ignore all + * children within a directory, as well as the entry itself, append `'/**'` + * to the ignore pattern. + * + * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of + * any other settings. + * + * If an object is provided that has `ignored(path)` and/or + * `childrenIgnored(path)` methods, then these methods will be called to + * determine whether any Path is a match or if its children should be + * traversed, respectively. + */ + ignore?: string | string[] | IgnoreLike; + /** + * Treat brace expansion like `{a,b}` as a "magic" pattern. Has no + * effect if {@link nobrace} is set. + * + * Only has effect on the {@link hasMagic} function. + */ + magicalBraces?: boolean; + /** + * Add a `/` character to directory matches. Note that this requires + * additional stat calls in some cases. + */ + mark?: boolean; + /** + * Perform a basename-only match if the pattern does not contain any slash + * characters. That is, `*.js` would be treated as equivalent to + * `**\/*.js`, matching all js files in all directories. + */ + matchBase?: boolean; + /** + * Limit the directory traversal to a given depth below the cwd. + * Note that this does NOT prevent traversal to sibling folders, + * root patterns, and so on. It only limits the maximum folder depth + * that the walk will descend, relative to the cwd. + */ + maxDepth?: number; + /** + * Do not expand `{a,b}` and `{1..3}` brace sets. + */ + nobrace?: boolean; + /** + * Perform a case-insensitive match. This defaults to `true` on macOS and + * Windows systems, and `false` on all others. + * + * **Note** `nocase` should only be explicitly set when it is + * known that the filesystem's case sensitivity differs from the + * platform default. If set `true` on case-sensitive file + * systems, or `false` on case-insensitive file systems, then the + * walk may return more or less results than expected. + */ + nocase?: boolean; + /** + * Do not match directories, only files. (Note: to match + * _only_ directories, put a `/` at the end of the pattern.) + */ + nodir?: boolean; + /** + * Do not match "extglob" patterns such as `+(a|b)`. + */ + noext?: boolean; + /** + * Do not match `**` against multiple filenames. (Ie, treat it as a normal + * `*` instead.) + * + * Conflicts with {@link matchBase} + */ + noglobstar?: boolean; + /** + * Defaults to value of `process.platform` if available, or `'linux'` if + * not. Setting `platform:'win32'` on non-Windows systems may cause strange + * behavior. + */ + platform?: NodeJS.Platform; + /** + * Set to true to call `fs.realpath` on all of the + * results. In the case of an entry that cannot be resolved, the + * entry is omitted. This incurs a slight performance penalty, of + * course, because of the added system calls. + */ + realpath?: boolean; + /** + * + * A string path resolved against the `cwd` option, which + * is used as the starting point for absolute patterns that start + * with `/`, (but not drive letters or UNC paths on Windows). + * + * Note that this _doesn't_ necessarily limit the walk to the + * `root` directory, and doesn't affect the cwd starting point for + * non-absolute patterns. A pattern containing `..` will still be + * able to traverse out of the root directory, if it is not an + * actual root directory on the filesystem, and any non-absolute + * patterns will be matched in the `cwd`. For example, the + * pattern `/../*` with `{root:'/some/path'}` will return all + * files in `/some`, not all files in `/some/path`. The pattern + * `*` with `{root:'/some/path'}` will return all the entries in + * the cwd, not the entries in `/some/path`. + * + * To start absolute and non-absolute patterns in the same + * path, you can use `{root:''}`. However, be aware that on + * Windows systems, a pattern like `x:/*` or `//host/share/*` will + * _always_ start in the `x:/` or `//host/share` directory, + * regardless of the `root` setting. + */ + root?: string; + /** + * A [PathScurry](http://npm.im/path-scurry) object used + * to traverse the file system. If the `nocase` option is set + * explicitly, then any provided `scurry` object must match this + * setting. + */ + scurry?: PathScurry; + /** + * Call `lstat()` on all entries, whether required or not to determine + * if it's a valid match. When used with {@link withFileTypes}, this means + * that matches will include data such as modified time, permissions, and + * so on. Note that this will incur a performance cost due to the added + * system calls. + */ + stat?: boolean; + /** + * An AbortSignal which will cancel the Glob walk when + * triggered. + */ + signal?: AbortSignal; + /** + * Use `\\` as a path separator _only_, and + * _never_ as an escape character. If set, all `\\` characters are + * replaced with `/` in the pattern. + * + * Note that this makes it **impossible** to match against paths + * containing literal glob pattern characters, but allows matching + * with patterns constructed using `path.join()` and + * `path.resolve()` on Windows platforms, mimicking the (buggy!) + * behavior of Glob v7 and before on Windows. Please use with + * caution, and be mindful of [the caveat below about Windows + * paths](#windows). (For legacy reasons, this is also set if + * `allowWindowsEscape` is set to the exact value `false`.) + */ + windowsPathsNoEscape?: boolean; + /** + * Return [PathScurry](http://npm.im/path-scurry) + * `Path` objects instead of strings. These are similar to a + * NodeJS `Dirent` object, but with additional methods and + * properties. + * + * Conflicts with {@link absolute} + */ + withFileTypes?: boolean; + /** + * An fs implementation to override some or all of the defaults. See + * http://npm.im/path-scurry for details about what can be overridden. + */ + fs?: FSOption; + /** + * Just passed along to Minimatch. Note that this makes all pattern + * matching operations slower and *extremely* noisy. + */ + debug?: boolean; + /** + * Return `/` delimited paths, even on Windows. + * + * On posix systems, this has no effect. But, on Windows, it means that + * paths will be `/` delimited, and absolute paths will be their full + * resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return + * `'//?/C:/foo/bar'` + */ + posix?: boolean; + /** + * Do not match any children of any matches. For example, the pattern + * `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode. + * + * This is especially useful for cases like "find all `node_modules` + * folders, but not the ones in `node_modules`". + * + * In order to support this, the `Ignore` implementation must support an + * `add(pattern: string)` method. If using the default `Ignore` class, then + * this is fine, but if this is set to `false`, and a custom `Ignore` is + * provided that does not have an `add()` method, then it will throw an + * error. + * + * **Caveat** It *only* ignores matches that would be a descendant of a + * previous match, and only if that descendant is matched *after* the + * ancestor is encountered. Since the file system walk happens in + * indeterminate order, it's possible that a match will already be added + * before its ancestor, if multiple or braced patterns are used. + * + * For example: + * + * ```ts + * const results = await glob([ + * // likely to match first, since it's just a stat + * 'a/b/c/d/e/f', + * + * // this pattern is more complicated! It must to various readdir() + * // calls and test the results against a regular expression, and that + * // is certainly going to take a little bit longer. + * // + * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + * // late to ignore a/b/c/d/e/f, because it's already been emitted. + * 'a/[bdf]/?/[a-z]/*', + * ], { includeChildMatches: false }) + * ``` + * + * It's best to only set this to `false` if you can be reasonably sure that + * no components of the pattern will potentially match one another's file + * system descendants, or if the occasional included child entry will not + * cause problems. + * + * @default true + */ + includeChildMatches?: boolean; +} +export type GlobOptionsWithFileTypesTrue = GlobOptions & { + withFileTypes: true; + absolute?: undefined; + mark?: undefined; + posix?: undefined; +}; +export type GlobOptionsWithFileTypesFalse = GlobOptions & { + withFileTypes?: false; +}; +export type GlobOptionsWithFileTypesUnset = GlobOptions & { + withFileTypes?: undefined; +}; +export type Result = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path; +export type Results = Result[]; +export type FileTypes = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean; +/** + * An object that can perform glob pattern traversals. + */ +export declare class Glob implements GlobOptions { + absolute?: boolean; + cwd: string; + root?: string; + dot: boolean; + dotRelative: boolean; + follow: boolean; + ignore?: string | string[] | IgnoreLike; + magicalBraces: boolean; + mark?: boolean; + matchBase: boolean; + maxDepth: number; + nobrace: boolean; + nocase: boolean; + nodir: boolean; + noext: boolean; + noglobstar: boolean; + pattern: string[]; + platform: NodeJS.Platform; + realpath: boolean; + scurry: PathScurry; + stat: boolean; + signal?: AbortSignal; + windowsPathsNoEscape: boolean; + withFileTypes: FileTypes; + includeChildMatches: boolean; + /** + * The options provided to the constructor. + */ + opts: Opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns: Pattern[]; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern: string | string[], opts: Opts); + /** + * Returns a Promise that resolves to the results array. + */ + walk(): Promise>; + /** + * synchronous {@link Glob.walk} + */ + walkSync(): Results; + /** + * Stream results asynchronously. + */ + stream(): Minipass, Result>; + /** + * Stream results synchronously. + */ + streamSync(): Minipass, Result>; + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync(): Generator, void, void>; + [Symbol.iterator](): Generator, void, void>; + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate(): AsyncGenerator, void, void>; + [Symbol.asyncIterator](): AsyncGenerator, void, void>; +} +//# sourceMappingURL=glob.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c32dc74c96774177b949cc137befa0edb6489e3f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAA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,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js new file mode 100644 index 0000000000000000000000000000000000000000..e1339bbbcf57f3b158e89ff7c5fb8e21a6179c25 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js @@ -0,0 +1,247 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Glob = void 0; +const minimatch_1 = require("minimatch"); +const node_url_1 = require("node:url"); +const path_scurry_1 = require("path-scurry"); +const pattern_js_1 = require("./pattern.js"); +const walker_js_1 = require("./walker.js"); +// if no process global, just call it linux. +// so we default to case-sensitive, / separators +const defaultPlatform = (typeof process === 'object' && + process && + typeof process.platform === 'string') ? + process.platform + : 'linux'; +/** + * An object that can perform glob pattern traversals. + */ +class Glob { + absolute; + cwd; + root; + dot; + dotRelative; + follow; + ignore; + magicalBraces; + mark; + matchBase; + maxDepth; + nobrace; + nocase; + nodir; + noext; + noglobstar; + pattern; + platform; + realpath; + scurry; + stat; + signal; + windowsPathsNoEscape; + withFileTypes; + includeChildMatches; + /** + * The options provided to the constructor. + */ + opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern, opts) { + /* c8 ignore start */ + if (!opts) + throw new TypeError('glob options required'); + /* c8 ignore stop */ + this.withFileTypes = !!opts.withFileTypes; + this.signal = opts.signal; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.dotRelative = !!opts.dotRelative; + this.nodir = !!opts.nodir; + this.mark = !!opts.mark; + if (!opts.cwd) { + this.cwd = ''; + } + else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) { + opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd); + } + this.cwd = opts.cwd || ''; + this.root = opts.root; + this.magicalBraces = !!opts.magicalBraces; + this.nobrace = !!opts.nobrace; + this.noext = !!opts.noext; + this.realpath = !!opts.realpath; + this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; + this.noglobstar = !!opts.noglobstar; + this.matchBase = !!opts.matchBase; + this.maxDepth = + typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity; + this.stat = !!opts.stat; + this.ignore = opts.ignore; + if (this.withFileTypes && this.absolute !== undefined) { + throw new Error('cannot set absolute and withFileTypes:true'); + } + if (typeof pattern === 'string') { + pattern = [pattern]; + } + this.windowsPathsNoEscape = + !!opts.windowsPathsNoEscape || + opts.allowWindowsEscape === + false; + if (this.windowsPathsNoEscape) { + pattern = pattern.map(p => p.replace(/\\/g, '/')); + } + if (this.matchBase) { + if (opts.noglobstar) { + throw new TypeError('base matching requires globstar'); + } + pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`)); + } + this.pattern = pattern; + this.platform = opts.platform || defaultPlatform; + this.opts = { ...opts, platform: this.platform }; + if (opts.scurry) { + this.scurry = opts.scurry; + if (opts.nocase !== undefined && + opts.nocase !== opts.scurry.nocase) { + throw new Error('nocase option contradicts provided scurry option'); + } + } + else { + const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32 + : opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin + : opts.platform ? path_scurry_1.PathScurryPosix + : path_scurry_1.PathScurry; + this.scurry = new Scurry(this.cwd, { + nocase: opts.nocase, + fs: opts.fs, + }); + } + this.nocase = this.scurry.nocase; + // If you do nocase:true on a case-sensitive file system, then + // we need to use regexps instead of strings for non-magic + // path portions, because statting `aBc` won't return results + // for the file `AbC` for example. + const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32'; + const mmo = { + // default nocase based on platform + ...opts, + dot: this.dot, + matchBase: this.matchBase, + nobrace: this.nobrace, + nocase: this.nocase, + nocaseMagicOnly, + nocomment: true, + noext: this.noext, + nonegate: true, + optimizationLevel: 2, + platform: this.platform, + windowsPathsNoEscape: this.windowsPathsNoEscape, + debug: !!this.opts.debug, + }; + const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo)); + const [matchSet, globParts] = mms.reduce((set, m) => { + set[0].push(...m.set); + set[1].push(...m.globParts); + return set; + }, [[], []]); + this.patterns = matchSet.map((set, i) => { + const g = globParts[i]; + /* c8 ignore start */ + if (!g) + throw new Error('invalid pattern object'); + /* c8 ignore stop */ + return new pattern_js_1.Pattern(set, g, 0, this.platform); + }); + } + async walk() { + // Walkers always return array of Path objects, so we just have to + // coerce them into the right shape. It will have already called + // realpath() if the option was set to do so, so we know that's cached. + // start out knowing the cwd, at least + return [ + ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).walk()), + ]; + } + walkSync() { + return [ + ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).walkSync(), + ]; + } + stream() { + return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).stream(); + } + streamSync() { + return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).streamSync(); + } + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync() { + return this.streamSync()[Symbol.iterator](); + } + [Symbol.iterator]() { + return this.iterateSync(); + } + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate() { + return this.stream()[Symbol.asyncIterator](); + } + [Symbol.asyncIterator]() { + return this.iterate(); + } +} +exports.Glob = Glob; +//# sourceMappingURL=glob.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js.map new file mode 100644 index 0000000000000000000000000000000000000000..551a9fc24f5b56c9f828a778fdca098cf0d5e352 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/glob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAEvD,uCAAwC;AACxC,6CAOoB;AAEpB,6CAAsC;AACtC,2CAAoD;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAyVX;;GAEG;AACH,MAAa,IAAI;IACf,QAAQ,CAAU;IAClB,GAAG,CAAQ;IACX,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,MAAM,CAAiC;IACvC,aAAa,CAAS;IACtB,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,QAAQ,CAAQ;IAChB,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,KAAK,CAAS;IACd,UAAU,CAA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M;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF;AA7QD,oBA6QC","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignored` and `childrenIgnored`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8aec3bd9725175d9c72be14476fea2a117ca8b09 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts @@ -0,0 +1,14 @@ +import { GlobOptions } from './glob.js'; +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean; +//# sourceMappingURL=has-magic.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e2f7e449672a5f671e82090a226ded1ccad56c1d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js new file mode 100644 index 0000000000000000000000000000000000000000..0918bd57e0f1c2af51957ade7288a1fd75c7e23d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasMagic = void 0; +const minimatch_1 = require("minimatch"); +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +const hasMagic = (pattern, options = {}) => { + if (!Array.isArray(pattern)) { + pattern = [pattern]; + } + for (const p of pattern) { + if (new minimatch_1.Minimatch(p, options).hasMagic()) + return true; + } + return false; +}; +exports.hasMagic = hasMagic; +//# sourceMappingURL=has-magic.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js.map new file mode 100644 index 0000000000000000000000000000000000000000..44deab290582768bc18722a0f6cf0d4b03312097 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/has-magic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1893b16df877c9b50c071ee7b066715f6e58c43e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts @@ -0,0 +1,24 @@ +import { Minimatch, MinimatchOptions } from 'minimatch'; +import { Path } from 'path-scurry'; +import { GlobWalkerOpts } from './walker.js'; +export interface IgnoreLike { + ignored?: (p: Path) => boolean; + childrenIgnored?: (p: Path) => boolean; + add?: (ignore: string) => void; +} +/** + * Class used to process ignored patterns + */ +export declare class Ignore implements IgnoreLike { + relative: Minimatch[]; + relativeChildren: Minimatch[]; + absolute: Minimatch[]; + absoluteChildren: Minimatch[]; + platform: NodeJS.Platform; + mmopts: MinimatchOptions; + constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts); + add(ign: string): void; + ignored(p: Path): boolean; + childrenIgnored(p: Path): boolean; +} +//# sourceMappingURL=ignore.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..57d6ab6153d770397a5acb7881ccf52a048dee89 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js new file mode 100644 index 0000000000000000000000000000000000000000..5f1fde0680dea3736262381efa776c7f8268a70d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js @@ -0,0 +1,119 @@ +"use strict"; +// give it a pattern, and it'll be able to tell you if +// a given path should be ignored. +// Ignoring a path ignores its children if the pattern ends in /** +// Ignores are always parsed in dot:true mode +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Ignore = void 0; +const minimatch_1 = require("minimatch"); +const pattern_js_1 = require("./pattern.js"); +const defaultPlatform = (typeof process === 'object' && + process && + typeof process.platform === 'string') ? + process.platform + : 'linux'; +/** + * Class used to process ignored patterns + */ +class Ignore { + relative; + relativeChildren; + absolute; + absoluteChildren; + platform; + mmopts; + constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { + this.relative = []; + this.absolute = []; + this.relativeChildren = []; + this.absoluteChildren = []; + this.platform = platform; + this.mmopts = { + dot: true, + nobrace, + nocase, + noext, + noglobstar, + optimizationLevel: 2, + platform, + nocomment: true, + nonegate: true, + }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { + // this is a little weird, but it gives us a clean set of optimized + // minimatch matchers, without getting tripped up if one of them + // ends in /** inside a brace section, and it's only inefficient at + // the start of the walk, not along it. + // It'd be nice if the Pattern class just had a .test() method, but + // handling globstars is a bit of a pita, and that code already lives + // in minimatch anyway. + // Another way would be if maybe Minimatch could take its set/globParts + // as an option, and then we could at least just use Pattern to test + // for absolute-ness. + // Yet another way, Minimatch could take an array of glob strings, and + // a cwd option, and do the right thing. + const mm = new minimatch_1.Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); + const m = new minimatch_1.Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { + if (absolute) + this.absoluteChildren.push(m); + else + this.relativeChildren.push(m); + } + } + } + ignored(p) { + const fullpath = p.fullpath(); + const fullpaths = `${fullpath}/`; + const relative = p.relative() || '.'; + const relatives = `${relative}/`; + for (const m of this.relative) { + if (m.match(relative) || m.match(relatives)) + return true; + } + for (const m of this.absolute) { + if (m.match(fullpath) || m.match(fullpaths)) + return true; + } + return false; + } + childrenIgnored(p) { + const fullpath = p.fullpath() + '/'; + const relative = (p.relative() || '.') + '/'; + for (const m of this.relativeChildren) { + if (m.match(relative)) + return true; + } + for (const m of this.absoluteChildren) { + if (m.match(fullpath)) + return true; + } + return false; + } +} +exports.Ignore = Ignore; +//# sourceMappingURL=ignore.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js.map new file mode 100644 index 0000000000000000000000000000000000000000..d9dfdfa34ab5c0e734952abd3c8070f804efcb1f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/ignore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;;;AAE7C,yCAAuD;AAEvD,6CAAsC;AAStC,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAEX;;GAEG;AACH,MAAa,MAAM;IACjB,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAC7B,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAC7B,QAAQ,CAAiB;IACzB,MAAM,CAAkB;IAExB,YACE,OAAiB,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAAQ,GAAG,eAAe,GACX;QAEjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC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C,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;QAC1D,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,eAAe,CAAC,CAAO;QACrB,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAA;QACnC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAvGD,wBAuGC","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n platform: NodeJS.Platform\n mmopts: MinimatchOptions\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts,\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n this.platform = platform\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n for (const ign of ignored) this.add(ign)\n }\n\n add(ign: string) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new Minimatch(ign, this.mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, this.platform)\n const m = new Minimatch(p.globString(), this.mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb09bfb64acb34985b08e658882181a3fff9bd38 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts @@ -0,0 +1,97 @@ +import { Minipass } from 'minipass'; +import { Path } from 'path-scurry'; +import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js'; +import { Glob } from './glob.js'; +export { escape, unescape } from 'minimatch'; +export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry'; +export { Glob } from './glob.js'; +export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; +export type { IgnoreLike } from './ignore.js'; +export type { MatchStream } from './walker.js'; +/** + * Syncronous form of {@link globStream}. Will read all the matches as fast as + * you consume them, even all in a single tick if you consume them immediately, + * but will still respond to backpressure if they're not consumed immediately. + */ +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass | Minipass; +/** + * Return a stream that emits all the strings or `Path` objects and + * then emits `end` when completed. + */ +export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; +export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; +export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass; +export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass | Minipass; +/** + * Synchronous form of {@link glob} + */ +export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[]; +export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[]; +export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[]; +export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[]; +/** + * Perform an asynchronous glob search for the pattern(s) specified. Returns + * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the + * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for + * full option descriptions. + */ +declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise; +declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise; +declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise; +declare function glob_(pattern: string | string[], options: GlobOptions): Promise; +/** + * Return a sync iterator for walking glob pattern matches. + */ +export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator | Generator; +/** + * Return an async iterator for walking glob pattern matches. + */ +export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator | AsyncGenerator; +export declare const streamSync: typeof globStreamSync; +export declare const stream: typeof globStream & { + sync: typeof globStreamSync; +}; +export declare const iterateSync: typeof globIterateSync; +export declare const iterate: typeof globIterate & { + sync: typeof globIterateSync; +}; +export declare const sync: typeof globSync & { + stream: typeof globStreamSync; + iterate: typeof globIterateSync; +}; +export declare const glob: typeof glob_ & { + glob: typeof glob_; + globSync: typeof globSync; + sync: typeof globSync & { + stream: typeof globStreamSync; + iterate: typeof globIterateSync; + }; + globStream: typeof globStream; + stream: typeof globStream & { + sync: typeof globStreamSync; + }; + globStreamSync: typeof globStreamSync; + streamSync: typeof globStreamSync; + globIterate: typeof globIterate; + iterate: typeof globIterate & { + sync: typeof globIterateSync; + }; + globIterateSync: typeof globIterateSync; + iterateSync: typeof globIterateSync; + Glob: typeof Glob; + hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5fb32252b63747526a971d82bf6ab2ee61b53631 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;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SAAS,GAClD,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACnC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,GACnB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..151495d170efa2ddefa9d40819abf488999f7037 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0; +exports.globStreamSync = globStreamSync; +exports.globStream = globStream; +exports.globSync = globSync; +exports.globIterateSync = globIterateSync; +exports.globIterate = globIterate; +const minimatch_1 = require("minimatch"); +const glob_js_1 = require("./glob.js"); +const has_magic_js_1 = require("./has-magic.js"); +var minimatch_2 = require("minimatch"); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); +Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); +var glob_js_2 = require("./glob.js"); +Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); +var has_magic_js_2 = require("./has-magic.js"); +Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); +var ignore_js_1 = require("./ignore.js"); +Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } }); +function globStreamSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).streamSync(); +} +function globStream(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).stream(); +} +function globSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).walkSync(); +} +async function glob_(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).walk(); +} +function globIterateSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).iterateSync(); +} +function globIterate(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).iterate(); +} +// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc +exports.streamSync = globStreamSync; +exports.stream = Object.assign(globStream, { sync: globStreamSync }); +exports.iterateSync = globIterateSync; +exports.iterate = Object.assign(globIterate, { + sync: globIterateSync, +}); +exports.sync = Object.assign(globSync, { + stream: globStreamSync, + iterate: globIterateSync, +}); +exports.glob = Object.assign(glob_, { + glob: glob_, + globSync, + sync: exports.sync, + globStream, + stream: exports.stream, + globStreamSync, + streamSync: exports.streamSync, + globIterate, + iterate: exports.iterate, + globIterateSync, + iterateSync: exports.iterateSync, + Glob: glob_js_1.Glob, + hasMagic: has_magic_js_1.hasMagic, + escape: minimatch_1.escape, + unescape: minimatch_1.unescape, +}); +exports.glob.glob = exports.glob; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e648b1d01939bc921393d446606768c86edfba71 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAqDA,wCAKC;AAsBD,gCAKC;AAqBD,4BAKC;AAkDD,0CAKC;AAqBD,kCAKC;AAhMD,yCAA4C;AAS5C,uCAAgC;AAChC,iDAAyC;AAEzC,uCAA4C;AAAnC,mGAAA,MAAM,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAQzB,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAOb,+CAAyC;AAAhC,wGAAA,QAAQ,OAAA;AACjB,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AAyBf,SAAgB,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AAsBD,SAAgB,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AAqBD,SAAgB,QAAQ,CACtB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC9C,CAAC;AAwBD,KAAK,UAAU,KAAK,CAClB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,C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import { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions,\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions,\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9636df3b54df2912790cdb6d4551c3ebe6e4d42e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts @@ -0,0 +1,76 @@ +import { GLOBSTAR } from 'minimatch'; +export type MMPattern = string | RegExp | typeof GLOBSTAR; +export type PatternList = [p: MMPattern, ...rest: MMPattern[]]; +export type UNCPatternList = [ + p0: '', + p1: '', + p2: string, + p3: string, + ...rest: MMPattern[] +]; +export type DrivePatternList = [p0: string, ...rest: MMPattern[]]; +export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]; +export type GlobList = [p: string, ...rest: string[]]; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +export declare class Pattern { + #private; + readonly length: number; + constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform); + /** + * The first entry in the parsed list of patterns + */ + pattern(): MMPattern; + /** + * true of if pattern() returns a string + */ + isString(): boolean; + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar(): boolean; + /** + * true if pattern() returns a regexp + */ + isRegExp(): boolean; + /** + * The /-joined set of glob parts that make up this pattern + */ + globString(): string; + /** + * true if there are more pattern parts after this one + */ + hasMore(): boolean; + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest(): Pattern | null; + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC(): boolean; + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive(): boolean; + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute(): boolean; + /** + * consume the root of the pattern, and return it + */ + root(): string; + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar(): boolean; + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar(): boolean; +} +//# sourceMappingURL=pattern.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cdf322346317d8a12efa4c8fa613b693d2bf8bbe --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.d.ts.map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;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..f0de35fb5bed9d89d2dd3cecae31704b9153234b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js @@ -0,0 +1,219 @@ +"use strict"; +// this is just a very light wrapper around 2 arrays with an offset index +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Pattern = void 0; +const minimatch_1 = require("minimatch"); +const isPatternList = (pl) => pl.length >= 1; +const isGlobList = (gl) => gl.length >= 1; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +class Pattern { + #patternList; + #globList; + #index; + length; + #platform; + #rest; + #globString; + #isDrive; + #isUNC; + #isAbsolute; + #followGlobstar = true; + constructor(patternList, globList, index, platform) { + if (!isPatternList(patternList)) { + throw new TypeError('empty pattern list'); + } + if (!isGlobList(globList)) { + throw new TypeError('empty glob list'); + } + if (globList.length !== patternList.length) { + throw new TypeError('mismatched pattern list and glob list lengths'); + } + this.length = patternList.length; + if (index < 0 || index >= this.length) { + throw new TypeError('index out of range'); + } + this.#patternList = patternList; + this.#globList = globList; + this.#index = index; + this.#platform = platform; + // normalize root entries of absolute patterns on initial creation. + if (this.#index === 0) { + // c: => ['c:/'] + // C:/ => ['C:/'] + // C:/x => ['C:/', 'x'] + // //host/share => ['//host/share/'] + // //host/share/ => ['//host/share/'] + // //host/share/x => ['//host/share/', 'x'] + // /etc => ['/', 'etc'] + // / => ['/'] + if (this.isUNC()) { + // '' / '' / 'host' / 'share' + const [p0, p1, p2, p3, ...prest] = this.#patternList; + const [g0, g1, g2, g3, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = [p0, p1, p2, p3, ''].join('/'); + const g = [g0, g1, g2, g3, ''].join('/'); + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + else if (this.isDrive() || this.isAbsolute()) { + const [p1, ...prest] = this.#patternList; + const [g1, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = p1 + '/'; + const g = g1 + '/'; + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + } + } + /** + * The first entry in the parsed list of patterns + */ + pattern() { + return this.#patternList[this.#index]; + } + /** + * true of if pattern() returns a string + */ + isString() { + return typeof this.#patternList[this.#index] === 'string'; + } + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar() { + return this.#patternList[this.#index] === minimatch_1.GLOBSTAR; + } + /** + * true if pattern() returns a regexp + */ + isRegExp() { + return this.#patternList[this.#index] instanceof RegExp; + } + /** + * The /-joined set of glob parts that make up this pattern + */ + globString() { + return (this.#globString = + this.#globString || + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') + : this.#globList.join('/') + : this.#globList.slice(this.#index).join('/'))); + } + /** + * true if there are more pattern parts after this one + */ + hasMore() { + return this.length > this.#index + 1; + } + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest() { + if (this.#rest !== undefined) + return this.#rest; + if (!this.hasMore()) + return (this.#rest = null); + this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform); + this.#rest.#isAbsolute = this.#isAbsolute; + this.#rest.#isUNC = this.#isUNC; + this.#rest.#isDrive = this.#isDrive; + return this.#rest; + } + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC() { + const pl = this.#patternList; + return this.#isUNC !== undefined ? + this.#isUNC + : (this.#isUNC = + this.#platform === 'win32' && + this.#index === 0 && + pl[0] === '' && + pl[1] === '' && + typeof pl[2] === 'string' && + !!pl[2] && + typeof pl[3] === 'string' && + !!pl[3]); + } + // pattern like C:/... + // split = ['C:', ...] + // XXX: would be nice to handle patterns like `c:*` to test the cwd + // in c: for *, but I don't know of a way to even figure out what that + // cwd is without actually chdir'ing into it? + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive() { + const pl = this.#patternList; + return this.#isDrive !== undefined ? + this.#isDrive + : (this.#isDrive = + this.#platform === 'win32' && + this.#index === 0 && + this.length > 1 && + typeof pl[0] === 'string' && + /^[a-z]:$/i.test(pl[0])); + } + // pattern = '/' or '/...' or '/x/...' + // split = ['', ''] or ['', ...] or ['', 'x', ...] + // Drive and UNC both considered absolute on windows + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute() { + const pl = this.#patternList; + return this.#isAbsolute !== undefined ? + this.#isAbsolute + : (this.#isAbsolute = + (pl[0] === '' && pl.length > 1) || + this.isDrive() || + this.isUNC()); + } + /** + * consume the root of the pattern, and return it + */ + root() { + const p = this.#patternList[0]; + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p + : ''; + } + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar() { + return !(this.#index === 0 || + !this.isGlobstar() || + !this.#followGlobstar); + } + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar() { + if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar) + return false; + this.#followGlobstar = false; + return true; + } +} +exports.Pattern = Pattern; +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js.map new file mode 100644 index 0000000000000000000000000000000000000000..fc10ea5d6c4ef4d274e2e1b73171f38beebab3e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAAA,yEAAyE;;;AAEzE,yCAAoC;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE;;;GAGG;AACH,MAAa,OAAO;IACT,YAAY,CAAa;IACzB,SAAS,CAAU;IACnB,MAAM,CAAQ;IACd,MAAM,CAAQ;IACd,SAAS,CAAiB;IACnC,KAAK,CAAiB;IACtB,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,WAAW,CAAU;IACrB,eAAe,GAAY,IAAI,CAAA;IAE/B,YACE,WAAwB,EACxB,QAAkB,EAClB,KAAa,EACb,QAAyB;QAEzB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;QAChC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CA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;QAC5B,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC;YACnC,IAAI,CAAC,WAAW;YAClB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW;gBACf,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArOD,0BAqOC","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccedfbf2820f7d51167574666a80785ca1b91b07 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.d.ts @@ -0,0 +1,59 @@ +import { MMRegExp } from 'minimatch'; +import { Path } from 'path-scurry'; +import { Pattern } from './pattern.js'; +import { GlobWalkerOpts } from './walker.js'; +/** + * A cache of which patterns have been processed for a given Path + */ +export declare class HasWalkedCache { + store: Map>; + constructor(store?: Map>); + copy(): HasWalkedCache; + hasWalked(target: Path, pattern: Pattern): boolean | undefined; + storeWalked(target: Path, pattern: Pattern): void; +} +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +export declare class MatchRecord { + store: Map; + add(target: Path, absolute: boolean, ifDir: boolean): void; + entries(): [Path, boolean, boolean][]; +} +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +export declare class SubWalks { + store: Map; + add(target: Path, pattern: Pattern): void; + get(target: Path): Pattern[]; + entries(): [Path, Pattern[]][]; + keys(): Path[]; +} +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +export declare class Processor { + hasWalkedCache: HasWalkedCache; + matches: MatchRecord; + subwalks: SubWalks; + patterns?: Pattern[]; + follow: boolean; + dot: boolean; + opts: GlobWalkerOpts; + constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache); + processPatterns(target: Path, patterns: Pattern[]): this; + subwalkTargets(): Path[]; + child(): Processor; + filterEntries(parent: Path, entries: Path[]): Processor; + testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void; + testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void; + testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void; +} +//# sourceMappingURL=processor.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..aa266fee4a0544a0a8f7fddceb347d7d059643e0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.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c,CAAA;IAC9B,OAAO,cAAoB;IAC3B,QAAQ,WAAiB;IACzB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,cAAc,CAAA;gBAER,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,cAAc;IAQjE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;IAmGjD,cAAc,IAAI,IAAI,EAAE;IAIxB,KAAK;IAQL,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,UAAU,CACR,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,QAAQ,EACX,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAUnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js new file mode 100644 index 0000000000000000000000000000000000000000..ee3bb4397e0b2d3aaff9b1e2053ac13a2af9f31b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js @@ -0,0 +1,301 @@ +"use strict"; +// synchronous utility for filtering entries and calculating subwalks +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0; +const minimatch_1 = require("minimatch"); +/** + * A cache of which patterns have been processed for a given Path + */ +class HasWalkedCache { + store; + constructor(store = new Map()) { + this.store = store; + } + copy() { + return new HasWalkedCache(new Map(this.store)); + } + hasWalked(target, pattern) { + return this.store.get(target.fullpath())?.has(pattern.globString()); + } + storeWalked(target, pattern) { + const fullpath = target.fullpath(); + const cached = this.store.get(fullpath); + if (cached) + cached.add(pattern.globString()); + else + this.store.set(fullpath, new Set([pattern.globString()])); + } +} +exports.HasWalkedCache = HasWalkedCache; +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +class MatchRecord { + store = new Map(); + add(target, absolute, ifDir) { + const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const current = this.store.get(target); + this.store.set(target, current === undefined ? n : n & current); + } + // match, absolute, ifdir + entries() { + return [...this.store.entries()].map(([path, n]) => [ + path, + !!(n & 2), + !!(n & 1), + ]); + } +} +exports.MatchRecord = MatchRecord; +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +class SubWalks { + store = new Map(); + add(target, pattern) { + if (!target.canReaddir()) { + return; + } + const subs = this.store.get(target); + if (subs) { + if (!subs.find(p => p.globString() === pattern.globString())) { + subs.push(pattern); + } + } + else + this.store.set(target, [pattern]); + } + get(target) { + const subs = this.store.get(target); + /* c8 ignore start */ + if (!subs) { + throw new Error('attempting to walk unknown path'); + } + /* c8 ignore stop */ + return subs; + } + entries() { + return this.keys().map(k => [k, this.store.get(k)]); + } + keys() { + return [...this.store.keys()].filter(t => t.canReaddir()); + } +} +exports.SubWalks = SubWalks; +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +class Processor { + hasWalkedCache; + matches = new MatchRecord(); + subwalks = new SubWalks(); + patterns; + follow; + dot; + opts; + constructor(opts, hasWalkedCache) { + this.opts = opts; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); + } + processPatterns(target, patterns) { + this.patterns = patterns; + const processingSet = patterns.map(p => [target, p]); + // map of paths to the magic-starting subwalks they need to walk + // first item in patterns is the filter + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root = pattern.root(); + const absolute = pattern.isAbsolute() && this.opts.absolute !== false; + // start absolute patterns at root + if (root) { + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root + : root); + const rest = pattern.rest(); + if (!rest) { + this.matches.add(t, true, false); + continue; + } + else { + pattern = rest; + } + } + if (t.isENOENT()) + continue; + let p; + let rest; + let changed = false; + while (typeof (p = pattern.pattern()) === 'string' && + (rest = pattern.rest())) { + const c = t.resolve(p); + t = c; + pattern = rest; + changed = true; + } + p = pattern.pattern(); + rest = pattern.rest(); + if (changed) { + if (this.hasWalkedCache.hasWalked(t, pattern)) + continue; + this.hasWalkedCache.storeWalked(t, pattern); + } + // now we have either a final string for a known entry, + // more strings for an unknown entry, + // or a pattern starting with magic, mounted on t. + if (typeof p === 'string') { + // must not be final entry, otherwise we would have + // concatenated it earlier. + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); + continue; + } + else if (p === minimatch_1.GLOBSTAR) { + // if no rest, match and subwalk pattern + // if rest, process rest and subwalk pattern + // if it's a symlink, but we didn't get here by way of a + // globstar match (meaning it's the first time THIS globstar + // has traversed a symlink), then we follow it. Otherwise, stop. + if (!t.isSymbolicLink() || + this.follow || + pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); + } + const rp = rest?.pattern(); + const rrest = rest?.rest(); + if (!rest || ((rp === '' || rp === '.') && !rrest)) { + // only HAS to be a dir if it ends in **/ or **/. + // but ending in ** will match files as well. + this.matches.add(t, absolute, rp === '' || rp === '.'); + } + else { + if (rp === '..') { + // this would mean you're matching **/.. at the fs root, + // and no thanks, I'm not gonna test that specific case. + /* c8 ignore start */ + const tp = t.parent || t; + /* c8 ignore stop */ + if (!rrest) + this.matches.add(tp, absolute, true); + else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { + this.subwalks.add(tp, rrest); + } + } + } + } + else if (p instanceof RegExp) { + this.subwalks.add(t, pattern); + } + } + return this; + } + subwalkTargets() { + return this.subwalks.keys(); + } + child() { + return new Processor(this.opts, this.hasWalkedCache); + } + // return a new Processor containing the subwalks for each + // child entry, and a set of matches, and + // a hasWalkedCache that's a copy of this one + // then we're going to call + filterEntries(parent, entries) { + const patterns = this.subwalks.get(parent); + // put matches and entry walks into the results processor + const results = this.child(); + for (const e of entries) { + for (const pattern of patterns) { + const absolute = pattern.isAbsolute(); + const p = pattern.pattern(); + const rest = pattern.rest(); + if (p === minimatch_1.GLOBSTAR) { + results.testGlobstar(e, pattern, rest, absolute); + } + else if (p instanceof RegExp) { + results.testRegExp(e, p, rest, absolute); + } + else { + results.testString(e, p, rest, absolute); + } + } + } + return results; + } + testGlobstar(e, pattern, rest, absolute) { + if (this.dot || !e.name.startsWith('.')) { + if (!pattern.hasMore()) { + this.matches.add(e, absolute, false); + } + if (e.canReaddir()) { + // if we're in follow mode or it's not a symlink, just keep + // testing the same pattern. If there's more after the globstar, + // then this symlink consumes the globstar. If not, then we can + // follow at most ONE symlink along the way, so we mark it, which + // also checks to ensure that it wasn't already marked. + if (this.follow || !e.isSymbolicLink()) { + this.subwalks.add(e, pattern); + } + else if (e.isSymbolicLink()) { + if (rest && pattern.checkFollowGlobstar()) { + this.subwalks.add(e, rest); + } + else if (pattern.markFollowGlobstar()) { + this.subwalks.add(e, pattern); + } + } + } + } + // if the NEXT thing matches this entry, then also add + // the rest. + if (rest) { + const rp = rest.pattern(); + if (typeof rp === 'string' && + // dots and empty were handled already + rp !== '..' && + rp !== '' && + rp !== '.') { + this.testString(e, rp, rest.rest(), absolute); + } + else if (rp === '..') { + /* c8 ignore start */ + const ep = e.parent || e; + /* c8 ignore stop */ + this.subwalks.add(ep, rest); + } + else if (rp instanceof RegExp) { + this.testRegExp(e, rp, rest.rest(), absolute); + } + } + } + testRegExp(e, p, rest, absolute) { + if (!p.test(e.name)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } + testString(e, p, rest, absolute) { + // should never happen? + if (!e.isNamed(p)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } +} +exports.Processor = Processor; +//# sourceMappingURL=processor.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js.map new file mode 100644 index 0000000000000000000000000000000000000000..58a70882e9462f7c0746a03edf0fe37e625230ce --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/processor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAErE,yCAA8C;AAK9C;;GAEG;AACH,MAAa,cAAc;IACzB,KAAK,CAA0B;IAC/B,YAAY,QAAkC,IAAI,GAAG,EAAE;QACrD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IACD,IAAI;QACF,OAAO,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,CAAC;IACD,SAAS,CAAC,MAAY,EAAE,OAAgB;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,WAAW,CAAC,MAAY,EAAE,OAAgB;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,UA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AAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF;AA9ND,8BA8NC","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n store: Map>\n constructor(store: Map> = new Map()) {\n this.store = store\n }\n copy() {\n return new HasWalkedCache(new Map(this.store))\n }\n hasWalked(target: Path, pattern: Pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.store.get(fullpath)\n if (cached) cached.add(pattern.globString())\n else this.store.set(fullpath, new Set([pattern.globString()]))\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n store: Map = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n // match, absolute, ifdir\n entries(): [Path, boolean, boolean][] {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ])\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root,\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testRegExp(\n e: Path,\n p: MMRegExp,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (!p.test(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..499c8f4933857a8720e77b7b96d9842bbd3248ae --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts @@ -0,0 +1,97 @@ +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +import { Minipass } from 'minipass'; +import { Path } from 'path-scurry'; +import { IgnoreLike } from './ignore.js'; +import { Pattern } from './pattern.js'; +import { Processor } from './processor.js'; +export interface GlobWalkerOpts { + absolute?: boolean; + allowWindowsEscape?: boolean; + cwd?: string | URL; + dot?: boolean; + dotRelative?: boolean; + follow?: boolean; + ignore?: string | string[] | IgnoreLike; + mark?: boolean; + matchBase?: boolean; + maxDepth?: number; + nobrace?: boolean; + nocase?: boolean; + nodir?: boolean; + noext?: boolean; + noglobstar?: boolean; + platform?: NodeJS.Platform; + posix?: boolean; + realpath?: boolean; + root?: string; + stat?: boolean; + signal?: AbortSignal; + windowsPathsNoEscape?: boolean; + withFileTypes?: boolean; + includeChildMatches?: boolean; +} +export type GWOFileTypesTrue = GlobWalkerOpts & { + withFileTypes: true; +}; +export type GWOFileTypesFalse = GlobWalkerOpts & { + withFileTypes: false; +}; +export type GWOFileTypesUnset = GlobWalkerOpts & { + withFileTypes?: undefined; +}; +export type Result = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string; +export type Matches = O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; +export type MatchStream = Minipass, Result>; +/** + * basic walking utilities that all the glob walker types use + */ +export declare abstract class GlobUtil { + #private; + path: Path; + patterns: Pattern[]; + opts: O; + seen: Set; + paused: boolean; + aborted: boolean; + signal?: AbortSignal; + maxDepth: number; + includeChildMatches: boolean; + constructor(patterns: Pattern[], path: Path, opts: O); + pause(): void; + resume(): void; + onResume(fn: () => any): void; + matchCheck(e: Path, ifDir: boolean): Promise; + matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined; + matchCheckSync(e: Path, ifDir: boolean): Path | undefined; + abstract matchEmit(p: Result): void; + abstract matchEmit(p: string | Path): void; + matchFinish(e: Path, absolute: boolean): void; + match(e: Path, absolute: boolean, ifDir: boolean): Promise; + matchSync(e: Path, absolute: boolean, ifDir: boolean): void; + walkCB(target: Path, patterns: Pattern[], cb: () => any): void; + walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any; + walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void; + walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void; + walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any; + walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void; +} +export declare class GlobWalker extends GlobUtil { + matches: Set>; + constructor(patterns: Pattern[], path: Path, opts: O); + matchEmit(e: Result): void; + walk(): Promise>>; + walkSync(): Set>; +} +export declare class GlobStream extends GlobUtil { + results: Minipass, Result>; + constructor(patterns: Pattern[], path: Path, opts: O); + matchEmit(e: Result): void; + stream(): MatchStream; + streamSync(): MatchStream; +} +//# sourceMappingURL=walker.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..769957bd59bb1ce67cdf28134be59ca86946c405 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA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,IAAI,EACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,MAAM,GAAG;IAqCf,WAAW,CACT,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,IAAI,EAAE,EACf,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,MAAM,GAAG;CAoBhB;AAED,qBAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,iBAAuB;gBAElB,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAIpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAIvB,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAiBrC,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAW3B;AAED,qBAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBAE3B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAK7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js new file mode 100644 index 0000000000000000000000000000000000000000..cb15946d9a852cf8147b2c53f4021c796df36ef9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js @@ -0,0 +1,387 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +const minipass_1 = require("minipass"); +const ignore_js_1 = require("./ignore.js"); +const processor_js_1 = require("./processor.js"); +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts) + : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) + : ignore; +/** + * basic walking utilities that all the glob walker types use + */ +class GlobUtil { + path; + patterns; + opts; + seen = new Set(); + paused = false; + aborted = false; + #onResume = []; + #ignore; + #sep; + signal; + maxDepth; + includeChildMatches; + constructor(patterns, path, opts) { + this.patterns = patterns; + this.path = path; + this.opts = opts; + this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } + } + // ignore, always set with maxDepth, but it's optional on the + // GlobOptions type + /* c8 ignore start */ + this.maxDepth = opts.maxDepth || Infinity; + /* c8 ignore stop */ + if (opts.signal) { + this.signal = opts.signal; + this.signal.addEventListener('abort', () => { + this.#onResume.length = 0; + }); + } + } + #ignored(path) { + return this.seen.has(path) || !!this.#ignore?.ignored?.(path); + } + #childrenIgnored(path) { + return !!this.#ignore?.childrenIgnored?.(path); + } + // backpressure mechanism + pause() { + this.paused = true; + } + resume() { + /* c8 ignore start */ + if (this.signal?.aborted) + return; + /* c8 ignore stop */ + this.paused = false; + let fn = undefined; + while (!this.paused && (fn = this.#onResume.shift())) { + fn(); + } + } + onResume(fn) { + if (this.signal?.aborted) + return; + /* c8 ignore start */ + if (!this.paused) { + fn(); + } + else { + /* c8 ignore stop */ + this.#onResume.push(fn); + } + } + // do the requisite realpath/stat checking, and return the path + // to add or undefined to filter it out. + async matchCheck(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || (await e.realpath()); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + const s = needStat ? await e.lstat() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = await s.realpath(); + /* c8 ignore start */ + if (target && (target.isUnknown() || this.opts.stat)) { + await target.lstat(); + } + /* c8 ignore stop */ + } + return this.matchCheckTest(s, ifDir); + } + matchCheckTest(e, ifDir) { + return (e && + (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && + (!ifDir || e.canReaddir()) && + (!this.opts.nodir || !e.isDirectory()) && + (!this.opts.nodir || + !this.opts.follow || + !e.isSymbolicLink() || + !e.realpathCached()?.isDirectory()) && + !this.#ignored(e)) ? + e + : undefined; + } + matchCheckSync(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || e.realpathSync(); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + const s = needStat ? e.lstatSync() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = s.realpathSync(); + if (target && (target?.isUnknown() || this.opts.stat)) { + target.lstatSync(); + } + } + return this.matchCheckTest(s, ifDir); + } + matchFinish(e, absolute) { + if (this.#ignored(e)) + return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } + const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; + this.seen.add(e); + const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; + // ok, we have what we need! + if (this.opts.withFileTypes) { + this.matchEmit(e); + } + else if (abs) { + const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath(); + this.matchEmit(abs + mark); + } + else { + const rel = this.opts.posix ? e.relativePosix() : e.relative(); + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep + : ''; + this.matchEmit(!rel ? '.' + mark : pre + rel + mark); + } + } + async match(e, absolute, ifDir) { + const p = await this.matchCheck(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + matchSync(e, absolute, ifDir) { + const p = this.matchCheckSync(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + walkCB(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb); + } + walkCB2(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); + else { + t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true); + } + } + next(); + } + walkCB3(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2(target, patterns, processor.child(), next); + } + next(); + } + walkCBSync(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb); + } + walkCB2Sync(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const children = t.readdirSync(); + this.walkCB3Sync(t, children, processor, next); + } + next(); + } + walkCB3Sync(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2Sync(target, patterns, processor.child(), next); + } + next(); + } +} +exports.GlobUtil = GlobUtil; +class GlobWalker extends GlobUtil { + matches = new Set(); + constructor(patterns, path, opts) { + super(patterns, path, opts); + } + matchEmit(e) { + this.matches.add(e); + } + async walk() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + await this.path.lstat(); + } + await new Promise((res, rej) => { + this.walkCB(this.path, this.patterns, () => { + if (this.signal?.aborted) { + rej(this.signal.reason); + } + else { + res(this.matches); + } + }); + }); + return this.matches; + } + walkSync() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + // nothing for the callback to do, because this never pauses + this.walkCBSync(this.path, this.patterns, () => { + if (this.signal?.aborted) + throw this.signal.reason; + }); + return this.matches; + } +} +exports.GlobWalker = GlobWalker; +class GlobStream extends GlobUtil { + results; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.results = new minipass_1.Minipass({ + signal: this.signal, + objectMode: true, + }); + this.results.on('drain', () => this.resume()); + this.results.on('resume', () => this.resume()); + } + matchEmit(e) { + this.results.write(e); + if (!this.results.flowing) + this.pause(); + } + stream() { + const target = this.path; + if (target.isUnknown()) { + target.lstat().then(() => { + this.walkCB(target, this.patterns, () => this.results.end()); + }); + } + else { + this.walkCB(target, this.patterns, () => this.results.end()); + } + return this.results; + } + streamSync() { + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + this.walkCBSync(this.path, this.patterns, () => this.results.end()); + return this.results; + } +} +exports.GlobStream = GlobStream; +//# sourceMappingURL=walker.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js.map new file mode 100644 index 0000000000000000000000000000000000000000..49b013864d534bfba5b0357f69223f32f4ffd37b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/commonjs/walker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,uCAAmC;AAEnC,2CAAgD;AAQhD,iDAA0C;AA0D1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,CACd,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,kBAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IACvD,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,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ACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;QACvB,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AAvCD,gCAuCC","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n O extends GWOFileTypesTrue ? Path\n : O extends GWOFileTypesFalse ? string\n : O extends GWOFileTypesUnset ? string\n : Path | string\n\nexport type Matches =\n O extends GWOFileTypesTrue ? Set\n : O extends GWOFileTypesFalse ? Set\n : O extends GWOFileTypesUnset ? Set\n : Set\n\nexport type MatchStream = Minipass<\n Result,\n Result\n>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts,\n): IgnoreLike =>\n typeof ignore === 'string' ? new Ignore([ignore], opts)\n : Array.isArray(ignore) ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n includeChildMatches: boolean\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n this.includeChildMatches = opts.includeChildMatches !== false\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n if (\n !this.includeChildMatches &&\n typeof this.#ignore.add !== 'function'\n ) {\n const m = 'cannot ignore child matches, ignore lacks add() method.'\n throw new Error(m)\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return (\n e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ) ?\n e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`\n this.#ignore.add(ign)\n }\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true,\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb),\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n matches = new Set>()\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n }\n\n matchEmit(e: Result): void {\n this.matches.add(e)\n }\n\n async walk(): Promise>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Set> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n results: Minipass, Result>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass, Result>({\n signal: this.signal,\n objectMode: true,\n })\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..77298e477081756086e9db739440c9422f97e7ee --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=bin.d.mts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts.map new file mode 100644 index 0000000000000000000000000000000000000000..ec64bdda861bc9d0632eb010ac3a572aa8a5e50b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"bin.d.mts","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d4511ae0c3c17c740a81ae4cac62327162bd67eb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs @@ -0,0 +1,346 @@ +#!/usr/bin/env node +import { foregroundChild } from 'foreground-child'; +import { existsSync } from 'fs'; +import { jack } from 'jackspeak'; +import { loadPackageJson } from 'package-json-from-dist'; +import { basename, join } from 'path'; +import { globStream } from './index.js'; +const { version } = loadPackageJson(import.meta.url, '../package.json'); +const j = jack({ + usage: 'glob [options] [ [ ...]]', +}) + .description(` + Glob v${version} + + Expand the positional glob expression arguments into any matching file + system paths found. + `) + .opt({ + cmd: { + short: 'c', + hint: 'command', + description: `Run the command provided, passing the glob expression + matches as arguments.`, + }, +}) + .opt({ + default: { + short: 'p', + hint: 'pattern', + description: `If no positional arguments are provided, glob will use + this pattern`, + }, +}) + .flag({ + shell: { + default: false, + description: `Interpret the command as a shell command by passing it + to the shell, with all matched filesystem paths appended, + **even if this cannot be done safely**. + + This is **not** unsafe (and usually unnecessary) when using + the known Unix shells sh, bash, zsh, and fish, as these can + all be executed in such a way as to pass positional + arguments safely. + + **Note**: THIS IS UNSAFE IF THE FILE PATHS ARE UNTRUSTED, + because a path like \`'some/path/\\$\\(cmd)'\` will be + executed by the shell. + + If you do have positional arguments that you wish to pass to + the command ahead of the glob pattern matches, use the + \`--cmd-arg\`/\`-g\` option instead. + + The next major release of glob will fully remove the ability + to use this option unsafely.`, + }, +}) + .optList({ + 'cmd-arg': { + short: 'g', + hint: 'arg', + default: [], + description: `Pass the provided values to the supplied command, ahead of + the glob matches. + + For example, the command: + + glob -c echo -g"hello" -g"world" *.txt + + might output: + + hello world a.txt b.txt + + This is a safer (and future-proof) alternative than putting + positional arguments in the \`-c\`/\`--cmd\` option.`, + }, +}) + .flag({ + all: { + short: 'A', + description: `By default, the glob cli command will not expand any + arguments that are an exact match to a file on disk. + + This prevents double-expanding, in case the shell expands + an argument whose filename is a glob expression. + + For example, if 'app/*.ts' would match 'app/[id].ts', then + on Windows powershell or cmd.exe, 'glob app/*.ts' will + expand to 'app/[id].ts', as expected. However, in posix + shells such as bash or zsh, the shell will first expand + 'app/*.ts' to a list of filenames. Then glob will look + for a file matching 'app/[id].ts' (ie, 'app/i.ts' or + 'app/d.ts'), which is unexpected. + + Setting '--all' prevents this behavior, causing glob + to treat ALL patterns as glob expressions to be expanded, + even if they are an exact match to a file on disk. + + When setting this option, be sure to enquote arguments + so that the shell will not expand them prior to passing + them to the glob command process. + `, + }, + absolute: { + short: 'a', + description: 'Expand to absolute paths', + }, + 'dot-relative': { + short: 'd', + description: `Prepend './' on relative matches`, + }, + mark: { + short: 'm', + description: `Append a / on any directories matched`, + }, + posix: { + short: 'x', + description: `Always resolve to posix style paths, using '/' as the + directory separator, even on Windows. Drive letter + absolute matches on Windows will be expanded to their + full resolved UNC paths, eg instead of 'C:\\foo\\bar', + it will expand to '//?/C:/foo/bar'. + `, + }, + follow: { + short: 'f', + description: `Follow symlinked directories when expanding '**'`, + }, + realpath: { + short: 'R', + description: `Call 'fs.realpath' on all of the results. In the case + of an entry that cannot be resolved, the entry is + omitted. This incurs a slight performance penalty, of + course, because of the added system calls.`, + }, + stat: { + short: 's', + description: `Call 'fs.lstat' on all entries, whether required or not + to determine if it's a valid match.`, + }, + 'match-base': { + short: 'b', + description: `Perform a basename-only match if the pattern does not + contain any slash characters. That is, '*.js' would be + treated as equivalent to '**/*.js', matching js files + in all directories. + `, + }, + dot: { + description: `Allow patterns to match files/directories that start + with '.', even if the pattern does not start with '.' + `, + }, + nobrace: { + description: 'Do not expand {...} patterns', + }, + nocase: { + description: `Perform a case-insensitive match. This defaults to + 'true' on macOS and Windows platforms, and false on + all others. + + Note: 'nocase' should only be explicitly set when it is + known that the filesystem's case sensitivity differs + from the platform default. If set 'true' on + case-insensitive file systems, then the walk may return + more or less results than expected. + `, + }, + nodir: { + description: `Do not match directories, only files. + + Note: to *only* match directories, append a '/' at the + end of the pattern. + `, + }, + noext: { + description: `Do not expand extglob patterns, such as '+(a|b)'`, + }, + noglobstar: { + description: `Do not expand '**' against multiple path portions. + Ie, treat it as a normal '*' instead.`, + }, + 'windows-path-no-escape': { + description: `Use '\\' as a path separator *only*, and *never* as an + escape character. If set, all '\\' characters are + replaced with '/' in the pattern.`, + }, +}) + .num({ + 'max-depth': { + short: 'D', + description: `Maximum depth to traverse from the current + working directory`, + }, +}) + .opt({ + cwd: { + short: 'C', + description: 'Current working directory to execute/match in', + default: process.cwd(), + }, + root: { + short: 'r', + description: `A string path resolved against the 'cwd', which is + used as the starting point for absolute patterns that + start with '/' (but not drive letters or UNC paths + on Windows). + + Note that this *doesn't* necessarily limit the walk to + the 'root' directory, and doesn't affect the cwd + starting point for non-absolute patterns. A pattern + containing '..' will still be able to traverse out of + the root directory, if it is not an actual root directory + on the filesystem, and any non-absolute patterns will + still be matched in the 'cwd'. + + To start absolute and non-absolute patterns in the same + path, you can use '--root=' to set it to the empty + string. However, be aware that on Windows systems, a + pattern like 'x:/*' or '//host/share/*' will *always* + start in the 'x:/' or '//host/share/' directory, + regardless of the --root setting. + `, + }, + platform: { + description: `Defaults to the value of 'process.platform' if + available, or 'linux' if not. Setting --platform=win32 + on non-Windows systems may cause strange behavior!`, + validOptions: [ + 'aix', + 'android', + 'darwin', + 'freebsd', + 'haiku', + 'linux', + 'openbsd', + 'sunos', + 'win32', + 'cygwin', + 'netbsd', + ], + }, +}) + .optList({ + ignore: { + short: 'i', + description: `Glob patterns to ignore`, + }, +}) + .flag({ + debug: { + short: 'v', + description: `Output a huge amount of noisy debug information about + patterns as they are parsed and used to match files.`, + }, + version: { + short: 'V', + description: `Output the version (${version})`, + }, + help: { + short: 'h', + description: 'Show this usage information', + }, +}); +try { + const { positionals, values } = j.parse(); + const { cmd, shell, all, default: def, version: showVersion, help, absolute, cwd, dot, 'dot-relative': dotRelative, follow, ignore, 'match-base': matchBase, 'max-depth': maxDepth, mark, nobrace, nocase, nodir, noext, noglobstar, platform, realpath, root, stat, debug, posix, 'cmd-arg': cmdArg, } = values; + if (showVersion) { + console.log(version); + process.exit(0); + } + if (help) { + console.log(j.usage()); + process.exit(0); + } + //const { shell, help } = values + if (positionals.length === 0 && !def) + throw 'No patterns provided'; + if (positionals.length === 0 && def) + positionals.push(def); + const patterns = all ? positionals : positionals.filter(p => !existsSync(p)); + const matches = all ? [] : positionals.filter(p => existsSync(p)).map(p => join(p)); + const stream = globStream(patterns, { + absolute, + cwd, + dot, + dotRelative, + follow, + ignore, + mark, + matchBase, + maxDepth, + nobrace, + nocase, + nodir, + noext, + noglobstar, + platform: platform, + realpath, + root, + stat, + debug, + posix, + }); + if (!cmd) { + matches.forEach(m => console.log(m)); + stream.on('data', f => console.log(f)); + } + else { + cmdArg.push(...matches); + stream.on('data', f => cmdArg.push(f)); + // Attempt to support commands that contain spaces and otherwise require + // shell interpretation, but do NOT shell-interpret the arguments, to avoid + // injections via filenames. This affordance can only be done on known Unix + // shells, unfortunately. + // + // 'bash', ['-c', cmd + ' "$@"', 'bash', ...matches] + // 'zsh', ['-c', cmd + ' "$@"', 'zsh', ...matches] + // 'fish', ['-c', cmd + ' "$argv"', ...matches] + const { SHELL = 'unknown' } = process.env; + const shellBase = basename(SHELL); + const knownShells = ['sh', 'ksh', 'zsh', 'bash', 'fish']; + if ((shell || /[ "']/.test(cmd)) && + knownShells.includes(shellBase)) { + const cmdWithArgs = `${cmd} "\$${shellBase === 'fish' ? 'argv' : '@'}"`; + if (shellBase !== 'fish') { + cmdArg.unshift(SHELL); + } + cmdArg.unshift('-c', cmdWithArgs); + stream.on('end', () => foregroundChild(SHELL, cmdArg)); + } + else { + if (shell) { + process.emitWarning('The --shell option is unsafe, and will be removed. To pass ' + + 'positional arguments to the subprocess, use -g/--cmd-arg instead.', 'DeprecationWarning', 'GLOB_SHELL'); + } + stream.on('end', () => foregroundChild(cmd, cmdArg, { shell })); + } + } +} +catch (e) { + console.error(j.usage()); + console.error(e instanceof Error ? e.message : String(e)); + process.exit(1); +} +//# sourceMappingURL=bin.mjs.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..5472e71207a65e6a867173d3cfbf6af3d8fa66e9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/bin.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;AAEvE,MAAM,CAAC,GAAG,IAAI,CAAC;IACb,KAAK,EAAE,4CAA4C;CACpD,CAAC;KACC,WAAW,CACV;YACQ,OAAO;;;;GAIhB,CACA;KACA,GAAG,CAAC;IACH,GAAG,EAAE;QACH,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,S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C,GAAG,CAAC,CAAC;YAC5B,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC/B,CAAC;YACD,MAAM,WAAW,GAAG,GAAG,GAAG,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;YACvE,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;gBACzB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YACvB,CAAC;YACD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;YACjC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,CAAC,WAAW,CACjB,6DAA6D;oBAC3D,mEAAmE,EACrE,oBAAoB,EACpB,YAAY,CACb,CAAA;YACH,CAAC;YACD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;AACH,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;IACxB,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { foregroundChild } from 'foreground-child'\nimport { existsSync } from 'fs'\nimport { jack } from 'jackspeak'\nimport { loadPackageJson } from 'package-json-from-dist'\nimport { basename, join } from 'path'\nimport { globStream } from './index.js'\n\nconst { version } = loadPackageJson(import.meta.url, '../package.json')\n\nconst j = jack({\n usage: 'glob [options] [ [ ...]]',\n})\n .description(\n `\n Glob v${version}\n\n Expand the positional glob expression arguments into any matching file\n system paths found.\n `,\n )\n .opt({\n cmd: {\n short: 'c',\n hint: 'command',\n description: `Run the command provided, passing the glob expression\n matches as arguments.`,\n },\n })\n .opt({\n default: {\n short: 'p',\n hint: 'pattern',\n description: `If no positional arguments are provided, glob will use\n this pattern`,\n },\n })\n .flag({\n shell: {\n default: false,\n description: `Interpret the command as a shell command by passing it\n to the shell, with all matched filesystem paths appended,\n **even if this cannot be done safely**.\n\n This is **not** unsafe (and usually unnecessary) when using\n the known Unix shells sh, bash, zsh, and fish, as these can\n all be executed in such a way as to pass positional\n arguments safely.\n\n **Note**: THIS IS UNSAFE IF THE FILE PATHS ARE UNTRUSTED,\n because a path like \\`'some/path/\\\\$\\\\(cmd)'\\` will be\n executed by the shell.\n\n If you do have positional arguments that you wish to pass to\n the command ahead of the glob pattern matches, use the\n \\`--cmd-arg\\`/\\`-g\\` option instead.\n\n The next major release of glob will fully remove the ability\n to use this option unsafely.`,\n },\n })\n .optList({\n 'cmd-arg': {\n short: 'g',\n hint: 'arg',\n default: [],\n description: `Pass the provided values to the supplied command, ahead of\n the glob matches.\n\n For example, the command:\n\n glob -c echo -g\"hello\" -g\"world\" *.txt\n\n might output:\n\n hello world a.txt b.txt\n\n This is a safer (and future-proof) alternative than putting\n positional arguments in the \\`-c\\`/\\`--cmd\\` option.`,\n },\n })\n .flag({\n all: {\n short: 'A',\n description: `By default, the glob cli command will not expand any\n arguments that are an exact match to a file on disk.\n\n This prevents double-expanding, in case the shell expands\n an argument whose filename is a glob expression.\n\n For example, if 'app/*.ts' would match 'app/[id].ts', then\n on Windows powershell or cmd.exe, 'glob app/*.ts' will\n expand to 'app/[id].ts', as expected. However, in posix\n shells such as bash or zsh, the shell will first expand\n 'app/*.ts' to a list of filenames. Then glob will look\n for a file matching 'app/[id].ts' (ie, 'app/i.ts' or\n 'app/d.ts'), which is unexpected.\n\n Setting '--all' prevents this behavior, causing glob\n to treat ALL patterns as glob expressions to be expanded,\n even if they are an exact match to a file on disk.\n\n When setting this option, be sure to enquote arguments\n so that the shell will not expand them prior to passing\n them to the glob command process.\n `,\n },\n absolute: {\n short: 'a',\n description: 'Expand to absolute paths',\n },\n 'dot-relative': {\n short: 'd',\n description: `Prepend './' on relative matches`,\n },\n mark: {\n short: 'm',\n description: `Append a / on any directories matched`,\n },\n posix: {\n short: 'x',\n description: `Always resolve to posix style paths, using '/' as the\n directory separator, even on Windows. Drive letter\n absolute matches on Windows will be expanded to their\n full resolved UNC paths, eg instead of 'C:\\\\foo\\\\bar',\n it will expand to '//?/C:/foo/bar'.\n `,\n },\n\n follow: {\n short: 'f',\n description: `Follow symlinked directories when expanding '**'`,\n },\n realpath: {\n short: 'R',\n description: `Call 'fs.realpath' on all of the results. In the case\n of an entry that cannot be resolved, the entry is\n omitted. This incurs a slight performance penalty, of\n course, because of the added system calls.`,\n },\n stat: {\n short: 's',\n description: `Call 'fs.lstat' on all entries, whether required or not\n to determine if it's a valid match.`,\n },\n 'match-base': {\n short: 'b',\n description: `Perform a basename-only match if the pattern does not\n contain any slash characters. That is, '*.js' would be\n treated as equivalent to '**/*.js', matching js files\n in all directories.\n `,\n },\n\n dot: {\n description: `Allow patterns to match files/directories that start\n with '.', even if the pattern does not start with '.'\n `,\n },\n nobrace: {\n description: 'Do not expand {...} patterns',\n },\n nocase: {\n description: `Perform a case-insensitive match. This defaults to\n 'true' on macOS and Windows platforms, and false on\n all others.\n\n Note: 'nocase' should only be explicitly set when it is\n known that the filesystem's case sensitivity differs\n from the platform default. If set 'true' on\n case-insensitive file systems, then the walk may return\n more or less results than expected.\n `,\n },\n nodir: {\n description: `Do not match directories, only files.\n\n Note: to *only* match directories, append a '/' at the\n end of the pattern.\n `,\n },\n noext: {\n description: `Do not expand extglob patterns, such as '+(a|b)'`,\n },\n noglobstar: {\n description: `Do not expand '**' against multiple path portions.\n Ie, treat it as a normal '*' instead.`,\n },\n 'windows-path-no-escape': {\n description: `Use '\\\\' as a path separator *only*, and *never* as an\n escape character. If set, all '\\\\' characters are\n replaced with '/' in the pattern.`,\n },\n })\n .num({\n 'max-depth': {\n short: 'D',\n description: `Maximum depth to traverse from the current\n working directory`,\n },\n })\n .opt({\n cwd: {\n short: 'C',\n description: 'Current working directory to execute/match in',\n default: process.cwd(),\n },\n root: {\n short: 'r',\n description: `A string path resolved against the 'cwd', which is\n used as the starting point for absolute patterns that\n start with '/' (but not drive letters or UNC paths\n on Windows).\n\n Note that this *doesn't* necessarily limit the walk to\n the 'root' directory, and doesn't affect the cwd\n starting point for non-absolute patterns. A pattern\n containing '..' will still be able to traverse out of\n the root directory, if it is not an actual root directory\n on the filesystem, and any non-absolute patterns will\n still be matched in the 'cwd'.\n\n To start absolute and non-absolute patterns in the same\n path, you can use '--root=' to set it to the empty\n string. However, be aware that on Windows systems, a\n pattern like 'x:/*' or '//host/share/*' will *always*\n start in the 'x:/' or '//host/share/' directory,\n regardless of the --root setting.\n `,\n },\n platform: {\n description: `Defaults to the value of 'process.platform' if\n available, or 'linux' if not. Setting --platform=win32\n on non-Windows systems may cause strange behavior!`,\n validOptions: [\n 'aix',\n 'android',\n 'darwin',\n 'freebsd',\n 'haiku',\n 'linux',\n 'openbsd',\n 'sunos',\n 'win32',\n 'cygwin',\n 'netbsd',\n ],\n },\n })\n .optList({\n ignore: {\n short: 'i',\n description: `Glob patterns to ignore`,\n },\n })\n .flag({\n debug: {\n short: 'v',\n description: `Output a huge amount of noisy debug information about\n patterns as they are parsed and used to match files.`,\n },\n version: {\n short: 'V',\n description: `Output the version (${version})`,\n },\n help: {\n short: 'h',\n description: 'Show this usage information',\n },\n })\n\ntry {\n const { positionals, values } = j.parse()\n const {\n cmd,\n shell,\n all,\n default: def,\n version: showVersion,\n help,\n absolute,\n cwd,\n dot,\n\n 'dot-relative': dotRelative,\n follow,\n ignore,\n 'match-base': matchBase,\n 'max-depth': maxDepth,\n mark,\n nobrace,\n nocase,\n nodir,\n noext,\n noglobstar,\n platform,\n realpath,\n root,\n stat,\n debug,\n posix,\n 'cmd-arg': cmdArg,\n } = values\n if (showVersion) {\n console.log(version)\n process.exit(0)\n }\n if (help) {\n console.log(j.usage())\n process.exit(0)\n }\n //const { shell, help } = values\n if (positionals.length === 0 && !def) throw 'No patterns provided'\n if (positionals.length === 0 && def) positionals.push(def)\n const patterns =\n all ? positionals : positionals.filter(p => !existsSync(p))\n const matches =\n all ? [] : positionals.filter(p => existsSync(p)).map(p => join(p))\n\n const stream = globStream(patterns, {\n absolute,\n cwd,\n dot,\n dotRelative,\n follow,\n ignore,\n mark,\n matchBase,\n maxDepth,\n nobrace,\n nocase,\n nodir,\n noext,\n noglobstar,\n platform: platform as undefined | NodeJS.Platform,\n realpath,\n root,\n stat,\n debug,\n posix,\n })\n\n if (!cmd) {\n matches.forEach(m => console.log(m))\n stream.on('data', f => console.log(f))\n } else {\n cmdArg.push(...matches)\n stream.on('data', f => cmdArg.push(f))\n // Attempt to support commands that contain spaces and otherwise require\n // shell interpretation, but do NOT shell-interpret the arguments, to avoid\n // injections via filenames. This affordance can only be done on known Unix\n // shells, unfortunately.\n //\n // 'bash', ['-c', cmd + ' \"$@\"', 'bash', ...matches]\n // 'zsh', ['-c', cmd + ' \"$@\"', 'zsh', ...matches]\n // 'fish', ['-c', cmd + ' \"$argv\"', ...matches]\n const { SHELL = 'unknown' } = process.env\n const shellBase = basename(SHELL)\n const knownShells = ['sh', 'ksh', 'zsh', 'bash', 'fish']\n if (\n (shell || /[ \"']/.test(cmd)) &&\n knownShells.includes(shellBase)\n ) {\n const cmdWithArgs = `${cmd} \"\\$${shellBase === 'fish' ? 'argv' : '@'}\"`\n if (shellBase !== 'fish') {\n cmdArg.unshift(SHELL)\n }\n cmdArg.unshift('-c', cmdWithArgs)\n stream.on('end', () => foregroundChild(SHELL, cmdArg))\n } else {\n if (shell) {\n process.emitWarning(\n 'The --shell option is unsafe, and will be removed. To pass ' +\n 'positional arguments to the subprocess, use -g/--cmd-arg instead.',\n 'DeprecationWarning',\n 'GLOB_SHELL',\n )\n }\n stream.on('end', () => foregroundChild(cmd, cmdArg, { shell }))\n }\n }\n} catch (e) {\n console.error(j.usage())\n console.error(e instanceof Error ? e.message : String(e))\n process.exit(1)\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..314ad1f5ccd3ccdadff2f3cc5bba5136db5a0d03 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts @@ -0,0 +1,388 @@ +import { Minimatch } from 'minimatch'; +import { Minipass } from 'minipass'; +import { FSOption, Path, PathScurry } from 'path-scurry'; +import { IgnoreLike } from './ignore.js'; +import { Pattern } from './pattern.js'; +export type MatchSet = Minimatch['set']; +export type GlobParts = Exclude; +/** + * A `GlobOptions` object may be provided to any of the exported methods, and + * must be provided to the `Glob` constructor. + * + * All options are optional, boolean, and false by default, unless otherwise + * noted. + * + * All resolved options are added to the Glob object as properties. + * + * If you are running many `glob` operations, you can pass a Glob object as the + * `options` argument to a subsequent operation to share the previously loaded + * cache. + */ +export interface GlobOptions { + /** + * Set to `true` to always receive absolute paths for + * matched files. Set to `false` to always return relative paths. + * + * When this option is not set, absolute paths are returned for patterns + * that are absolute, and otherwise paths are returned that are relative + * to the `cwd` setting. + * + * This does _not_ make an extra system call to get + * the realpath, it only does string path resolution. + * + * Conflicts with {@link withFileTypes} + */ + absolute?: boolean; + /** + * Set to false to enable {@link windowsPathsNoEscape} + * + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * The current working directory in which to search. Defaults to + * `process.cwd()`. + * + * May be eiher a string path or a `file://` URL object or string. + */ + cwd?: string | URL; + /** + * Include `.dot` files in normal matches and `globstar` + * matches. Note that an explicit dot in a portion of the pattern + * will always match dot files. + */ + dot?: boolean; + /** + * Prepend all relative path strings with `./` (or `.\` on Windows). + * + * Without this option, returned relative paths are "bare", so instead of + * returning `'./foo/bar'`, they are returned as `'foo/bar'`. + * + * Relative patterns starting with `'../'` are not prepended with `./`, even + * if this option is set. + */ + dotRelative?: boolean; + /** + * Follow symlinked directories when expanding `**` + * patterns. This can result in a lot of duplicate references in + * the presence of cyclic links, and make performance quite bad. + * + * By default, a `**` in a pattern will follow 1 symbolic link if + * it is not the first item in the pattern, or none if it is the + * first item in the pattern, following the same behavior as Bash. + */ + follow?: boolean; + /** + * string or string[], or an object with `ignored` and `childrenIgnored` + * methods. + * + * If a string or string[] is provided, then this is treated as a glob + * pattern or array of glob patterns to exclude from matches. To ignore all + * children within a directory, as well as the entry itself, append `'/**'` + * to the ignore pattern. + * + * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of + * any other settings. + * + * If an object is provided that has `ignored(path)` and/or + * `childrenIgnored(path)` methods, then these methods will be called to + * determine whether any Path is a match or if its children should be + * traversed, respectively. + */ + ignore?: string | string[] | IgnoreLike; + /** + * Treat brace expansion like `{a,b}` as a "magic" pattern. Has no + * effect if {@link nobrace} is set. + * + * Only has effect on the {@link hasMagic} function. + */ + magicalBraces?: boolean; + /** + * Add a `/` character to directory matches. Note that this requires + * additional stat calls in some cases. + */ + mark?: boolean; + /** + * Perform a basename-only match if the pattern does not contain any slash + * characters. That is, `*.js` would be treated as equivalent to + * `**\/*.js`, matching all js files in all directories. + */ + matchBase?: boolean; + /** + * Limit the directory traversal to a given depth below the cwd. + * Note that this does NOT prevent traversal to sibling folders, + * root patterns, and so on. It only limits the maximum folder depth + * that the walk will descend, relative to the cwd. + */ + maxDepth?: number; + /** + * Do not expand `{a,b}` and `{1..3}` brace sets. + */ + nobrace?: boolean; + /** + * Perform a case-insensitive match. This defaults to `true` on macOS and + * Windows systems, and `false` on all others. + * + * **Note** `nocase` should only be explicitly set when it is + * known that the filesystem's case sensitivity differs from the + * platform default. If set `true` on case-sensitive file + * systems, or `false` on case-insensitive file systems, then the + * walk may return more or less results than expected. + */ + nocase?: boolean; + /** + * Do not match directories, only files. (Note: to match + * _only_ directories, put a `/` at the end of the pattern.) + */ + nodir?: boolean; + /** + * Do not match "extglob" patterns such as `+(a|b)`. + */ + noext?: boolean; + /** + * Do not match `**` against multiple filenames. (Ie, treat it as a normal + * `*` instead.) + * + * Conflicts with {@link matchBase} + */ + noglobstar?: boolean; + /** + * Defaults to value of `process.platform` if available, or `'linux'` if + * not. Setting `platform:'win32'` on non-Windows systems may cause strange + * behavior. + */ + platform?: NodeJS.Platform; + /** + * Set to true to call `fs.realpath` on all of the + * results. In the case of an entry that cannot be resolved, the + * entry is omitted. This incurs a slight performance penalty, of + * course, because of the added system calls. + */ + realpath?: boolean; + /** + * + * A string path resolved against the `cwd` option, which + * is used as the starting point for absolute patterns that start + * with `/`, (but not drive letters or UNC paths on Windows). + * + * Note that this _doesn't_ necessarily limit the walk to the + * `root` directory, and doesn't affect the cwd starting point for + * non-absolute patterns. A pattern containing `..` will still be + * able to traverse out of the root directory, if it is not an + * actual root directory on the filesystem, and any non-absolute + * patterns will be matched in the `cwd`. For example, the + * pattern `/../*` with `{root:'/some/path'}` will return all + * files in `/some`, not all files in `/some/path`. The pattern + * `*` with `{root:'/some/path'}` will return all the entries in + * the cwd, not the entries in `/some/path`. + * + * To start absolute and non-absolute patterns in the same + * path, you can use `{root:''}`. However, be aware that on + * Windows systems, a pattern like `x:/*` or `//host/share/*` will + * _always_ start in the `x:/` or `//host/share` directory, + * regardless of the `root` setting. + */ + root?: string; + /** + * A [PathScurry](http://npm.im/path-scurry) object used + * to traverse the file system. If the `nocase` option is set + * explicitly, then any provided `scurry` object must match this + * setting. + */ + scurry?: PathScurry; + /** + * Call `lstat()` on all entries, whether required or not to determine + * if it's a valid match. When used with {@link withFileTypes}, this means + * that matches will include data such as modified time, permissions, and + * so on. Note that this will incur a performance cost due to the added + * system calls. + */ + stat?: boolean; + /** + * An AbortSignal which will cancel the Glob walk when + * triggered. + */ + signal?: AbortSignal; + /** + * Use `\\` as a path separator _only_, and + * _never_ as an escape character. If set, all `\\` characters are + * replaced with `/` in the pattern. + * + * Note that this makes it **impossible** to match against paths + * containing literal glob pattern characters, but allows matching + * with patterns constructed using `path.join()` and + * `path.resolve()` on Windows platforms, mimicking the (buggy!) + * behavior of Glob v7 and before on Windows. Please use with + * caution, and be mindful of [the caveat below about Windows + * paths](#windows). (For legacy reasons, this is also set if + * `allowWindowsEscape` is set to the exact value `false`.) + */ + windowsPathsNoEscape?: boolean; + /** + * Return [PathScurry](http://npm.im/path-scurry) + * `Path` objects instead of strings. These are similar to a + * NodeJS `Dirent` object, but with additional methods and + * properties. + * + * Conflicts with {@link absolute} + */ + withFileTypes?: boolean; + /** + * An fs implementation to override some or all of the defaults. See + * http://npm.im/path-scurry for details about what can be overridden. + */ + fs?: FSOption; + /** + * Just passed along to Minimatch. Note that this makes all pattern + * matching operations slower and *extremely* noisy. + */ + debug?: boolean; + /** + * Return `/` delimited paths, even on Windows. + * + * On posix systems, this has no effect. But, on Windows, it means that + * paths will be `/` delimited, and absolute paths will be their full + * resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return + * `'//?/C:/foo/bar'` + */ + posix?: boolean; + /** + * Do not match any children of any matches. For example, the pattern + * `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode. + * + * This is especially useful for cases like "find all `node_modules` + * folders, but not the ones in `node_modules`". + * + * In order to support this, the `Ignore` implementation must support an + * `add(pattern: string)` method. If using the default `Ignore` class, then + * this is fine, but if this is set to `false`, and a custom `Ignore` is + * provided that does not have an `add()` method, then it will throw an + * error. + * + * **Caveat** It *only* ignores matches that would be a descendant of a + * previous match, and only if that descendant is matched *after* the + * ancestor is encountered. Since the file system walk happens in + * indeterminate order, it's possible that a match will already be added + * before its ancestor, if multiple or braced patterns are used. + * + * For example: + * + * ```ts + * const results = await glob([ + * // likely to match first, since it's just a stat + * 'a/b/c/d/e/f', + * + * // this pattern is more complicated! It must to various readdir() + * // calls and test the results against a regular expression, and that + * // is certainly going to take a little bit longer. + * // + * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + * // late to ignore a/b/c/d/e/f, because it's already been emitted. + * 'a/[bdf]/?/[a-z]/*', + * ], { includeChildMatches: false }) + * ``` + * + * It's best to only set this to `false` if you can be reasonably sure that + * no components of the pattern will potentially match one another's file + * system descendants, or if the occasional included child entry will not + * cause problems. + * + * @default true + */ + includeChildMatches?: boolean; +} +export type GlobOptionsWithFileTypesTrue = GlobOptions & { + withFileTypes: true; + absolute?: undefined; + mark?: undefined; + posix?: undefined; +}; +export type GlobOptionsWithFileTypesFalse = GlobOptions & { + withFileTypes?: false; +}; +export type GlobOptionsWithFileTypesUnset = GlobOptions & { + withFileTypes?: undefined; +}; +export type Result = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path; +export type Results = Result[]; +export type FileTypes = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean; +/** + * An object that can perform glob pattern traversals. + */ +export declare class Glob implements GlobOptions { + absolute?: boolean; + cwd: string; + root?: string; + dot: boolean; + dotRelative: boolean; + follow: boolean; + ignore?: string | string[] | IgnoreLike; + magicalBraces: boolean; + mark?: boolean; + matchBase: boolean; + maxDepth: number; + nobrace: boolean; + nocase: boolean; + nodir: boolean; + noext: boolean; + noglobstar: boolean; + pattern: string[]; + platform: NodeJS.Platform; + realpath: boolean; + scurry: PathScurry; + stat: boolean; + signal?: AbortSignal; + windowsPathsNoEscape: boolean; + withFileTypes: FileTypes; + includeChildMatches: boolean; + /** + * The options provided to the constructor. + */ + opts: Opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns: Pattern[]; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern: string | string[], opts: Opts); + /** + * Returns a Promise that resolves to the results array. + */ + walk(): Promise>; + /** + * synchronous {@link Glob.walk} + */ + walkSync(): Results; + /** + * Stream results asynchronously. + */ + stream(): Minipass, Result>; + /** + * Stream results synchronously. + */ + streamSync(): Minipass, Result>; + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync(): Generator, void, void>; + [Symbol.iterator](): Generator, void, void>; + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate(): AsyncGenerator, void, void>; + [Symbol.asyncIterator](): AsyncGenerator, void, void>; +} +//# sourceMappingURL=glob.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c32dc74c96774177b949cc137befa0edb6489e3f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,W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IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js new file mode 100644 index 0000000000000000000000000000000000000000..c9ff3b0036d9455bf4106c247e40cb207b84fba4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js @@ -0,0 +1,243 @@ +import { Minimatch } from 'minimatch'; +import { fileURLToPath } from 'node:url'; +import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; +import { Pattern } from './pattern.js'; +import { GlobStream, GlobWalker } from './walker.js'; +// if no process global, just call it linux. +// so we default to case-sensitive, / separators +const defaultPlatform = (typeof process === 'object' && + process && + typeof process.platform === 'string') ? + process.platform + : 'linux'; +/** + * An object that can perform glob pattern traversals. + */ +export class Glob { + absolute; + cwd; + root; + dot; + dotRelative; + follow; + ignore; + magicalBraces; + mark; + matchBase; + maxDepth; + nobrace; + nocase; + nodir; + noext; + noglobstar; + pattern; + platform; + realpath; + scurry; + stat; + signal; + windowsPathsNoEscape; + withFileTypes; + includeChildMatches; + /** + * The options provided to the constructor. + */ + opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern, opts) { + /* c8 ignore start */ + if (!opts) + throw new TypeError('glob options required'); + /* c8 ignore stop */ + this.withFileTypes = !!opts.withFileTypes; + this.signal = opts.signal; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.dotRelative = !!opts.dotRelative; + this.nodir = !!opts.nodir; + this.mark = !!opts.mark; + if (!opts.cwd) { + this.cwd = ''; + } + else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) { + opts.cwd = fileURLToPath(opts.cwd); + } + this.cwd = opts.cwd || ''; + this.root = opts.root; + this.magicalBraces = !!opts.magicalBraces; + this.nobrace = !!opts.nobrace; + this.noext = !!opts.noext; + this.realpath = !!opts.realpath; + this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; + this.noglobstar = !!opts.noglobstar; + this.matchBase = !!opts.matchBase; + this.maxDepth = + typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity; + this.stat = !!opts.stat; + this.ignore = opts.ignore; + if (this.withFileTypes && this.absolute !== undefined) { + throw new Error('cannot set absolute and withFileTypes:true'); + } + if (typeof pattern === 'string') { + pattern = [pattern]; + } + this.windowsPathsNoEscape = + !!opts.windowsPathsNoEscape || + opts.allowWindowsEscape === + false; + if (this.windowsPathsNoEscape) { + pattern = pattern.map(p => p.replace(/\\/g, '/')); + } + if (this.matchBase) { + if (opts.noglobstar) { + throw new TypeError('base matching requires globstar'); + } + pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`)); + } + this.pattern = pattern; + this.platform = opts.platform || defaultPlatform; + this.opts = { ...opts, platform: this.platform }; + if (opts.scurry) { + this.scurry = opts.scurry; + if (opts.nocase !== undefined && + opts.nocase !== opts.scurry.nocase) { + throw new Error('nocase option contradicts provided scurry option'); + } + } + else { + const Scurry = opts.platform === 'win32' ? PathScurryWin32 + : opts.platform === 'darwin' ? PathScurryDarwin + : opts.platform ? PathScurryPosix + : PathScurry; + this.scurry = new Scurry(this.cwd, { + nocase: opts.nocase, + fs: opts.fs, + }); + } + this.nocase = this.scurry.nocase; + // If you do nocase:true on a case-sensitive file system, then + // we need to use regexps instead of strings for non-magic + // path portions, because statting `aBc` won't return results + // for the file `AbC` for example. + const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32'; + const mmo = { + // default nocase based on platform + ...opts, + dot: this.dot, + matchBase: this.matchBase, + nobrace: this.nobrace, + nocase: this.nocase, + nocaseMagicOnly, + nocomment: true, + noext: this.noext, + nonegate: true, + optimizationLevel: 2, + platform: this.platform, + windowsPathsNoEscape: this.windowsPathsNoEscape, + debug: !!this.opts.debug, + }; + const mms = this.pattern.map(p => new Minimatch(p, mmo)); + const [matchSet, globParts] = mms.reduce((set, m) => { + set[0].push(...m.set); + set[1].push(...m.globParts); + return set; + }, [[], []]); + this.patterns = matchSet.map((set, i) => { + const g = globParts[i]; + /* c8 ignore start */ + if (!g) + throw new Error('invalid pattern object'); + /* c8 ignore stop */ + return new Pattern(set, g, 0, this.platform); + }); + } + async walk() { + // Walkers always return array of Path objects, so we just have to + // coerce them into the right shape. It will have already called + // realpath() if the option was set to do so, so we know that's cached. + // start out knowing the cwd, at least + return [ + ...(await new GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).walk()), + ]; + } + walkSync() { + return [ + ...new GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).walkSync(), + ]; + } + stream() { + return new GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).stream(); + } + streamSync() { + return new GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + includeChildMatches: this.includeChildMatches, + }).streamSync(); + } + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync() { + return this.streamSync()[Symbol.iterator](); + } + [Symbol.iterator]() { + return this.iterateSync(); + } + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate() { + return this.stream()[Symbol.asyncIterator](); + } + [Symbol.asyncIterator]() { + return this.iterate(); + } +} +//# sourceMappingURL=glob.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a431736271e441302a2a41da0c5599f08f99750e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/glob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAGL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,UA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AQ;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,MAAM,EAAE,CAAA;IACb,CAAC;IAMD,UAAU;QACR,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACpD,GAAG,IAAI,CAAC,IAAI;YACZ,QAAQ,EACN,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;gBACzC,CAAC,CAAC,QAAQ;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignored` and `childrenIgnored`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8aec3bd9725175d9c72be14476fea2a117ca8b09 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts @@ -0,0 +1,14 @@ +import { GlobOptions } from './glob.js'; +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean; +//# sourceMappingURL=has-magic.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e2f7e449672a5f671e82090a226ded1ccad56c1d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js new file mode 100644 index 0000000000000000000000000000000000000000..ba2321ab868d025d56e2ce360c0c02e3e622e6b8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js @@ -0,0 +1,23 @@ +import { Minimatch } from 'minimatch'; +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +export const hasMagic = (pattern, options = {}) => { + if (!Array.isArray(pattern)) { + pattern = [pattern]; + } + for (const p of pattern) { + if (new Minimatch(p, options).hasMagic()) + return true; + } + return false; +}; +//# sourceMappingURL=has-magic.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a20f5aa2e0fdb50071ab84db31b1993d2f220253 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/has-magic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAGrC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1893b16df877c9b50c071ee7b066715f6e58c43e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts @@ -0,0 +1,24 @@ +import { Minimatch, MinimatchOptions } from 'minimatch'; +import { Path } from 'path-scurry'; +import { GlobWalkerOpts } from './walker.js'; +export interface IgnoreLike { + ignored?: (p: Path) => boolean; + childrenIgnored?: (p: Path) => boolean; + add?: (ignore: string) => void; +} +/** + * Class used to process ignored patterns + */ +export declare class Ignore implements IgnoreLike { + relative: Minimatch[]; + relativeChildren: Minimatch[]; + absolute: Minimatch[]; + absoluteChildren: Minimatch[]; + platform: NodeJS.Platform; + mmopts: MinimatchOptions; + constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts); + add(ign: string): void; + ignored(p: Path): boolean; + childrenIgnored(p: Path): boolean; +} +//# sourceMappingURL=ignore.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..57d6ab6153d770397a5acb7881ccf52a048dee89 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js new file mode 100644 index 0000000000000000000000000000000000000000..539c4a4fdebc4b036e5ca02060eae76572e5622d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js @@ -0,0 +1,115 @@ +// give it a pattern, and it'll be able to tell you if +// a given path should be ignored. +// Ignoring a path ignores its children if the pattern ends in /** +// Ignores are always parsed in dot:true mode +import { Minimatch } from 'minimatch'; +import { Pattern } from './pattern.js'; +const defaultPlatform = (typeof process === 'object' && + process && + typeof process.platform === 'string') ? + process.platform + : 'linux'; +/** + * Class used to process ignored patterns + */ +export class Ignore { + relative; + relativeChildren; + absolute; + absoluteChildren; + platform; + mmopts; + constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { + this.relative = []; + this.absolute = []; + this.relativeChildren = []; + this.absoluteChildren = []; + this.platform = platform; + this.mmopts = { + dot: true, + nobrace, + nocase, + noext, + noglobstar, + optimizationLevel: 2, + platform, + nocomment: true, + nonegate: true, + }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { + // this is a little weird, but it gives us a clean set of optimized + // minimatch matchers, without getting tripped up if one of them + // ends in /** inside a brace section, and it's only inefficient at + // the start of the walk, not along it. + // It'd be nice if the Pattern class just had a .test() method, but + // handling globstars is a bit of a pita, and that code already lives + // in minimatch anyway. + // Another way would be if maybe Minimatch could take its set/globParts + // as an option, and then we could at least just use Pattern to test + // for absolute-ness. + // Yet another way, Minimatch could take an array of glob strings, and + // a cwd option, and do the right thing. + const mm = new Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new Pattern(parsed, globParts, 0, this.platform); + const m = new Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { + if (absolute) + this.absoluteChildren.push(m); + else + this.relativeChildren.push(m); + } + } + } + ignored(p) { + const fullpath = p.fullpath(); + const fullpaths = `${fullpath}/`; + const relative = p.relative() || '.'; + const relatives = `${relative}/`; + for (const m of this.relative) { + if (m.match(relative) || m.match(relatives)) + return true; + } + for (const m of this.absolute) { + if (m.match(fullpath) || m.match(fullpaths)) + return true; + } + return false; + } + childrenIgnored(p) { + const fullpath = p.fullpath() + '/'; + const relative = (p.relative() || '.') + '/'; + for (const m of this.relativeChildren) { + if (m.match(relative)) + return true; + } + for (const m of this.absoluteChildren) { + if (m.match(fullpath)) + return true; + } + return false; + } +} +//# sourceMappingURL=ignore.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2cddba2ecfe9f605f05b45ad1c23663de46945b8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/ignore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;AAE7C,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAStC,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAEX;;GAEG;AACH,MAAM,OAAO,MAAM;IACjB,QAAQ,CAA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AM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAA;QACpC,MAAM,SAAS,GAAG,GAAG,QAAQ,GAAG,CAAA;QAChC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;QAC1D,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;QAC1D,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,eAAe,CAAC,CAAO;QACrB,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAA;QACnC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n platform: NodeJS.Platform\n mmopts: MinimatchOptions\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts,\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n this.platform = platform\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n for (const ign of ignored) this.add(ign)\n }\n\n add(ign: string) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new Minimatch(ign, this.mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, this.platform)\n const m = new Minimatch(p.globString(), this.mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb09bfb64acb34985b08e658882181a3fff9bd38 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts @@ -0,0 +1,97 @@ +import { Minipass } from 'minipass'; +import { Path } from 'path-scurry'; +import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js'; +import { Glob } from './glob.js'; +export { escape, unescape } from 'minimatch'; +export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry'; +export { Glob } from './glob.js'; +export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; +export type { IgnoreLike } from './ignore.js'; +export type { MatchStream } from './walker.js'; +/** + * Syncronous form of {@link globStream}. Will read all the matches as fast as + * you consume them, even all in a single tick if you consume them immediately, + * but will still respond to backpressure if they're not consumed immediately. + */ +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass; +export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass | Minipass; +/** + * Return a stream that emits all the strings or `Path` objects and + * then emits `end` when completed. + */ +export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; +export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; +export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass; +export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass | Minipass; +/** + * Synchronous form of {@link glob} + */ +export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[]; +export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[]; +export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[]; +export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[]; +/** + * Perform an asynchronous glob search for the pattern(s) specified. Returns + * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the + * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for + * full option descriptions. + */ +declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise; +declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise; +declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise; +declare function glob_(pattern: string | string[], options: GlobOptions): Promise; +/** + * Return a sync iterator for walking glob pattern matches. + */ +export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator; +export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator | Generator; +/** + * Return an async iterator for walking glob pattern matches. + */ +export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator; +export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator | AsyncGenerator; +export declare const streamSync: typeof globStreamSync; +export declare const stream: typeof globStream & { + sync: typeof globStreamSync; +}; +export declare const iterateSync: typeof globIterateSync; +export declare const iterate: typeof globIterate & { + sync: typeof globIterateSync; +}; +export declare const sync: typeof globSync & { + stream: typeof globStreamSync; + iterate: typeof globIterateSync; +}; +export declare const glob: typeof glob_ & { + glob: typeof glob_; + globSync: typeof globSync; + sync: typeof globSync & { + stream: typeof globStreamSync; + iterate: typeof globIterateSync; + }; + globStream: typeof globStream; + stream: typeof globStream & { + sync: typeof globStreamSync; + }; + globStreamSync: typeof globStreamSync; + streamSync: typeof globStreamSync; + globIterate: typeof globIterate; + iterate: typeof globIterate & { + sync: typeof globIterateSync; + }; + globIterateSync: typeof globIterateSync; + iterateSync: typeof globIterateSync; + Glob: typeof Glob; + hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5fb32252b63747526a971d82bf6ab2ee61b53631 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACvB,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3B,wBAAgB,cAAc,CAC5B,OAAO,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js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e15c1f9c4cb03257181652847417840688521cb2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.js @@ -0,0 +1,55 @@ +import { escape, unescape } from 'minimatch'; +import { Glob } from './glob.js'; +import { hasMagic } from './has-magic.js'; +export { escape, unescape } from 'minimatch'; +export { Glob } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; +export function globStreamSync(pattern, options = {}) { + return new Glob(pattern, options).streamSync(); +} +export function globStream(pattern, options = {}) { + return new Glob(pattern, options).stream(); +} +export function globSync(pattern, options = {}) { + return new Glob(pattern, options).walkSync(); +} +async function glob_(pattern, options = {}) { + return new Glob(pattern, options).walk(); +} +export function globIterateSync(pattern, options = {}) { + return new Glob(pattern, options).iterateSync(); +} +export function globIterate(pattern, options = {}) { + return new Glob(pattern, options).iterate(); +} +// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc +export const streamSync = globStreamSync; +export const stream = Object.assign(globStream, { sync: globStreamSync }); +export const iterateSync = globIterateSync; +export const iterate = Object.assign(globIterate, { + sync: globIterateSync, +}); +export const sync = Object.assign(globSync, { + stream: globStreamSync, + iterate: globIterateSync, +}); +export const glob = Object.assign(glob_, { + glob: glob_, + globSync, + sync, + globStream, + stream, + globStreamSync, + streamSync, + globIterate, + iterate, + globIterateSync, + iterateSync, + Glob, + hasMagic, + escape, + unescape, +}); +glob.glob = glob; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a4f93dd0c1d87d292b2ce821897926fafeb582d4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","source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E;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;AAC7C,CAAC;AAED,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAA;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAA;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IAChD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC1C,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,KAAK;IACX,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,MAAM;IACN,cAAc;IACd,UAAU;IACV,WAAW;IACX,OAAO;IACP,eAAe;IACf,WAAW;IACX,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,QAAQ;CACT,CAAC,CAAA;AACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions,\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions,\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9636df3b54df2912790cdb6d4551c3ebe6e4d42e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts @@ -0,0 +1,76 @@ +import { GLOBSTAR } from 'minimatch'; +export type MMPattern = string | RegExp | typeof GLOBSTAR; +export type PatternList = [p: MMPattern, ...rest: MMPattern[]]; +export type UNCPatternList = [ + p0: '', + p1: '', + p2: string, + p3: string, + ...rest: MMPattern[] +]; +export type DrivePatternList = [p0: string, ...rest: MMPattern[]]; +export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]; +export type GlobList = [p: string, ...rest: string[]]; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +export declare class Pattern { + #private; + readonly length: number; + constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform); + /** + * The first entry in the parsed list of patterns + */ + pattern(): MMPattern; + /** + * true of if pattern() returns a string + */ + isString(): boolean; + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar(): boolean; + /** + * true if pattern() returns a regexp + */ + isRegExp(): boolean; + /** + * The /-joined set of glob parts that make up this pattern + */ + globString(): string; + /** + * true if there are more pattern parts after this one + */ + hasMore(): boolean; + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest(): Pattern | null; + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC(): boolean; + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive(): boolean; + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute(): boolean; + /** + * consume the root of the pattern, and return it + */ + root(): string; + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar(): boolean; + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar(): boolean; +} +//# sourceMappingURL=pattern.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cdf322346317d8a12efa4c8fa613b693d2bf8bbe --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GA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js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..b41defa10c6a3acd347a2b8464ef28af970dd741 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.js @@ -0,0 +1,215 @@ +// this is just a very light wrapper around 2 arrays with an offset index +import { GLOBSTAR } from 'minimatch'; +const isPatternList = (pl) => pl.length >= 1; +const isGlobList = (gl) => gl.length >= 1; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +export class Pattern { + #patternList; + #globList; + #index; + length; + #platform; + #rest; + #globString; + #isDrive; + #isUNC; + #isAbsolute; + #followGlobstar = true; + constructor(patternList, globList, index, platform) { + if (!isPatternList(patternList)) { + throw new TypeError('empty pattern list'); + } + if (!isGlobList(globList)) { + throw new TypeError('empty glob list'); + } + if (globList.length !== patternList.length) { + throw new TypeError('mismatched pattern list and glob list lengths'); + } + this.length = patternList.length; + if (index < 0 || index >= this.length) { + throw new TypeError('index out of range'); + } + this.#patternList = patternList; + this.#globList = globList; + this.#index = index; + this.#platform = platform; + // normalize root entries of absolute patterns on initial creation. + if (this.#index === 0) { + // c: => ['c:/'] + // C:/ => ['C:/'] + // C:/x => ['C:/', 'x'] + // //host/share => ['//host/share/'] + // //host/share/ => ['//host/share/'] + // //host/share/x => ['//host/share/', 'x'] + // /etc => ['/', 'etc'] + // / => ['/'] + if (this.isUNC()) { + // '' / '' / 'host' / 'share' + const [p0, p1, p2, p3, ...prest] = this.#patternList; + const [g0, g1, g2, g3, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = [p0, p1, p2, p3, ''].join('/'); + const g = [g0, g1, g2, g3, ''].join('/'); + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + else if (this.isDrive() || this.isAbsolute()) { + const [p1, ...prest] = this.#patternList; + const [g1, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = p1 + '/'; + const g = g1 + '/'; + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + } + } + /** + * The first entry in the parsed list of patterns + */ + pattern() { + return this.#patternList[this.#index]; + } + /** + * true of if pattern() returns a string + */ + isString() { + return typeof this.#patternList[this.#index] === 'string'; + } + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar() { + return this.#patternList[this.#index] === GLOBSTAR; + } + /** + * true if pattern() returns a regexp + */ + isRegExp() { + return this.#patternList[this.#index] instanceof RegExp; + } + /** + * The /-joined set of glob parts that make up this pattern + */ + globString() { + return (this.#globString = + this.#globString || + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') + : this.#globList.join('/') + : this.#globList.slice(this.#index).join('/'))); + } + /** + * true if there are more pattern parts after this one + */ + hasMore() { + return this.length > this.#index + 1; + } + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest() { + if (this.#rest !== undefined) + return this.#rest; + if (!this.hasMore()) + return (this.#rest = null); + this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform); + this.#rest.#isAbsolute = this.#isAbsolute; + this.#rest.#isUNC = this.#isUNC; + this.#rest.#isDrive = this.#isDrive; + return this.#rest; + } + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC() { + const pl = this.#patternList; + return this.#isUNC !== undefined ? + this.#isUNC + : (this.#isUNC = + this.#platform === 'win32' && + this.#index === 0 && + pl[0] === '' && + pl[1] === '' && + typeof pl[2] === 'string' && + !!pl[2] && + typeof pl[3] === 'string' && + !!pl[3]); + } + // pattern like C:/... + // split = ['C:', ...] + // XXX: would be nice to handle patterns like `c:*` to test the cwd + // in c: for *, but I don't know of a way to even figure out what that + // cwd is without actually chdir'ing into it? + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive() { + const pl = this.#patternList; + return this.#isDrive !== undefined ? + this.#isDrive + : (this.#isDrive = + this.#platform === 'win32' && + this.#index === 0 && + this.length > 1 && + typeof pl[0] === 'string' && + /^[a-z]:$/i.test(pl[0])); + } + // pattern = '/' or '/...' or '/x/...' + // split = ['', ''] or ['', ...] or ['', 'x', ...] + // Drive and UNC both considered absolute on windows + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute() { + const pl = this.#patternList; + return this.#isAbsolute !== undefined ? + this.#isAbsolute + : (this.#isAbsolute = + (pl[0] === '' && pl.length > 1) || + this.isDrive() || + this.isUNC()); + } + /** + * consume the root of the pattern, and return it + */ + root() { + const p = this.#patternList[0]; + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p + : ''; + } + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar() { + return !(this.#index === 0 || + !this.isGlobstar() || + !this.#followGlobstar); + } + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar() { + if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar) + return false; + this.#followGlobstar = false; + return true; + } +} +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.js.map new file mode 100644 index 0000000000000000000000000000000000000000..566a306ad1bf400413ab69cf023c067ffc0bbe08 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE;;;GAGG;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AAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccedfbf2820f7d51167574666a80785ca1b91b07 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts @@ -0,0 +1,59 @@ +import { MMRegExp } from 'minimatch'; +import { Path } from 'path-scurry'; +import { Pattern } from './pattern.js'; +import { GlobWalkerOpts } from './walker.js'; +/** + * A cache of which patterns have been processed for a given Path + */ +export declare class HasWalkedCache { + store: Map>; + constructor(store?: Map>); + copy(): HasWalkedCache; + hasWalked(target: Path, pattern: Pattern): boolean | undefined; + storeWalked(target: Path, pattern: Pattern): void; +} +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +export declare class MatchRecord { + store: Map; + add(target: Path, absolute: boolean, ifDir: boolean): void; + entries(): [Path, boolean, boolean][]; +} +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +export declare class SubWalks { + store: Map; + add(target: Path, pattern: Pattern): void; + get(target: Path): Pattern[]; + entries(): [Path, Pattern[]][]; + keys(): Path[]; +} +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +export declare class Processor { + hasWalkedCache: HasWalkedCache; + matches: MatchRecord; + subwalks: SubWalks; + patterns?: Pattern[]; + follow: boolean; + dot: boolean; + opts: GlobWalkerOpts; + constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache); + processPatterns(target: Path, patterns: Pattern[]): this; + subwalkTargets(): Path[]; + child(): Processor; + filterEntries(parent: Path, entries: Path[]): Processor; + testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void; + testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void; + testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void; +} +//# sourceMappingURL=processor.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..aa266fee4a0544a0a8f7fddceb347d7d059643e0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;gBACnB,KAAK,GAAE,GAAG,CAAC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AAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,UAAU,CACR,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,QAAQ,EACX,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAUnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js new file mode 100644 index 0000000000000000000000000000000000000000..f874892ffed0c4affb2e0c2c17895e9ebe2a9afd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js @@ -0,0 +1,294 @@ +// synchronous utility for filtering entries and calculating subwalks +import { GLOBSTAR } from 'minimatch'; +/** + * A cache of which patterns have been processed for a given Path + */ +export class HasWalkedCache { + store; + constructor(store = new Map()) { + this.store = store; + } + copy() { + return new HasWalkedCache(new Map(this.store)); + } + hasWalked(target, pattern) { + return this.store.get(target.fullpath())?.has(pattern.globString()); + } + storeWalked(target, pattern) { + const fullpath = target.fullpath(); + const cached = this.store.get(fullpath); + if (cached) + cached.add(pattern.globString()); + else + this.store.set(fullpath, new Set([pattern.globString()])); + } +} +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +export class MatchRecord { + store = new Map(); + add(target, absolute, ifDir) { + const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const current = this.store.get(target); + this.store.set(target, current === undefined ? n : n & current); + } + // match, absolute, ifdir + entries() { + return [...this.store.entries()].map(([path, n]) => [ + path, + !!(n & 2), + !!(n & 1), + ]); + } +} +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +export class SubWalks { + store = new Map(); + add(target, pattern) { + if (!target.canReaddir()) { + return; + } + const subs = this.store.get(target); + if (subs) { + if (!subs.find(p => p.globString() === pattern.globString())) { + subs.push(pattern); + } + } + else + this.store.set(target, [pattern]); + } + get(target) { + const subs = this.store.get(target); + /* c8 ignore start */ + if (!subs) { + throw new Error('attempting to walk unknown path'); + } + /* c8 ignore stop */ + return subs; + } + entries() { + return this.keys().map(k => [k, this.store.get(k)]); + } + keys() { + return [...this.store.keys()].filter(t => t.canReaddir()); + } +} +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +export class Processor { + hasWalkedCache; + matches = new MatchRecord(); + subwalks = new SubWalks(); + patterns; + follow; + dot; + opts; + constructor(opts, hasWalkedCache) { + this.opts = opts; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); + } + processPatterns(target, patterns) { + this.patterns = patterns; + const processingSet = patterns.map(p => [target, p]); + // map of paths to the magic-starting subwalks they need to walk + // first item in patterns is the filter + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root = pattern.root(); + const absolute = pattern.isAbsolute() && this.opts.absolute !== false; + // start absolute patterns at root + if (root) { + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root + : root); + const rest = pattern.rest(); + if (!rest) { + this.matches.add(t, true, false); + continue; + } + else { + pattern = rest; + } + } + if (t.isENOENT()) + continue; + let p; + let rest; + let changed = false; + while (typeof (p = pattern.pattern()) === 'string' && + (rest = pattern.rest())) { + const c = t.resolve(p); + t = c; + pattern = rest; + changed = true; + } + p = pattern.pattern(); + rest = pattern.rest(); + if (changed) { + if (this.hasWalkedCache.hasWalked(t, pattern)) + continue; + this.hasWalkedCache.storeWalked(t, pattern); + } + // now we have either a final string for a known entry, + // more strings for an unknown entry, + // or a pattern starting with magic, mounted on t. + if (typeof p === 'string') { + // must not be final entry, otherwise we would have + // concatenated it earlier. + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); + continue; + } + else if (p === GLOBSTAR) { + // if no rest, match and subwalk pattern + // if rest, process rest and subwalk pattern + // if it's a symlink, but we didn't get here by way of a + // globstar match (meaning it's the first time THIS globstar + // has traversed a symlink), then we follow it. Otherwise, stop. + if (!t.isSymbolicLink() || + this.follow || + pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); + } + const rp = rest?.pattern(); + const rrest = rest?.rest(); + if (!rest || ((rp === '' || rp === '.') && !rrest)) { + // only HAS to be a dir if it ends in **/ or **/. + // but ending in ** will match files as well. + this.matches.add(t, absolute, rp === '' || rp === '.'); + } + else { + if (rp === '..') { + // this would mean you're matching **/.. at the fs root, + // and no thanks, I'm not gonna test that specific case. + /* c8 ignore start */ + const tp = t.parent || t; + /* c8 ignore stop */ + if (!rrest) + this.matches.add(tp, absolute, true); + else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { + this.subwalks.add(tp, rrest); + } + } + } + } + else if (p instanceof RegExp) { + this.subwalks.add(t, pattern); + } + } + return this; + } + subwalkTargets() { + return this.subwalks.keys(); + } + child() { + return new Processor(this.opts, this.hasWalkedCache); + } + // return a new Processor containing the subwalks for each + // child entry, and a set of matches, and + // a hasWalkedCache that's a copy of this one + // then we're going to call + filterEntries(parent, entries) { + const patterns = this.subwalks.get(parent); + // put matches and entry walks into the results processor + const results = this.child(); + for (const e of entries) { + for (const pattern of patterns) { + const absolute = pattern.isAbsolute(); + const p = pattern.pattern(); + const rest = pattern.rest(); + if (p === GLOBSTAR) { + results.testGlobstar(e, pattern, rest, absolute); + } + else if (p instanceof RegExp) { + results.testRegExp(e, p, rest, absolute); + } + else { + results.testString(e, p, rest, absolute); + } + } + } + return results; + } + testGlobstar(e, pattern, rest, absolute) { + if (this.dot || !e.name.startsWith('.')) { + if (!pattern.hasMore()) { + this.matches.add(e, absolute, false); + } + if (e.canReaddir()) { + // if we're in follow mode or it's not a symlink, just keep + // testing the same pattern. If there's more after the globstar, + // then this symlink consumes the globstar. If not, then we can + // follow at most ONE symlink along the way, so we mark it, which + // also checks to ensure that it wasn't already marked. + if (this.follow || !e.isSymbolicLink()) { + this.subwalks.add(e, pattern); + } + else if (e.isSymbolicLink()) { + if (rest && pattern.checkFollowGlobstar()) { + this.subwalks.add(e, rest); + } + else if (pattern.markFollowGlobstar()) { + this.subwalks.add(e, pattern); + } + } + } + } + // if the NEXT thing matches this entry, then also add + // the rest. + if (rest) { + const rp = rest.pattern(); + if (typeof rp === 'string' && + // dots and empty were handled already + rp !== '..' && + rp !== '' && + rp !== '.') { + this.testString(e, rp, rest.rest(), absolute); + } + else if (rp === '..') { + /* c8 ignore start */ + const ep = e.parent || e; + /* c8 ignore stop */ + this.subwalks.add(ep, rest); + } + else if (rp instanceof RegExp) { + this.testRegExp(e, rp, rest.rest(), absolute); + } + } + } + testRegExp(e, p, rest, absolute) { + if (!p.test(e.name)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } + testString(e, p, rest, absolute) { + // should never happen? + if (!e.isNamed(p)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } +} +//# sourceMappingURL=processor.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js.map new file mode 100644 index 0000000000000000000000000000000000000000..05a832420b8b2fa97eef4e7ab05b6612b5ec17e2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/processor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAY,MAAM,WAAW,CAAA;AAK9C;;GAEG;AACH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EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU,CACR,CAAO,EACP,CAAW,EACX,IAAoB,EACpB,QAAiB;QAEjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAM;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,UAAU,CAAC,CAAO,EAAE,CAAS,EAAE,IAAoB,EAAE,QAAiB;QACpE,uBAAuB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAM;QACzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n store: Map>\n constructor(store: Map> = new Map()) {\n this.store = store\n }\n copy() {\n return new HasWalkedCache(new Map(this.store))\n }\n hasWalked(target: Path, pattern: Pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.store.get(fullpath)\n if (cached) cached.add(pattern.globString())\n else this.store.set(fullpath, new Set([pattern.globString()]))\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n store: Map = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n // match, absolute, ifdir\n entries(): [Path, boolean, boolean][] {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ])\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root,\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testRegExp(\n e: Path,\n p: MMRegExp,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (!p.test(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..499c8f4933857a8720e77b7b96d9842bbd3248ae --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts @@ -0,0 +1,97 @@ +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +import { Minipass } from 'minipass'; +import { Path } from 'path-scurry'; +import { IgnoreLike } from './ignore.js'; +import { Pattern } from './pattern.js'; +import { Processor } from './processor.js'; +export interface GlobWalkerOpts { + absolute?: boolean; + allowWindowsEscape?: boolean; + cwd?: string | URL; + dot?: boolean; + dotRelative?: boolean; + follow?: boolean; + ignore?: string | string[] | IgnoreLike; + mark?: boolean; + matchBase?: boolean; + maxDepth?: number; + nobrace?: boolean; + nocase?: boolean; + nodir?: boolean; + noext?: boolean; + noglobstar?: boolean; + platform?: NodeJS.Platform; + posix?: boolean; + realpath?: boolean; + root?: string; + stat?: boolean; + signal?: AbortSignal; + windowsPathsNoEscape?: boolean; + withFileTypes?: boolean; + includeChildMatches?: boolean; +} +export type GWOFileTypesTrue = GlobWalkerOpts & { + withFileTypes: true; +}; +export type GWOFileTypesFalse = GlobWalkerOpts & { + withFileTypes: false; +}; +export type GWOFileTypesUnset = GlobWalkerOpts & { + withFileTypes?: undefined; +}; +export type Result = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string; +export type Matches = O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; +export type MatchStream = Minipass, Result>; +/** + * basic walking utilities that all the glob walker types use + */ +export declare abstract class GlobUtil { + #private; + path: Path; + patterns: Pattern[]; + opts: O; + seen: Set; + paused: boolean; + aborted: boolean; + signal?: AbortSignal; + maxDepth: number; + includeChildMatches: boolean; + constructor(patterns: Pattern[], path: Path, opts: O); + pause(): void; + resume(): void; + onResume(fn: () => any): void; + matchCheck(e: Path, ifDir: boolean): Promise; + matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined; + matchCheckSync(e: Path, ifDir: boolean): Path | undefined; + abstract matchEmit(p: Result): void; + abstract matchEmit(p: string | Path): void; + matchFinish(e: Path, absolute: boolean): void; + match(e: Path, absolute: boolean, ifDir: boolean): Promise; + matchSync(e: Path, absolute: boolean, ifDir: boolean): void; + walkCB(target: Path, patterns: Pattern[], cb: () => any): void; + walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any; + walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void; + walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void; + walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any; + walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void; +} +export declare class GlobWalker extends GlobUtil { + matches: Set>; + constructor(patterns: Pattern[], path: Path, opts: O); + matchEmit(e: Result): void; + walk(): Promise>>; + walkSync(): Set>; +} +export declare class GlobStream extends GlobUtil { + results: Minipass, Result>; + constructor(patterns: Pattern[], path: Path, opts: O); + matchEmit(e: Result): void; + stream(): MatchStream; + streamSync(): MatchStream; +} +//# sourceMappingURL=walker.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..769957bd59bb1ce67cdf28134be59ca86946c405 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,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BAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBAE3B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAK7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.js b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.js new file mode 100644 index 0000000000000000000000000000000000000000..3d68196c4f175f6b314b444e409f9b8a77164963 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.js @@ -0,0 +1,381 @@ +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +import { Minipass } from 'minipass'; +import { Ignore } from './ignore.js'; +import { Processor } from './processor.js'; +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts) + : Array.isArray(ignore) ? new Ignore(ignore, opts) + : ignore; +/** + * basic walking utilities that all the glob walker types use + */ +export class GlobUtil { + path; + patterns; + opts; + seen = new Set(); + paused = false; + aborted = false; + #onResume = []; + #ignore; + #sep; + signal; + maxDepth; + includeChildMatches; + constructor(patterns, path, opts) { + this.patterns = patterns; + this.path = path; + this.opts = opts; + this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } + } + // ignore, always set with maxDepth, but it's optional on the + // GlobOptions type + /* c8 ignore start */ + this.maxDepth = opts.maxDepth || Infinity; + /* c8 ignore stop */ + if (opts.signal) { + this.signal = opts.signal; + this.signal.addEventListener('abort', () => { + this.#onResume.length = 0; + }); + } + } + #ignored(path) { + return this.seen.has(path) || !!this.#ignore?.ignored?.(path); + } + #childrenIgnored(path) { + return !!this.#ignore?.childrenIgnored?.(path); + } + // backpressure mechanism + pause() { + this.paused = true; + } + resume() { + /* c8 ignore start */ + if (this.signal?.aborted) + return; + /* c8 ignore stop */ + this.paused = false; + let fn = undefined; + while (!this.paused && (fn = this.#onResume.shift())) { + fn(); + } + } + onResume(fn) { + if (this.signal?.aborted) + return; + /* c8 ignore start */ + if (!this.paused) { + fn(); + } + else { + /* c8 ignore stop */ + this.#onResume.push(fn); + } + } + // do the requisite realpath/stat checking, and return the path + // to add or undefined to filter it out. + async matchCheck(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || (await e.realpath()); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + const s = needStat ? await e.lstat() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = await s.realpath(); + /* c8 ignore start */ + if (target && (target.isUnknown() || this.opts.stat)) { + await target.lstat(); + } + /* c8 ignore stop */ + } + return this.matchCheckTest(s, ifDir); + } + matchCheckTest(e, ifDir) { + return (e && + (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && + (!ifDir || e.canReaddir()) && + (!this.opts.nodir || !e.isDirectory()) && + (!this.opts.nodir || + !this.opts.follow || + !e.isSymbolicLink() || + !e.realpathCached()?.isDirectory()) && + !this.#ignored(e)) ? + e + : undefined; + } + matchCheckSync(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || e.realpathSync(); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + const s = needStat ? e.lstatSync() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = s.realpathSync(); + if (target && (target?.isUnknown() || this.opts.stat)) { + target.lstatSync(); + } + } + return this.matchCheckTest(s, ifDir); + } + matchFinish(e, absolute) { + if (this.#ignored(e)) + return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } + const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; + this.seen.add(e); + const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; + // ok, we have what we need! + if (this.opts.withFileTypes) { + this.matchEmit(e); + } + else if (abs) { + const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath(); + this.matchEmit(abs + mark); + } + else { + const rel = this.opts.posix ? e.relativePosix() : e.relative(); + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep + : ''; + this.matchEmit(!rel ? '.' + mark : pre + rel + mark); + } + } + async match(e, absolute, ifDir) { + const p = await this.matchCheck(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + matchSync(e, absolute, ifDir) { + const p = this.matchCheckSync(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + walkCB(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2(target, patterns, new Processor(this.opts), cb); + } + walkCB2(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); + else { + t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true); + } + } + next(); + } + walkCB3(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2(target, patterns, processor.child(), next); + } + next(); + } + walkCBSync(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2Sync(target, patterns, new Processor(this.opts), cb); + } + walkCB2Sync(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const children = t.readdirSync(); + this.walkCB3Sync(t, children, processor, next); + } + next(); + } + walkCB3Sync(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2Sync(target, patterns, processor.child(), next); + } + next(); + } +} +export class GlobWalker extends GlobUtil { + matches = new Set(); + constructor(patterns, path, opts) { + super(patterns, path, opts); + } + matchEmit(e) { + this.matches.add(e); + } + async walk() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + await this.path.lstat(); + } + await new Promise((res, rej) => { + this.walkCB(this.path, this.patterns, () => { + if (this.signal?.aborted) { + rej(this.signal.reason); + } + else { + res(this.matches); + } + }); + }); + return this.matches; + } + walkSync() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + // nothing for the callback to do, because this never pauses + this.walkCBSync(this.path, this.patterns, () => { + if (this.signal?.aborted) + throw this.signal.reason; + }); + return this.matches; + } +} +export class GlobStream extends GlobUtil { + results; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.results = new Minipass({ + signal: this.signal, + objectMode: true, + }); + this.results.on('drain', () => this.resume()); + this.results.on('resume', () => this.resume()); + } + matchEmit(e) { + this.results.write(e); + if (!this.results.flowing) + this.pause(); + } + stream() { + const target = this.path; + if (target.isUnknown()) { + target.lstat().then(() => { + this.walkCB(target, this.patterns, () => this.results.end()); + }); + } + else { + this.walkCB(target, this.patterns, () => this.results.end()); + } + return this.results; + } + streamSync() { + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + this.walkCBSync(this.path, this.patterns, () => this.results.end()); + return this.results; + } +} +//# sourceMappingURL=walker.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.js.map b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/walker.js.map new file mode 100644 index 0000000000000000000000000000000000000000..daeeda6752713f72f18fae72f9d0113bb6f1b954 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/dist/esm/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AE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n O extends GWOFileTypesTrue ? Path\n : O extends GWOFileTypesFalse ? string\n : O extends GWOFileTypesUnset ? string\n : Path | string\n\nexport type Matches =\n O extends GWOFileTypesTrue ? Set\n : O extends GWOFileTypesFalse ? Set\n : O extends GWOFileTypesUnset ? Set\n : Set\n\nexport type MatchStream = Minipass<\n Result,\n Result\n>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts,\n): IgnoreLike =>\n typeof ignore === 'string' ? new Ignore([ignore], opts)\n : Array.isArray(ignore) ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n includeChildMatches: boolean\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n this.includeChildMatches = opts.includeChildMatches !== false\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n if (\n !this.includeChildMatches &&\n typeof this.#ignore.add !== 'function'\n ) {\n const m = 'cannot ignore child matches, ignore lacks add() method.'\n throw new Error(m)\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return (\n e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ) ?\n e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`\n this.#ignore.add(ign)\n }\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true,\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb),\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n matches = new Set>()\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n }\n\n matchEmit(e: Result): void {\n this.matches.add(e)\n }\n\n async walk(): Promise>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Set> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n results: Minipass, Result>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass, Result>({\n signal: this.signal,\n objectMode: true,\n })\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/glob/package.json b/tools/ui/node_modules/workbox-build/node_modules/glob/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4c4e4fd1235cc09e3a582db933fdc938f4a213da --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/glob/package.json @@ -0,0 +1,97 @@ +{ + "author": "Isaac Z. Schlueter (https://blog.izs.me/)", + "name": "glob", + "description": "the most correct and second fastest glob implementation in JavaScript", + "version": "11.1.0", + "type": "module", + "tshy": { + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "bin": "./dist/esm/bin.mjs", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "repository": { + "type": "git", + "url": "git@github.com:isaacs/node-glob.git" + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "npm run benchclean; git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", + "profclean": "rm -f v8.log profile.txt", + "test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts", + "prebench": "npm run prepare", + "bench": "bash benchmark.sh", + "preprof": "npm run prepare", + "prof": "bash prof.sh", + "benchclean": "node benchclean.cjs" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "dependencies": { + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "devDependencies": { + "@types/node": "^24.10.0", + "memfs": "^4.50.0", + "mkdirp": "^3.0.1", + "prettier": "^3.6.2", + "rimraf": "^6.1.0", + "tap": "^21.1.3", + "tshy": "^3.0.3", + "typedoc": "^0.28.14" + }, + "tap": { + "before": "test/00-setup.ts" + }, + "license": "BlueOak-1.0.0", + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "engines": { + "node": "20 || >=22" + }, + "module": "./dist/esm/index.js" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8cb5cc6e616c0d9259b4965f9d2ce8528e4d2828 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/README.md b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/README.md new file mode 100644 index 0000000000000000000000000000000000000000..611c7ea18c6a7a30ab4c04e97320121410103e04 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/README.md @@ -0,0 +1,394 @@ +# jackspeak + +A very strict and proper argument parser. + +Validate string, boolean, and number options, from the command +line and the environment. + +Call the `jack` method with a config object, and then chain +methods off of it. + +At the end, call the `.parse()` method, and you'll get an object +with `positionals` and `values` members. + +Any unrecognized configs or invalid values will throw an error. + +As long as you define configs using object literals, types will +be properly inferred and TypeScript will know what kinds of +things you got. + +If you give it a prefix for environment variables, then defaults +will be read from the environment, and parsed values written back +to it, so you can easily pass configs through to child processes. + +Automatically generates a `usage`/`help` banner by calling the +`.usage()` method. + +Unless otherwise noted, all methods return the object itself. + +## USAGE + +```js +// the minified version has no external deps, typically better +// startup time for CLI tools that would use jackspeak. +import { jack } from 'jackspeak/min' +// this works too: +// const { jack } = require('jackspeak/min') + +const { positionals, values } = jack({ envPrefix: 'FOO' }) + .flag({ + asdf: { description: 'sets the asfd flag', short: 'a', default: true }, + 'no-asdf': { description: 'unsets the asdf flag', short: 'A' }, + foo: { description: 'another boolean', short: 'f' }, + }) + .optList({ + 'ip-addrs': { + description: 'addresses to ip things', + delim: ',', // defaults to '\n' + default: ['127.0.0.1'], + }, + }) + .parse([ + 'some', + 'positional', + '--ip-addrs', + '192.168.0.1', + '--ip-addrs', + '1.1.1.1', + 'args', + '--foo', // sets the foo flag + '-A', // short for --no-asdf, sets asdf flag to false + ]) + +console.log(process.env.FOO_ASDF) // '0' +console.log(process.env.FOO_FOO) // '1' +console.log(values) // { +// 'ip-addrs': ['192.168.0.1', '1.1.1.1'], +// foo: true, +// asdf: false, +// } +console.log(process.env.FOO_IP_ADDRS) // '192.168.0.1,1.1.1.1' +console.log(positionals) // ['some', 'positional', 'args'] +``` + +## `jack(options: JackOptions = {}) => Jack` + +Returns a `Jack` object that can be used to chain and add +field definitions. The other methods (apart from `validate()`, +`parse()`, and `usage()` obviously) return the same Jack object, +updated with the new types, so they can be chained together as +shown in the code examples. + +Options: + +- `allowPositionals` Defaults to true. Set to `false` to not + allow any positional arguments. + +- `envPrefix` Set to a string to write configs to and read + configs from the environment. For example, if set to `MY_APP` + then the `foo-bar` config will default based on the value of + `env.MY_APP_FOO_BAR` and will write back to that when parsed. + + Boolean values are written as `'1'` and `'0'`, and will be + treated as `true` if they're `'1'` or false otherwise. + + Number values are written with their `toString()` + representation. + + Strings are just strings. + + Any value with `multiple: true` will be represented in the + environment split by a delimiter, which defaults to `\n`. + +- `env` The place to read/write environment variables. Defaults + to `process.env`. + +- `usage` A short usage string to print at the top of the help + banner. + +- `stopAtPositional` Boolean, default false. Stop parsing opts + and flags at the first positional argument. This is useful if + you want to pass certain options to subcommands, like some + programs do, so you can stop parsing and pass the positionals + to the subcommand to parse. + +- `stopAtPositionalTest` Conditional `stopAtPositional`. Provide + a function that takes a positional argument string and returns + boolean. If it returns `true`, then parsing will stop. Useful + when _some_ subcommands should parse the rest of the command + line options, and others should not. + +### `Jack.heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6)` + +Define a short string heading, used in the `usage()` output. + +Indentation of the heading and subsequent description/config +usage entries (up until the next heading) is set by the heading +level. + +If the first usage item defined is a heading, it is always +treated as level 1, regardless of the argument provided. + +Headings level 1 and 2 will have a line of padding underneath +them. Headings level 3 through 6 will not. + +### `Jack.description(text: string, { pre?: boolean } = {})` + +Define a long string description, used in the `usage()` output. + +If the `pre` option is set to `true`, then whitespace will not be +normalized. However, if any line is too long for the width +allotted, it will still be wrapped. + +## Option Definitions + +Configs are defined by calling the appropriate field definition +method with an object where the keys are the long option name, +and the value defines the config. + +Options: + +- `type` Only needed for the `addFields` method, as the others + set it implicitly. Can be `'string'`, `'boolean'`, or + `'number'`. +- `multiple` Only needed for the `addFields` method, as the + others set it implicitly. Set to `true` to define an array + type. This means that it can be set on the CLI multiple times, + set as an array in the `values` + and it is represented in the environment as a delimited string. +- `short` A one-character shorthand for the option. +- `description` Some words to describe what this option is and + why you'd set it. +- `hint` (Only relevant for non-boolean types) The thing to show + in the usage output, like `--option=` +- `validate` A function that returns false (or throws) if an + option value is invalid. +- `validOptions` An array of strings or numbers that define the + valid values that can be set. This is not allowed on `boolean` + (flag) options. May be used along with a `validate()` method. +- `default` A default value for the field. Note that this may be + overridden by an environment variable, if present. + +### `Jack.flag({ [option: string]: definition, ... })` + +Define one or more boolean fields. + +Boolean options may be set to `false` by using a +`--no-${optionName}` argument, which will be implicitly created +if it's not defined to be something else. + +If a boolean option named `no-${optionName}` with the same +`multiple` setting is in the configuration, then that will be +treated as a negating flag. + +### `Jack.flagList({ [option: string]: definition, ... })` + +Define one or more boolean array fields. + +### `Jack.num({ [option: string]: definition, ... })` + +Define one or more number fields. These will be set in the +environment as a stringified number, and included in the `values` +object as a number. + +### `Jack.numList({ [option: string]: definition, ... })` + +Define one or more number list fields. These will be set in the +environment as a delimited set of stringified numbers, and +included in the `values` as a number array. + +### `Jack.opt({ [option: string]: definition, ... })` + +Define one or more string option fields. + +### `Jack.optList({ [option: string]: definition, ... })` + +Define one or more string list fields. + +### `Jack.addFields({ [option: string]: definition, ... })` + +Define one or more fields of any type. Note that `type` and +`multiple` must be set explicitly on each definition when using +this method. + +## Informative Getters + +Once you've defined several fields with the various methods +described above, you can get at the definitions and such with +these methods. + +This are primarily just informative, but can be useful in some +advanced scenarios, such as providing "Did you mean?" type +suggestions when someone misspells an option name. + +### `Jack.definitions` + +The set of config field definitions in no particular order. This +is a data object suitable to passing to `util.parseArgs`, but +with the addition of `short` and `description` fields, where +appropriate. + +### `Jack.jackOptions` + +The options passed into the initial `jack()` function (or `new +Jack()` constructor). + +### `Jack.shorts` + +The `{ : }` name record for all short options +defined. + +### `Jack.usageFields` + +The array of fields that are used to generate `Jack.usage()` and +`Jack.usageMarkdown()` content. + +## Actions + +Use these methods on a Jack object that's already had its config +fields defined. + +### `Jack.parse(args: string[] = process.argv): { positionals: string[], values: OptionsResults }` + +Parse the arguments list, write to the environment if `envPrefix` +is set, and returned the parsed values and remaining positional +arguments. + +### `Jack.validate(o: unknown): asserts o is OptionsResults` + +Throws an error if the object provided is not a valid result set, +for the configurations defined thusfar. + +### `Jack.usage(): string` + +Returns the compiled `usage` string, with all option descriptions +and heading/description text, wrapped to the appropriate width +for the terminal. + +### `Jack.setConfigValues(options: OptionsResults, src?: string)` + +Validate the `options` argument, and set the default value for +each field that appears in the options. + +Values provided will be overridden by environment variables or +command line arguments. + +### `Jack.usageMarkdown(): string` + +Returns the compiled `usage` string, with all option descriptions +and heading/description text, but as markdown instead of +formatted for a terminal, for generating HTML documentation for +your CLI. + +## Some Example Code + +Also see [the examples +folder](https://github.com/isaacs/jackspeak/tree/master/examples) + +```js +// the minified version has no external deps, typically better +// startup time for CLI tools that would use jackspeak. +// but `import { jack } from 'jackspeak'` also works fine. +import { jack } from 'jackspeak/min' + +const j = jack({ + // Optional + // This will be auto-generated from the descriptions if not supplied + // top level usage line, printed by -h + // will be auto-generated if not specified + usage: 'foo [options] ', +}) + .heading('The best Foo that ever Fooed') + .description( + ` + Executes all the files and interprets their output as + TAP formatted test result data. + + To parse TAP data from stdin, specify "-" as a filename. + `, + ) + + // flags don't take a value, they're boolean on or off, and can be + // turned off by prefixing with `--no-` + // so this adds support for -b to mean --bail, or -B to mean --no-bail + .flag({ + flag: { + // specify a short value if you like. this must be a single char + short: 'f', + // description is optional as well. + description: `Make the flags wave`, + // default value for flags is 'false', unless you change it + default: true, + }, + 'no-flag': { + // you can can always negate a flag with `--no-flag` + // specifying a negate option will let you define a short + // single-char option for negation. + short: 'F', + description: `Do not wave the flags`, + }, + }) + + // Options that take a value are specified with `opt()` + .opt({ + reporter: { + short: 'R', + description: 'the style of report to display', + }, + }) + + // if you want a number, say so, and jackspeak will enforce it + .num({ + jobs: { + short: 'j', + description: 'how many jobs to run in parallel', + default: 1, + }, + }) + + // A list is an option that can be specified multiple times, + // to expand into an array of all the settings. Normal opts + // will just give you the last value specified. + .optList({ + 'node-arg': {}, + }) + + // a flagList is an array of booleans, so `-ddd` is [true, true, true] + // count the `true` values to treat it as a counter. + .flagList({ + debug: { short: 'd' }, + }) + + // opts take a value, and is set to the string in the results + // you can combine multiple short-form flags together, but + // an opt will end the combine chain, posix-style. So, + // -bofilename would be like --bail --output-file=filename + .opt({ + 'output-file': { + short: 'o', + // optional: make it -o in the help output insead of -o + hint: 'file', + description: `Send the raw output to the specified file.`, + }, + }) + +// now we can parse argv like this: +const { values, positionals } = j.parse(process.argv) + +// or decide to show the usage banner +console.log(j.usage()) + +// or validate an object config we got from somewhere else +try { + j.validate(someConfig) +} catch (er) { + console.error('someConfig is not valid!', er) +} +``` + +## Name + +The inspiration for this module is [yargs](http://npm.im/yargs), which +is pirate talk themed. Yargs has all the features, and is infinitely +flexible. "Jackspeak" is the slang of the royal navy. This module +does not have all the features. It is declarative and rigid by design. diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61780384c6a0ed43b60dfc8f111723ac03e254bb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts @@ -0,0 +1,323 @@ +import { inspect, InspectOptions, ParseArgsConfig } from 'node:util'; +export type ParseArgsOptions = Exclude; +export type ParseArgsOption = ParseArgsOptions[string]; +export type ParseArgsDefault = Exclude; +export type ConfigType = 'number' | 'string' | 'boolean'; +export declare const isConfigType: (t: unknown) => t is ConfigType; +export type ConfigValuePrimitive = string | boolean | number; +export type ConfigValueArray = string[] | boolean[] | number[]; +export type ConfigValue = ConfigValuePrimitive | ConfigValueArray; +/** + * Given a Jack object, get the typeof its ConfigSet + */ +export type Unwrap = J extends Jack ? C : never; +/** + * Defines the type of value that is valid, given a config definition's + * {@link ConfigType} and boolean multiple setting + */ +export type ValidValue = [ + T, + M +] extends ['number', true] ? number[] : [T, M] extends ['string', true] ? string[] : [T, M] extends ['boolean', true] ? boolean[] : [T, M] extends ['number', false] ? number : [T, M] extends ['string', false] ? string : [T, M] extends ['boolean', false] ? boolean : [T, M] extends ['string', boolean] ? string | string[] : [T, M] extends ['boolean', boolean] ? boolean | boolean[] : [T, M] extends ['number', boolean] ? number | number[] : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive : [T, M] extends [ConfigType, true] ? ConfigValueArray : ConfigValue; +export type ReadonlyArrays = readonly number[] | readonly string[]; +/** + * Defines the type of validOptions that are valid, given a config definition's + * {@link ConfigType} + */ +export type ValidOptions = T extends 'boolean' ? undefined : T extends 'string' ? readonly string[] : T extends 'number' ? readonly number[] : ReadonlyArrays; +/** + * A config field definition, in its full representation. + * This is what is passed in to addFields so `type` is required. + */ +export type ConfigOption = undefined | ValidOptions> = { + type: T; + short?: string; + default?: ValidValue & (O extends ReadonlyArrays ? M extends false ? O[number] : O[number][] : unknown); + description?: string; + hint?: T extends 'boolean' ? undefined : string; + validate?: ((v: unknown) => v is ValidValue) | ((v: unknown) => boolean); + validOptions?: O; + delim?: M extends false ? undefined : string; + multiple?: M; +}; +/** + * Determine whether an unknown object is a {@link ConfigOption} based only + * on its `type` and `multiple` property + */ +export declare const isConfigOptionOfType: (o: unknown, type: T, multi: M) => o is ConfigOption; +/** + * Determine whether an unknown object is a {@link ConfigOption} based on + * it having all valid properties + */ +export declare const isConfigOption: (o: unknown, type: T, multi: M) => o is ConfigOption; +/** + * The meta information for a config option definition, when the + * type and multiple values can be inferred by the method being used + */ +export type ConfigOptionMeta = ConfigOption> = Pick, 'type'> & Omit; +/** + * A set of {@link ConfigOption} objects, referenced by their longOption + * string values. + */ +export type ConfigSet = { + [longOption: string]: ConfigOption; +}; +/** + * A set of {@link ConfigOptionMeta} fields, referenced by their longOption + * string values. + */ +export type ConfigMetaSet = { + [longOption: string]: ConfigOptionMeta; +}; +/** + * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet} + */ +export type ConfigSetFromMetaSet> = S & { + [longOption in keyof S]: ConfigOption; +}; +/** + * The 'values' field returned by {@link Jack#parse}. If a value has + * a default field it will be required on the object otherwise it is optional. + */ +export type OptionsResults = { + [K in keyof T]: (T[K]['validOptions'] extends ReadonlyArrays ? T[K] extends ConfigOption<'string' | 'number', false> ? T[K]['validOptions'][number] : T[K] extends ConfigOption<'string' | 'number', true> ? T[K]['validOptions'][number][] : never : T[K] extends ConfigOption<'string', false> ? string : T[K] extends ConfigOption<'string', true> ? string[] : T[K] extends ConfigOption<'number', false> ? number : T[K] extends ConfigOption<'number', true> ? number[] : T[K] extends ConfigOption<'boolean', false> ? boolean : T[K] extends ConfigOption<'boolean', true> ? boolean[] : never) | (T[K]['default'] extends ConfigValue ? never : undefined); +}; +/** + * The object retured by {@link Jack#parse} + */ +export type Parsed = { + values: OptionsResults; + positionals: string[]; +}; +/** + * A row used when generating the {@link Jack#usage} string + */ +export interface Row { + left?: string; + text: string; + skipLine?: boolean; + type?: string; +} +/** + * A heading for a section in the usage, created by the jack.heading() + * method. + * + * First heading is always level 1, subsequent headings default to 2. + * + * The level of the nearest heading level sets the indentation of the + * description that follows. + */ +export interface Heading extends Row { + type: 'heading'; + text: string; + left?: ''; + skipLine?: boolean; + level: number; + pre?: boolean; +} +/** + * An arbitrary blob of text describing some stuff, set by the + * jack.description() method. + * + * Indentation determined by level of the nearest header. + */ +export interface Description extends Row { + type: 'description'; + text: string; + left?: ''; + skipLine?: boolean; + pre?: boolean; +} +/** + * A heading or description row used when generating the {@link Jack#usage} + * string + */ +export type TextRow = Heading | Description; +/** + * Either a {@link TextRow} or a reference to a {@link ConfigOption} + */ +export type UsageField = TextRow | { + type: 'config'; + name: string; + value: ConfigOption; +}; +/** + * Options provided to the {@link Jack} constructor + */ +export interface JackOptions { + /** + * Whether to allow positional arguments + * + * @default true + */ + allowPositionals?: boolean; + /** + * Prefix to use when reading/writing the environment variables + * + * If not specified, environment behavior will not be available. + */ + envPrefix?: string; + /** + * Environment object to read/write. Defaults `process.env`. + * No effect if `envPrefix` is not set. + */ + env?: Record; + /** + * A short usage string. If not provided, will be generated from the + * options provided, but that can of course be rather verbose if + * there are a lot of options. + */ + usage?: string; + /** + * Stop parsing flags and opts at the first positional argument. + * This is to support cases like `cmd [flags] [options]`, where + * each subcommand may have different options. This effectively treats + * any positional as a `--` argument. Only relevant if `allowPositionals` + * is true. + * + * To do subcommands, set this option, look at the first positional, and + * parse the remaining positionals as appropriate. + * + * @default false + */ + stopAtPositional?: boolean; + /** + * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function, + * will be called with each positional argument encountered. If the function + * returns true, then parsing will stop at that point. + */ + stopAtPositionalTest?: (arg: string) => boolean; +} +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export declare class Jack { + #private; + constructor(options?: JackOptions); + /** + * Resulting definitions, suitable to be passed to Node's `util.parseArgs`, + * but also including `description` and `short` fields, if set. + */ + get definitions(): C; + /** map of `{ : }` strings for each short name defined */ + get shorts(): Record; + /** + * options passed to the {@link Jack} constructor + */ + get jackOptions(): JackOptions; + /** + * the data used to generate {@link Jack#usage} and + * {@link Jack#usageMarkdown} content. + */ + get usageFields(): UsageField[]; + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values: Partial>, source?: string): this; + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args?: string[]): Parsed; + loadEnvDefaults(): void; + applyDefaults(p: Parsed): void; + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args: string[]): Parsed; + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o: unknown): asserts o is Parsed['values']; + writeEnv(p: Parsed): void; + /** + * Add a heading to the usage output banner + */ + heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add a long-form description to the usage output at this position. + */ + description(text: string, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add one or more number fields. + */ + num>(fields: F): Jack>; + /** + * Add one or more multiple number fields. + */ + numList>(fields: F): Jack>; + /** + * Add one or more string option fields. + */ + opt>(fields: F): Jack>; + /** + * Add one or more multiple string option fields. + */ + optList>(fields: F): Jack>; + /** + * Add one or more flag fields. + */ + flag>(fields: F): Jack>; + /** + * Add one or more multiple flag fields. + */ + flagList>(fields: F): Jack>; + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields: F): Jack; + /** + * Return the usage banner for the given configuration + */ + usage(): string; + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown(): string; + /** + * Return the configuration options as a plain object + */ + toJSON(): { + [k: string]: { + hint?: string | undefined; + default?: ConfigValue | undefined; + validOptions?: readonly number[] | readonly string[] | undefined; + validate?: ((v: unknown) => boolean) | ((v: unknown) => v is ConfigValue) | undefined; + description?: string | undefined; + short?: string | undefined; + delim?: string | undefined; + multiple?: boolean | undefined; + type: ConfigType; + }; + }; + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_: number, options: InspectOptions): string; +} +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export declare const jack: (options?: JackOptions) => Jack<{}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4c2b9e34d4a5d22119f2536738e72f2c4685d422 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EAEd,eAAe,EAChB,MAAM,WAAW,CAAA;AAKlB,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,eAAe,CAAC,SAAS,CAAC,EAC1B,SAAS,CACV,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;AAEtE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExD,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,UAEQ,CAAA;AAEvD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAC5D,MAAM,MAAM,gBAAgB,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,OAAO,GAAG,OAAO,IAE3B;IAAC,CAAC;IAAE,CAAC;CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GACxC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MA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AAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAGpD;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,aAAsB,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..63f94452d8c988e789ad07ad41a13ad298499361 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js @@ -0,0 +1,944 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jack = exports.Jack = exports.isConfigOption = exports.isConfigOptionOfType = exports.isConfigType = void 0; +const node_util_1 = require("node:util"); +const min_1 = require("@isaacs/cliui/min"); +const node_path_1 = require("node:path"); +const isConfigType = (t) => typeof t === 'string' && + (t === 'string' || t === 'number' || t === 'boolean'); +exports.isConfigType = isConfigType; +const isValidValue = (v, type, multi) => { + if (multi) { + if (!Array.isArray(v)) + return false; + return !v.some((v) => !isValidValue(v, type, false)); + } + if (Array.isArray(v)) + return false; + return typeof v === type; +}; +const isValidOption = (v, vo) => !!vo && + (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v)); +/** + * Determine whether an unknown object is a {@link ConfigOption} based only + * on its `type` and `multiple` property + */ +const isConfigOptionOfType = (o, type, multi) => !!o && + typeof o === 'object' && + 'type' in o && + (0, exports.isConfigType)(o.type) && + o.type === type && + !!o.multiple === multi; +exports.isConfigOptionOfType = isConfigOptionOfType; +/** + * Determine whether an unknown object is a {@link ConfigOption} based on + * it having all valid properties + */ +const isConfigOption = (o, type, multi) => (0, exports.isConfigOptionOfType)(o, type, multi) && + undefOrType(o.short, 'string') && + undefOrType(o.description, 'string') && + undefOrType(o.hint, 'string') && + undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && + (o.default === undefined || isValidValue(o.default, type, multi)); +exports.isConfigOption = isConfigOption; +const isHeading = (r) => r.type === 'heading'; +const isDescription = (r) => r.type === 'description'; +const width = Math.min(process?.stdout?.columns ?? 80, 80); +// indentation spaces from heading level +const indent = (n) => (n - 1) * 2; +const toEnvKey = (pref, key) => [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')] + .join(' ') + .trim() + .toUpperCase() + .replace(/ /g, '_'); +const toEnvVal = (value, delim = '\n') => { + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' + : '0' + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; + if (typeof str !== 'string') { + throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`, { cause: { code: 'JACKSPEAK' } }); + } + /* c8 ignore stop */ + return str; +}; +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] + : type === 'string' ? env + : type === 'boolean' ? env === '1' + : +env.trim()); +const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +// print the value type, for error message reporting +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]` + : `${v.type}${v.multiple ? '[]' : ''}`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] + : `(${types.join('|')})`; +const validateFieldMeta = (field, fieldMeta) => { + if (fieldMeta) { + if (field.type !== undefined && field.type !== fieldMeta.type) { + throw new TypeError(`invalid type`, { + cause: { + found: field.type, + wanted: [fieldMeta.type, undefined], + }, + }); + } + if (field.multiple !== undefined && + !!field.multiple !== fieldMeta.multiple) { + throw new TypeError(`invalid multiple`, { + cause: { + found: field.multiple, + wanted: [fieldMeta.multiple, undefined], + }, + }); + } + return fieldMeta; + } + if (!(0, exports.isConfigType)(field.type)) { + throw new TypeError(`invalid type`, { + cause: { + found: field.type, + wanted: ['string', 'number', 'boolean'], + }, + }); + } + return { + type: field.type, + multiple: !!field.multiple, + }; +}; +const validateField = (o, type, multiple) => { + const validateValidOptions = (def, validOptions) => { + if (!undefOrTypeArray(validOptions, type)) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: valueType({ type, multiple: true }), + }, + }); + } + if (def !== undefined && validOptions !== undefined) { + const valid = Array.isArray(def) ? + def.every(v => validOptions.includes(v)) + : validOptions.includes(def); + if (!valid) { + throw new TypeError('invalid default value not in validOptions', { + cause: { + found: def, + wanted: validOptions, + }, + }); + } + } + }; + if (o.default !== undefined && + !isValidValue(o.default, type, multiple)) { + throw new TypeError('invalid default value', { + cause: { + found: o.default, + wanted: valueType({ type, multiple }), + }, + }); + } + if ((0, exports.isConfigOptionOfType)(o, 'number', false) || + (0, exports.isConfigOptionOfType)(o, 'number', true)) { + validateValidOptions(o.default, o.validOptions); + } + else if ((0, exports.isConfigOptionOfType)(o, 'string', false) || + (0, exports.isConfigOptionOfType)(o, 'string', true)) { + validateValidOptions(o.default, o.validOptions); + } + else if ((0, exports.isConfigOptionOfType)(o, 'boolean', false) || + (0, exports.isConfigOptionOfType)(o, 'boolean', true)) { + if (o.hint !== undefined) { + throw new TypeError('cannot provide hint for flag'); + } + if (o.validOptions !== undefined) { + throw new TypeError('cannot provide validOptions for flag'); + } + } + return o; +}; +const toParseArgsOptionsConfig = (options) => { + return Object.entries(options).reduce((acc, [longOption, o]) => { + const p = { + type: 'string', + multiple: !!o.multiple, + ...(typeof o.short === 'string' ? { short: o.short } : undefined), + }; + const setNoBool = () => { + if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) { + acc[`no-${longOption}`] = { + type: 'boolean', + multiple: !!o.multiple, + }; + } + }; + const setDefault = (def, fn) => { + if (def !== undefined) { + p.default = fn(def); + } + }; + if ((0, exports.isConfigOption)(o, 'number', false)) { + setDefault(o.default, String); + } + else if ((0, exports.isConfigOption)(o, 'number', true)) { + setDefault(o.default, d => d.map(v => String(v))); + } + else if ((0, exports.isConfigOption)(o, 'string', false) || + (0, exports.isConfigOption)(o, 'string', true)) { + setDefault(o.default, v => v); + } + else if ((0, exports.isConfigOption)(o, 'boolean', false) || + (0, exports.isConfigOption)(o, 'boolean', true)) { + p.type = 'boolean'; + setDefault(o.default, v => v); + setNoBool(); + } + acc[longOption] = p; + return acc; + }, {}); +}; +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +class Jack { + #configSet; + #shorts; + #options; + #fields = []; + #env; + #envPrefix; + #allowPositionals; + #usage; + #usageMarkdown; + constructor(options = {}) { + this.#options = options; + this.#allowPositionals = options.allowPositionals !== false; + this.#env = + this.#options.env === undefined ? process.env : this.#options.env; + this.#envPrefix = options.envPrefix; + // We need to fib a little, because it's always the same object, but it + // starts out as having an empty config set. Then each method that adds + // fields returns `this as Jack` + this.#configSet = Object.create(null); + this.#shorts = Object.create(null); + } + /** + * Resulting definitions, suitable to be passed to Node's `util.parseArgs`, + * but also including `description` and `short` fields, if set. + */ + get definitions() { + return this.#configSet; + } + /** map of `{ : }` strings for each short name defined */ + get shorts() { + return this.#shorts; + } + /** + * options passed to the {@link Jack} constructor + */ + get jackOptions() { + return this.#options; + } + /** + * the data used to generate {@link Jack#usage} and + * {@link Jack#usageMarkdown} content. + */ + get usageFields() { + return this.#fields; + } + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values, source = '') { + try { + this.validate(values); + } + catch (er) { + if (source && er instanceof Error) { + /* c8 ignore next */ + const cause = typeof er.cause === 'object' ? er.cause : {}; + er.cause = { ...cause, path: source }; + Error.captureStackTrace(er, this.setConfigValues); + } + throw er; + } + for (const [field, value] of Object.entries(values)) { + const my = this.#configSet[field]; + // already validated, just for TS's benefit + /* c8 ignore start */ + if (!my) { + throw new Error('unexpected field in config set: ' + field, { + cause: { + code: 'JACKSPEAK', + found: field, + }, + }); + } + /* c8 ignore stop */ + my.default = value; + } + return this; + } + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args = process.argv) { + this.loadEnvDefaults(); + const p = this.parseRaw(args); + this.applyDefaults(p); + this.writeEnv(p); + return p; + } + loadEnvDefaults() { + if (this.#envPrefix) { + for (const [field, my] of Object.entries(this.#configSet)) { + const ek = toEnvKey(this.#envPrefix, field); + const env = this.#env[ek]; + if (env !== undefined) { + my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim); + } + } + } + } + applyDefaults(p) { + for (const [field, c] of Object.entries(this.#configSet)) { + if (c.default !== undefined && !(field in p.values)) { + //@ts-ignore + p.values[field] = c.default; + } + } + } + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args) { + if (args === process.argv) { + args = args.slice(process._eval !== undefined ? 1 : 2); + } + const result = (0, node_util_1.parseArgs)({ + args, + options: toParseArgsOptionsConfig(this.#configSet), + // always strict, but using our own logic + strict: false, + allowPositionals: this.#allowPositionals, + tokens: true, + }); + const p = { + values: {}, + positionals: [], + }; + for (const token of result.tokens) { + if (token.kind === 'positional') { + p.positionals.push(token.value); + if (this.#options.stopAtPositional || + this.#options.stopAtPositionalTest?.(token.value)) { + p.positionals.push(...args.slice(token.index + 1)); + break; + } + } + else if (token.kind === 'option') { + let value = undefined; + if (token.name.startsWith('no-')) { + const my = this.#configSet[token.name]; + const pname = token.name.substring('no-'.length); + const pos = this.#configSet[pname]; + if (pos && + pos.type === 'boolean' && + (!my || + (my.type === 'boolean' && !!my.multiple === !!pos.multiple))) { + value = false; + token.name = pname; + } + } + const my = this.#configSet[token.name]; + if (!my) { + throw new Error(`Unknown option '${token.rawName}'. ` + + `To specify a positional argument starting with a '-', ` + + `place it at the end of the command after '--', as in ` + + `'-- ${token.rawName}'`, { + cause: { + code: 'JACKSPEAK', + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); + } + if (value === undefined) { + if (token.value === undefined) { + if (my.type !== 'boolean') { + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + code: 'JACKSPEAK', + name: token.rawName, + wanted: valueType(my), + }, + }); + } + value = true; + } + else { + if (my.type === 'boolean') { + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { code: 'JACKSPEAK', found: token } }); + } + if (my.type === 'string') { + value = token.value; + } + else { + value = +token.value; + if (value !== value) { + throw new Error(`Invalid value '${token.value}' provided for ` + + `'${token.rawName}' option, expected number`, { + cause: { + code: 'JACKSPEAK', + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); + } + } + } + } + if (my.multiple) { + const pv = p.values; + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); + } + else { + const pv = p.values; + pv[token.name] = value; + } + } + } + for (const [field, value] of Object.entries(p.values)) { + const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + const cause = validOptions && !isValidOption(value, validOptions) ? + { name: field, found: value, validOptions } + : valid && !valid(value) ? { name: field, found: value } + : undefined; + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause: { ...cause, code: 'JACKSPEAK' } }); + } + } + return p; + } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // recurse so we get the core config key we care about. + this.#noNoFields(yes, val, s); + if (this.#configSet[yes]?.type === 'boolean') { + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { code: 'JACKSPEAK', found: s, wanted: yes } }); + } + } + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o) { + if (!o || typeof o !== 'object') { + throw new Error('Invalid config: not an object', { + cause: { code: 'JACKSPEAK', found: o }, + }); + } + const opts = o; + for (const field in o) { + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); + const config = this.#configSet[field]; + if (!config) { + throw new Error(`Unknown config option: ${field}`, { + cause: { code: 'JACKSPEAK', found: field }, + }); + } + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + code: 'JACKSPEAK', + name: field, + found: value, + wanted: valueType(config), + }, + }); + } + const cause = config.validOptions && !isValidOption(value, config.validOptions) ? + { name: field, found: value, validOptions: config.validOptions } + : config.validate && !config.validate(value) ? + { name: field, found: value } + : undefined; + if (cause) { + throw new Error(`Invalid config value for ${field}: ${JSON.stringify(value)}`, { + cause: { ...cause, code: 'JACKSPEAK' }, + }); + } + } + } + writeEnv(p) { + if (!this.#env || !this.#envPrefix) + return; + for (const [field, value] of Object.entries(p.values)) { + const my = this.#configSet[field]; + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); + } + } + /** + * Add a heading to the usage output banner + */ + heading(text, level, { pre = false } = {}) { + if (level === undefined) { + level = this.#fields.some(r => isHeading(r)) ? 2 : 1; + } + this.#fields.push({ type: 'heading', text, level, pre }); + return this; + } + /** + * Add a long-form description to the usage output at this position. + */ + description(text, { pre } = {}) { + this.#fields.push({ type: 'description', text, pre }); + return this; + } + /** + * Add one or more number fields. + */ + num(fields) { + return this.#addFieldsWith(fields, 'number', false); + } + /** + * Add one or more multiple number fields. + */ + numList(fields) { + return this.#addFieldsWith(fields, 'number', true); + } + /** + * Add one or more string option fields. + */ + opt(fields) { + return this.#addFieldsWith(fields, 'string', false); + } + /** + * Add one or more multiple string option fields. + */ + optList(fields) { + return this.#addFieldsWith(fields, 'string', true); + } + /** + * Add one or more flag fields. + */ + flag(fields) { + return this.#addFieldsWith(fields, 'boolean', false); + } + /** + * Add one or more multiple flag fields. + */ + flagList(fields) { + return this.#addFieldsWith(fields, 'boolean', true); + } + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields) { + return this.#addFields(this, fields); + } + #addFieldsWith(fields, type, multiple) { + return this.#addFields(this, fields, { + type, + multiple, + }); + } + #addFields(next, fields, opt) { + Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => { + this.#validateName(name, field); + const { type, multiple } = validateFieldMeta(field, opt); + const value = { ...field, type, multiple }; + validateField(value, type, multiple); + next.#fields.push({ type: 'config', name, value }); + return [name, value]; + }))); + return next; + } + #validateName(name, field) { + if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) { + throw new TypeError(`Invalid option name: ${name}, ` + + `must be '-' delimited ASCII alphanumeric`); + } + if (this.#configSet[name]) { + throw new TypeError(`Cannot redefine option ${name}`); + } + if (this.#shorts[name]) { + throw new TypeError(`Cannot redefine option ${name}, already ` + + `in use for ${this.#shorts[name]}`); + } + if (field.short) { + if (!/^[a-zA-Z0-9]$/.test(field.short)) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + 'must be 1 ASCII alphanumeric character'); + } + if (this.#shorts[field.short]) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + `already in use for ${this.#shorts[field.short]}`); + } + this.#shorts[field.short] = name; + this.#shorts[name] = name; + } + } + /** + * Return the usage banner for the given configuration + */ + usage() { + if (this.#usage) + return this.#usage; + let headingLevel = 1; + //@ts-ignore + const ui = (0, min_1.cliui)({ width }); + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + ui.div({ + padding: [0, 0, 0, 0], + text: normalize(first.text), + }); + } + ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' }); + if (this.#options.usage) { + ui.div({ + text: this.#options.usage, + padding: [0, 0, 0, 2], + }); + } + else { + const cmd = (0, node_path_1.basename)(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + ui.div({ + text: usage, + padding: [0, 0, 0, 2], + }); + } + ui.div({ padding: [0, 0, 0, 0], text: '' }); + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + const print = normalize(maybeDesc.text, maybeDesc.pre); + start++; + ui.div({ padding: [0, 0, 0, 0], text: print }); + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = (0, node_path_1.basename)(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { + // turn each config type into a row, and figure out the width of the + // left hand indentation for the option descriptions. + const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); + let maxWidth = 8; + let prev = undefined; + const rows = []; + for (const field of this.#fields.slice(start)) { + if (field.type !== 'config') { + if (prev?.type === 'config') + prev.skipLine = true; + prev = undefined; + field.text = normalize(field.text, !!field.pre); + rows.push(field); + continue; + } + const { value } = field; + const desc = value.description || ''; + const mult = value.multiple ? 'Can be set multiple times' : ''; + const opts = value.validOptions?.length ? + 'Valid options: ' + + value.validOptions.map(v => JSON.stringify(v)).join(', ') + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); + const hint = value.hint || + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name + : undefined); + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` + : `-${value.short}<${hint}> `; + const left = value.type === 'boolean' ? + `${short}--${field.name}` + : `${short}--${field.name}=<${hint}>`; + const row = { text, left, type: 'config' }; + if (text.length > width - maxMax) { + row.skipLine = true; + } + if (prev && left.length > maxMax) + prev.skipLine = true; + prev = row; + const len = left.length + 4; + if (len > maxWidth && len < maxMax) { + maxWidth = len; + } + rows.push(row); + } + return { rows, maxWidth }; + } + /** + * Return the configuration options as a plain object + */ + toJSON() { + return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [ + field, + { + type: def.type, + ...(def.multiple ? { multiple: true } : {}), + ...(def.delim ? { delim: def.delim } : {}), + ...(def.short ? { short: def.short } : {}), + ...(def.description ? + { description: normalize(def.description) } + : {}), + ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), + ...(def.default !== undefined ? { default: def.default } : {}), + ...(def.hint ? { hint: def.hint } : {}), + }, + ])); + } + /** + * Custom printer for `util.inspect` + */ + [node_util_1.inspect.custom](_, options) { + return `Jack ${(0, node_util_1.inspect)(this.toJSON(), options)}`; + } +} +exports.Jack = Jack; +/** + * Main entry point. Create and return a {@link Jack} object. + */ +const jack = (options = {}) => new Jack(options); +exports.jack = jack; +// Unwrap and un-indent, so we can wrap description +// strings however makes them look nice in the code. +const normalize = (s, pre = false) => { + if (pre) + // prepend a ZWSP to each line so cliui doesn't strip it. + return s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n'); + return s + .split(/^\s*```\s*$/gm) + .map((s, i) => { + if (i % 2 === 1) { + if (!s.trim()) { + return `\`\`\`\n\`\`\`\n`; + } + // outdent the ``` blocks, but preserve whitespace otherwise. + const split = s.split('\n'); + // throw out the \n at the start and end + split.pop(); + split.shift(); + const si = split.reduce((shortest, l) => { + /* c8 ignore next */ + const ind = l.match(/^\s*/)?.[0] ?? ''; + if (ind.length) + return Math.min(ind.length, shortest); + else + return shortest; + }, Infinity); + /* c8 ignore next */ + const i = isFinite(si) ? si : 0; + return ('\n```\n' + + split.map(s => `\u200b${s.substring(i)}`).join('\n') + + '\n```\n'); + } + return (s + // remove single line breaks, except for lists + .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) + // normalize mid-line whitespace + .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') + // two line breaks are enough + .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim()); + }) + .join('\n'); +}; +// normalize for markdown printing, remove leading spaces on lines +const normalizeMarkdown = (s, pre = false) => { + const n = normalize(s, pre).replace(/\\/g, '\\\\'); + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') + .trim(); + return pre ? `\`${n}\`` : n; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..0341374b621ee9e35ab5a0fc7326afebea397e15 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAKkB;AAElB,2CAAyC;AACzC,yCAAoC;AAW7B,MAAM,YAAY,GAAG,CAAC,CAAU,EAAmB,EAAE,CAC1D,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,CAAC,CAAA;AAF1C,QAAA,YAAY,gBAE8B;AAgCvD,MAAM,YAAY,GAAG,CACnB,CAAU,EACV,IAAO,EACP,KAAQ,EACe,EAAE;IACzB,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAA;QACnC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAClC,OAAO,OAAO,CAAC,KAAK,IAAI,CAAA;AAC1B,CAAC,CAAA;AAcD,MAAM,aAAa,GAAG,CACpB,CAAU,EACV,EAAsB,EACqB,EAAE,CAC7C,CAAC,CAAC,EAAE;IACJ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,EA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C;SAC5B,IAAI,EAAE,CAAA;IACT,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA","sourcesContent":["import {\n inspect,\n InspectOptions,\n parseArgs,\n ParseArgsConfig,\n} from 'node:util'\n\nimport { cliui } from '@isaacs/cliui/min'\nimport { basename } from 'node:path'\n\nexport type ParseArgsOptions = Exclude<\n ParseArgsConfig['options'],\n undefined\n>\nexport type ParseArgsOption = ParseArgsOptions[string]\nexport type ParseArgsDefault = Exclude\n\nexport type ConfigType = 'number' | 'string' | 'boolean'\n\nexport const isConfigType = (t: unknown): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nexport type ConfigValuePrimitive = string | boolean | number\nexport type ConfigValueArray = string[] | boolean[] | number[]\nexport type ConfigValue = ConfigValuePrimitive | ConfigValueArray\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive\n : [T, M] extends [ConfigType, true] ? ConfigValueArray\n : ConfigValue\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport type ReadonlyArrays = readonly number[] | readonly string[]\n\n/**\n * Defines the type of validOptions that are valid, given a config definition's\n * {@link ConfigType}\n */\nexport type ValidOptions =\n T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : ReadonlyArrays\n\nconst isValidOption = (\n v: unknown,\n vo: readonly unknown[],\n): vo is Exclude, undefined> =>\n !!vo &&\n (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v))\n\n/**\n * A config field definition, in its full representation.\n * This is what is passed in to addFields so `type` is required.\n */\nexport type ConfigOption<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n O extends undefined | ValidOptions = undefined | ValidOptions,\n> = {\n type: T\n short?: string\n default?: ValidValue &\n (O extends ReadonlyArrays ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown)\n description?: string\n hint?: T extends 'boolean' ? undefined : string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n validOptions?: O\n delim?: M extends false ? undefined : string\n multiple?: M\n}\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based only\n * on its `type` and `multiple` property\n */\nexport const isConfigOptionOfType = <\n T extends ConfigType,\n M extends boolean,\n>(\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n !!o &&\n typeof o === 'object' &&\n 'type' in o &&\n isConfigType(o.type) &&\n o.type === type &&\n !!(o as { multiple?: boolean }).multiple === multi\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based on\n * it having all valid properties\n */\nexport const isConfigOption = (\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n isConfigOptionOfType(o, type, multi) &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi))\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean,\n O extends ConfigOption = ConfigOption,\n> = Pick, 'type'> & Omit\n\n/**\n * A set of {@link ConfigOption} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOption\n}\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = S & { [longOption in keyof S]: ConfigOption }\n\n/**\n * The 'values' field returned by {@link Jack#parse}. If a value has\n * a default field it will be required on the object otherwise it is optional.\n */\nexport type OptionsResults = {\n [K in keyof T]:\n | (T[K]['validOptions'] extends ReadonlyArrays ?\n T[K] extends ConfigOption<'string' | 'number', false> ?\n T[K]['validOptions'][number]\n : T[K] extends ConfigOption<'string' | 'number', true> ?\n T[K]['validOptions'][number][]\n : never\n : T[K] extends ConfigOption<'string', false> ? string\n : T[K] extends ConfigOption<'string', true> ? string[]\n : T[K] extends ConfigOption<'number', false> ? number\n : T[K] extends ConfigOption<'number', true> ? number[]\n : T[K] extends ConfigOption<'boolean', false> ? boolean\n : T[K] extends ConfigOption<'boolean', true> ? boolean[]\n : never)\n | (T[K]['default'] extends ConfigValue ? never : undefined)\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\n\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOption}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOption\n }\n\nconst width = Math.min(process?.stdout?.columns ?? 80, 80)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string =>\n [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n\nconst toEnvVal = (value: ConfigValue, delim: string = '\\n'): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: ConfigValue) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n { cause: { code: 'JACKSPEAK' } },\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\n\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\n// print the value type, for error message reporting\nconst valueType = (\n v: ConfigValue | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]`\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst validateFieldMeta = (\n field: ConfigOptionMeta,\n fieldMeta?: { type: T; multiple: M },\n): { type: ConfigType; multiple: boolean } => {\n if (fieldMeta) {\n if (field.type !== undefined && field.type !== fieldMeta.type) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: [fieldMeta.type, undefined],\n },\n })\n }\n if (\n field.multiple !== undefined &&\n !!field.multiple !== fieldMeta.multiple\n ) {\n throw new TypeError(`invalid multiple`, {\n cause: {\n found: field.multiple,\n wanted: [fieldMeta.multiple, undefined],\n },\n })\n }\n return fieldMeta\n }\n\n if (!isConfigType(field.type)) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: ['string', 'number', 'boolean'],\n },\n })\n }\n\n return {\n type: field.type,\n multiple: !!field.multiple,\n }\n}\n\nconst validateField = (\n o: ConfigOption,\n type: ConfigType,\n multiple: boolean,\n): ConfigOption => {\n const validateValidOptions = <\n T extends ConfigValue | undefined,\n V extends T extends Array ? U : T,\n >(\n def: T | undefined,\n validOptions: readonly V[] | undefined,\n ) => {\n if (!undefOrTypeArray(validOptions, type)) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: valueType({ type, multiple: true }),\n },\n })\n }\n if (def !== undefined && validOptions !== undefined) {\n const valid =\n Array.isArray(def) ?\n def.every(v => validOptions.includes(v as V))\n : validOptions.includes(def as V)\n if (!valid) {\n throw new TypeError('invalid default value not in validOptions', {\n cause: {\n found: def,\n wanted: validOptions,\n },\n })\n }\n }\n }\n\n if (\n o.default !== undefined &&\n !isValidValue(o.default, type, multiple)\n ) {\n throw new TypeError('invalid default value', {\n cause: {\n found: o.default,\n wanted: valueType({ type, multiple }),\n },\n })\n }\n\n if (\n isConfigOptionOfType(o, 'number', false) ||\n isConfigOptionOfType(o, 'number', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'string', false) ||\n isConfigOptionOfType(o, 'string', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'boolean', false) ||\n isConfigOptionOfType(o, 'boolean', true)\n ) {\n if (o.hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n if (o.validOptions !== undefined) {\n throw new TypeError('cannot provide validOptions for flag')\n }\n }\n\n return o\n}\n\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): ParseArgsOptions => {\n return Object.entries(options).reduce((acc, [longOption, o]) => {\n const p: ParseArgsOption = {\n type: 'string',\n multiple: !!o.multiple,\n ...(typeof o.short === 'string' ? { short: o.short } : undefined),\n }\n const setNoBool = () => {\n if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) {\n acc[`no-${longOption}`] = {\n type: 'boolean',\n multiple: !!o.multiple,\n }\n }\n }\n const setDefault = (\n def: T | undefined,\n fn: (d: T) => ParseArgsDefault,\n ) => {\n if (def !== undefined) {\n p.default = fn(def)\n }\n }\n if (isConfigOption(o, 'number', false)) {\n setDefault(o.default, String)\n } else if (isConfigOption(o, 'number', true)) {\n setDefault(o.default, d => d.map(v => String(v)))\n } else if (\n isConfigOption(o, 'string', false) ||\n isConfigOption(o, 'string', true)\n ) {\n setDefault(o.default, v => v)\n } else if (\n isConfigOption(o, 'boolean', false) ||\n isConfigOption(o, 'boolean', true)\n ) {\n p.type = 'boolean'\n setDefault(o.default, v => v)\n setNoBool()\n }\n acc[longOption] = p\n return acc\n }, {} as ParseArgsOptions)\n}\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: Record\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: Record\n #options: JackOptions\n #fields: UsageField[] = []\n #env: Record\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Resulting definitions, suitable to be passed to Node's `util.parseArgs`,\n * but also including `description` and `short` fields, if set.\n */\n get definitions(): C {\n return this.#configSet\n }\n\n /** map of `{ : }` strings for each short name defined */\n get shorts() {\n return this.#shorts\n }\n\n /**\n * options passed to the {@link Jack} constructor\n */\n get jackOptions() {\n return this.#options\n }\n\n /**\n * the data used to generate {@link Jack#usage} and\n * {@link Jack#usageMarkdown} content.\n */\n get usageFields() {\n return this.#fields\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: Partial>, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n if (source && er instanceof Error) {\n /* c8 ignore next */\n const cause = typeof er.cause === 'object' ? er.cause : {}\n er.cause = { ...cause, path: source }\n Error.captureStackTrace(er, this.setConfigValues)\n }\n throw er\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: {\n code: 'JACKSPEAK',\n found: field,\n },\n })\n }\n /* c8 ignore stop */\n my.default = value as ConfigValue\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const result = parseArgs({\n args,\n options: toParseArgsOptionsConfig(this.#configSet),\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {} as OptionsResults,\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: ConfigValue | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n code: 'JACKSPEAK',\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { code: 'JACKSPEAK', found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as Record\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as Record\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n const cause =\n validOptions && !isValidOption(value, validOptions) ?\n { name: field, found: value, validOptions }\n : valid && !valid(value) ? { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(value)}`,\n { cause: { ...cause, code: 'JACKSPEAK' } },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { code: 'JACKSPEAK', found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { code: 'JACKSPEAK', found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { code: 'JACKSPEAK', found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n const cause =\n config.validOptions && !isValidOption(value, config.validOptions) ?\n { name: field, found: value, validOptions: config.validOptions }\n : config.validate && !config.validate(value) ?\n { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid config value for ${field}: ${JSON.stringify(value)}`,\n {\n cause: { ...cause, code: 'JACKSPEAK' },\n },\n )\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value as ConfigValue,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', false)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', true)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', false)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', true)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', false)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', true)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n return this.#addFields(this as unknown as Jack, fields)\n }\n\n #addFieldsWith<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends ConfigSetFromMetaSet,\n >(fields: F, type: ConfigType, multiple: boolean): Jack {\n return this.#addFields(this as unknown as Jack, fields, {\n type,\n multiple,\n })\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends Jack,\n >(next: O, fields: F, opt?: { type: T; multiple: M }): O {\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const { type, multiple } = validateFieldMeta(field, opt)\n const value = { ...field, type, multiple }\n validateField(value, type, multiple)\n next.#fields.push({ type: 'config', name, value })\n return [name, value]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${name}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n //@ts-ignore\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n 'Valid options: ' +\n value.validOptions.map(v => JSON.stringify(v)).join(', ')\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..398c0ad131c6f89ebfd23aca61d80bd4ea463dfa --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js @@ -0,0 +1,33 @@ +"use strict";var FD=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports);var X=FD(W=>{"use strict";var T=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports),sD=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.ansiRegex=void 0;var t=({onlyFirst:i=!1}={})=>{let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,i?void 0:"g")};u.ansiRegex=t}),R=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.stripAnsi=void 0;var t=sD(),i=(0,t.ansiRegex)(),r=e=>e.replace(i,"");u.stripAnsi=r}),oD=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.slice=u.length=u.stringToArray=u.characterLength=u.eastAsianWidth=void 0;var t=s=>{var F=s.charCodeAt(0),o=s.length==2?s.charCodeAt(1):0,D=F;return 55296<=F&&F<=56319&&56320<=o&&o<=57343&&(F&=1023,o&=1023,D=F<<10|o,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"};u.eastAsianWidth=t;var i=s=>{var F=(0,u.eastAsianWidth)(s);return F=="F"||F=="W"||F=="A"?2:1};u.characterLength=i;var r=s=>s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[];u.stringToArray=r;var e=s=>{var F=(0,u.stringToArray)(s),o=0;for(let D of F)o=o+(0,u.characterLength)(D);return o};u.length=e;var n=(s,F,o)=>{let D=(0,u.length)(s);F=F||0,o=o||1,F<0&&(F=D+F),o<0&&(o=D+o);var E="",h=0,f=(0,u.stringToArray)(s);for(let B of f){var c=(0,u.length)(B);if(h>=F-(c==2?1:0))if(h+c<=o)E+=B;else break;h+=c}return E};u.slice=n}),CD=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.emojiRegex=void 0;var t=()=>/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764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]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC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FB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;u.emojiRegex=t}),Y=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.stringWidth=e;var t=R(),i=oD(),r=CD();function e(n,s={}){if(typeof n!="string"||n.length===0||(s={ambiguousIsNarrow:!0,...s},n=(0,t.stripAnsi)(n),n.length===0))return 0;n=n.replace((0,r.emojiRegex)()," ");let F=s.ambiguousIsNarrow?1:2,o=0;for(let D of n){let E=D.codePointAt(0);if(!(!E||E<=31||E>=127&&E<=159||E>=768&&E<=879))switch((0,i.eastAsianWidth)(D)){case"F":case"W":o+=2;break;case"A":o+=F;break;default:o+=1}}return o}}),aD=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.ansiStyles=u.codes=u.colorNames=u.backgroundColorNames=u.foregroundColorNames=u.modifierNames=void 0;var t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.modifierNames=Object.keys(t.modifier),u.foregroundColorNames=Object.keys(t.color),u.backgroundColorNames=Object.keys(t.bgColor),u.colorNames=[...u.foregroundColorNames,...u.backgroundColorNames];var i=class{};u.codes=new Map;var r=e=>Object.fromEntries(Object.entries(e).map(([n,[s,F]])=>(u.codes.set(s,F),[n,i.prototype[n]={open:`\x1B[${s}m`,close:`\x1B[${F}m`}])));u.ansiStyles=new class extends i{codes=u.codes;modifier=r(t.modifier);color={...r(t.color),close:"\x1B[39m",ansi:e=>`\x1B[${e}m`,ansi256:e=>`\x1B[38;5;${e}m`,ansi16m:(e,n,s)=>`\x1B[38;2;${e};${n};${s}m`};bgColor={...r(t.bgColor),close:"\x1B[49m",ansi:e=>`\x1B[${e+10}m`,ansi256:e=>`\x1B[48;5;${e}m`,ansi16m:(e,n,s)=>`\x1B[48;2;${e};${n};${s}m`};rgbToAnsi256(e,n,s){return e===n&&n===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(s/255*5)}hexToRgb(e){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[s]=n;s.length===3&&(s=[...s].map(o=>o+o).join(""));let F=Number.parseInt(s,16);return[F>>16&255,F>>8&255,F&255]}hexToAnsi256(e){return this.rgbToAnsi256(...this.hexToRgb(e))}ansi256ToAnsi(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,s,F;if(e>=232)n=((e-232)*10+8)/255,s=n,F=n;else{e-=16;let E=e%36;n=Math.floor(e/36)/5,s=Math.floor(E/6)/5,F=E%6/5}let o=Math.max(n,s,F)*2;if(o===0)return 30;let D=30+(Math.round(F)<<2|Math.round(s)<<1|Math.round(n));return o===2&&(D+=60),D}rgbToAnsi(e,n,s){return this.ansi256ToAnsi(this.rgbToAnsi256(e,n,s))}hexToAnsi(e){return this.ansi256ToAnsi(this.hexToAnsi256(e))}}}),ED=T(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.wrap=void 0;var t=Y(),i=R(),r=aD(),e=new Set(["\x1B","\x9B"]),n=39,s="\x07",F="[",o="]",D="m",E=`${o}8;;`,h=C=>`${e.values().next().value}${F}${C}${D}`,f=C=>`${e.values().next().value}${E}${C}${s}`,c=C=>C.split(" ").map(a=>(0,t.stringWidth)(a)),B=(C,a,d)=>{let A=[...a],y=!1,x=!1,j=(0,t.stringWidth)((0,i.stripAnsi)(String(C[C.length-1])));for(let[l,v]of A.entries()){let w=(0,t.stringWidth)(v);if(j+w<=d?C[C.length-1]+=v:(C.push(v),j=0),e.has(v)&&(y=!0,x=A.slice(l+1).join("").startsWith(E)),y){x?v===s&&(y=!1,x=!1):v===D&&(y=!1);continue}j+=w,j===d&&l0&&C.length>1&&(C[C.length-2]=String(C[C.length-1])+C.pop())},O=C=>{let a=C.split(" "),d=a.length;for(;d>0&&!((0,t.stringWidth)(String(a[d-1]))>0);)d--;return d===a.length?C:a.slice(0,d).join(" ")+a.slice(d).join("")},$=(C,a,d={})=>{if(d.trim!==!1&&C.trim()==="")return"";let A="",y,x,j=c(C),l=[""];for(let[w,S]of C.split(" ").entries()){d.trim!==!1&&(l[l.length-1]=String(l[l.length-1]).trimStart());let g=(0,t.stringWidth)(String(l[l.length-1]));w!==0&&(g>=a&&(d.wordWrap===!1||d.trim===!1)&&(l.push(""),g=0),(g>0||d.trim===!1)&&(l[l.length-1]+=" ",g++));let m=Number(j[w]);if(d.hard&&m>a){let N=a-g,rD=1+Math.floor((m-N-1)/a);Math.floor((m-1)/a)a&&g>0&&m>0){if(d.wordWrap===!1&&ga&&d.wordWrap===!1){B(l,S,a);continue}l[l.length-1]+=S}d.trim!==!1&&(l=l.map(w=>O(w)));let v=[...l.join(` +`)];for(let[w,S]of v.entries()){if(A+=S,e.has(S)){let{groups:m}=new RegExp(`(?:\\${F}(?\\d+)m|\\${E}(?.*)${s})`).exec(v.slice(w).join(""))||{groups:{}};if(m.code!==void 0){let N=Number.parseFloat(m.code);y=N===n?void 0:N}else m.uri!==void 0&&(x=m.uri.length===0?void 0:m.uri)}let g=r.ansiStyles.codes.get(Number(y));v[w+1]===` +`?(x&&(A+=f("")),y&&g&&(A+=h(g))):S===` +`&&(y&&g&&(A+=h(y)),x&&(A+=f(x)))}return A},p=(C,a,d)=>String(C).normalize().replace(/\r\n/g,` +`).split(` +`).map(A=>$(A,a,d)).join(` +`);u.wrap=p});Object.defineProperty(W,"__esModule",{value:!0});W.cliui=W.UI=void 0;var b=Y(),lD=R(),dD=ED(),hD={right:(u,t)=>`${" ".repeat(Math.max(0,t-(0,b.stringWidth)(u)))}${u}`,center:(u,t)=>`${" ".repeat(Math.max(0,t-(0,b.stringWidth)(u))>>1)}${u}`},pD=0,_=1,fD=2,K=3,Q=class{width;wrap;rows;constructor(u){this.width=u.width,this.wrap=u.wrap??!0,this.rows=[]}span(...u){let t=this.div(...u);t.span=!0}resetOutput(){this.rows=[]}div(...u){if(u.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...u)&&typeof u[0]=="string")return this.applyLayoutDSL(u[0]);let t=Object.assign(u.map(i=>typeof i=="string"?this.colFromString(i):i),{span:!1});return this.rows.push(t),t}shouldApplyLayoutDSL(...u){return u.length===1&&typeof u[0]=="string"&&/[\t\n]/.test(u[0])}applyLayoutDSL(u){let t=u.split(` +`).map(e=>e.split(" ")),i=0;t.forEach(e=>{e.length>1&&(0,b.stringWidth)(String(e[0]))>i&&(i=Math.min(Math.floor(this.width*.5),(0,b.stringWidth)(String(e[0]))))}),t.forEach(e=>{this.div(...e.map((n,s)=>({text:n.trim(),padding:this.measurePadding(n),width:s===0&&e.length>1?i:void 0})))});let r=this.rows[this.rows.length-1];if(!r)throw new Error("no rows found");return r}colFromString(u){return{text:u,padding:this.measurePadding(u)}}measurePadding(u){let t=(0,lD.stripAnsi)(u),[i="",r=""]=[t.match(/\s*$/)?.[0],t.match(/^\s*/)?.[0]];return[0,i.length,0,r.length]}toString(){let u=[];return this.rows.forEach(t=>{this.rowToString(t,u)}),u.filter(t=>!t.hidden).map(t=>t.text).join(` +`)}rowToString(u,t){return this.rasterize(u).forEach((i,r)=>{let e="";i.forEach((n,s)=>{let F=u[s],{width:o}=F,D=this.negatePadding(F),E=n;if(D>(0,b.stringWidth)(n)&&(E+=" ".repeat(D-(0,b.stringWidth)(n))),F.align&&F.align!=="left"&&this.wrap){let f=hD[F.align];if(E=f(E.trim(),D),(0,b.stringWidth)(E)0){let f=t[t.length-1];if(!f)throw new Error("last line not found");e=this.renderInline(e,f)}}),t.push({text:e.replace(/ +$/,""),span:u.span})}),t}renderInline(u,t){let i=u.match(/^ */),r=i?i[0].length:0,e=t.text,n=(0,b.stringWidth)(e.trimEnd());return t.span?this.wrap?r{e.width=i[n],this.wrap?r=(0,dD.wrap)(e.text,this.negatePadding(e),{hard:!0}).split(` +`):r=e.text.split(` +`),e.border&&(r.unshift("."+"-".repeat(this.negatePadding(e)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")),e.padding&&(r.unshift(...new Array(e.padding[pD]||0).fill("")),r.push(...new Array(e.padding[fD]||0).fill(""))),r.forEach((s,F)=>{t[F]||t.push([]);let o=t[F]??[];for(let D=0;Dn.width||(0,b.stringWidth)(n.text));let t=u.length,i=this.width,r=u.map(n=>{if(n.width)return t--,i-=n.width,n.width}),e=t?Math.floor(i/t):0;return r.map((n,s)=>{if(n===void 0){let F=u[s]??{text:"",padding:[]};return Math.max(e,cD(F))}return n})}};W.UI=Q;var H=(u,t,i)=>u.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?i:" ":"",cD=u=>{let t=u.padding||[],i=1+(t[K]||0)+(t[_]||0);return u.border?i+4:i},BD=()=>typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80,gD=(u={})=>new Q({width:u?.width||BD(),wrap:u?.wrap});W.cliui=gD});Object.defineProperty(exports,"__esModule",{value:!0});exports.jack=exports.Jack=exports.isConfigOption=exports.isConfigOptionOfType=exports.isConfigType=void 0;var z=require("node:util"),AD=X(),DD=require("node:path"),mD=u=>typeof u=="string"&&(u==="string"||u==="number"||u==="boolean");exports.isConfigType=mD;var J=(u,t,i)=>i?Array.isArray(u)?!u.some(r=>!J(r,t,!1)):!1:Array.isArray(u)?!1:typeof u===t,G=(u,t)=>!!t&&(Array.isArray(u)?u.every(i=>G(i,t)):t.includes(u)),yD=(u,t,i)=>!!u&&typeof u=="object"&&"type"in u&&(0,exports.isConfigType)(u.type)&&u.type===t&&!!u.multiple===i;exports.isConfigOptionOfType=yD;var vD=(u,t,i)=>(0,exports.isConfigOptionOfType)(u,t,i)&&I(u.short,"string")&&I(u.description,"string")&&I(u.hint,"string")&&I(u.validate,"function")&&(u.type==="boolean"?u.validOptions===void 0:nD(u.validOptions,u.type))&&(u.default===void 0||J(u.default,t,i));exports.isConfigOption=vD;var V=u=>u.type==="heading",uD=u=>u.type==="description",U=Math.min(process?.stdout?.columns??80,80),Z=u=>(u-1)*2,tD=(u,t)=>[u,t.replace(/[^a-zA-Z0-9]+/g," ")].join(" ").trim().toUpperCase().replace(/ /g,"_"),eD=(u,t=` +`)=>{let i=typeof u=="string"?u:typeof u=="boolean"?u?"1":"0":typeof u=="number"?String(u):Array.isArray(u)?u.map(r=>eD(r)).join(t):void 0;if(typeof i!="string")throw new Error(`could not serialize value to environment: ${JSON.stringify(u)}`,{cause:{code:"JACKSPEAK"}});return i},iD=(u,t,i,r=` +`)=>i?u?u.split(r).map(e=>iD(e,t,!1)):[]:t==="string"?u:t==="boolean"?u==="1":+u.trim(),I=(u,t)=>u===void 0||typeof u===t,nD=(u,t)=>u===void 0||Array.isArray(u)&&u.every(i=>typeof i===t),k=u=>typeof u=="string"?"string":typeof u=="boolean"?"boolean":typeof u=="number"?"number":Array.isArray(u)?`${wD([...new Set(u.map(t=>k(t)))])}[]`:`${u.type}${u.multiple?"[]":""}`,wD=u=>u.length===1&&typeof u[0]=="string"?u[0]:`(${u.join("|")})`,bD=(u,t)=>{if(t){if(u.type!==void 0&&u.type!==t.type)throw new TypeError("invalid type",{cause:{found:u.type,wanted:[t.type,void 0]}});if(u.multiple!==void 0&&!!u.multiple!==t.multiple)throw new TypeError("invalid multiple",{cause:{found:u.multiple,wanted:[t.multiple,void 0]}});return t}if(!(0,exports.isConfigType)(u.type))throw new TypeError("invalid type",{cause:{found:u.type,wanted:["string","number","boolean"]}});return{type:u.type,multiple:!!u.multiple}},$D=(u,t,i)=>{let r=(e,n)=>{if(!nD(n,t))throw new TypeError("invalid validOptions",{cause:{found:n,wanted:k({type:t,multiple:!0})}});if(e!==void 0&&n!==void 0&&!(Array.isArray(e)?e.every(F=>n.includes(F)):n.includes(e)))throw new TypeError("invalid default value not in validOptions",{cause:{found:e,wanted:n}})};if(u.default!==void 0&&!J(u.default,t,i))throw new TypeError("invalid default value",{cause:{found:u.default,wanted:k({type:t,multiple:i})}});if((0,exports.isConfigOptionOfType)(u,"number",!1)||(0,exports.isConfigOptionOfType)(u,"number",!0))r(u.default,u.validOptions);else if((0,exports.isConfigOptionOfType)(u,"string",!1)||(0,exports.isConfigOptionOfType)(u,"string",!0))r(u.default,u.validOptions);else if((0,exports.isConfigOptionOfType)(u,"boolean",!1)||(0,exports.isConfigOptionOfType)(u,"boolean",!0)){if(u.hint!==void 0)throw new TypeError("cannot provide hint for flag");if(u.validOptions!==void 0)throw new TypeError("cannot provide validOptions for flag")}return u},OD=u=>Object.entries(u).reduce((t,[i,r])=>{let e={type:"string",multiple:!!r.multiple,...typeof r.short=="string"?{short:r.short}:void 0},n=()=>{!i.startsWith("no-")&&!u[`no-${i}`]&&(t[`no-${i}`]={type:"boolean",multiple:!!r.multiple})},s=(F,o)=>{F!==void 0&&(e.default=o(F))};return(0,exports.isConfigOption)(r,"number",!1)?s(r.default,String):(0,exports.isConfigOption)(r,"number",!0)?s(r.default,F=>F.map(o=>String(o))):(0,exports.isConfigOption)(r,"string",!1)||(0,exports.isConfigOption)(r,"string",!0)?s(r.default,F=>F):((0,exports.isConfigOption)(r,"boolean",!1)||(0,exports.isConfigOption)(r,"boolean",!0))&&(e.type="boolean",s(r.default,F=>F),n()),t[i]=e,t},{}),L=class{#D;#e;#u;#t=[];#r;#n;#o;#F;#s;constructor(t={}){this.#u=t,this.#o=t.allowPositionals!==!1,this.#r=this.#u.env===void 0?process.env:this.#u.env,this.#n=t.envPrefix,this.#D=Object.create(null),this.#e=Object.create(null)}get definitions(){return this.#D}get shorts(){return this.#e}get jackOptions(){return this.#u}get usageFields(){return this.#t}setConfigValues(t,i=""){try{this.validate(t)}catch(r){if(i&&r instanceof Error){let e=typeof r.cause=="object"?r.cause:{};r.cause={...e,path:i},Error.captureStackTrace(r,this.setConfigValues)}throw r}for(let[r,e]of Object.entries(t)){let n=this.#D[r];if(!n)throw new Error("unexpected field in config set: "+r,{cause:{code:"JACKSPEAK",found:r}});n.default=e}return this}parse(t=process.argv){this.loadEnvDefaults();let i=this.parseRaw(t);return this.applyDefaults(i),this.writeEnv(i),i}loadEnvDefaults(){if(this.#n)for(let[t,i]of Object.entries(this.#D)){let r=tD(this.#n,t),e=this.#r[r];e!==void 0&&(i.default=iD(e,i.type,!!i.multiple,i.delim))}}applyDefaults(t){for(let[i,r]of Object.entries(this.#D))r.default!==void 0&&!(i in t.values)&&(t.values[i]=r.default)}parseRaw(t){t===process.argv&&(t=t.slice(process._eval!==void 0?1:2));let i=(0,z.parseArgs)({args:t,options:OD(this.#D),strict:!1,allowPositionals:this.#o,tokens:!0}),r={values:{},positionals:[]};for(let e of i.tokens)if(e.kind==="positional"){if(r.positionals.push(e.value),this.#u.stopAtPositional||this.#u.stopAtPositionalTest?.(e.value)){r.positionals.push(...t.slice(e.index+1));break}}else if(e.kind==="option"){let n;if(e.name.startsWith("no-")){let F=this.#D[e.name],o=e.name.substring(3),D=this.#D[o];D&&D.type==="boolean"&&(!F||F.type==="boolean"&&!!F.multiple==!!D.multiple)&&(n=!1,e.name=o)}let s=this.#D[e.name];if(!s)throw new Error(`Unknown option '${e.rawName}'. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${e.rawName}'`,{cause:{code:"JACKSPEAK",found:e.rawName+(e.value?`=${e.value}`:"")}});if(n===void 0)if(e.value===void 0){if(s.type!=="boolean")throw new Error(`No value provided for ${e.rawName}, expected ${s.type}`,{cause:{code:"JACKSPEAK",name:e.rawName,wanted:k(s)}});n=!0}else{if(s.type==="boolean")throw new Error(`Flag ${e.rawName} does not take a value, received '${e.value}'`,{cause:{code:"JACKSPEAK",found:e}});if(s.type==="string")n=e.value;else if(n=+e.value,n!==n)throw new Error(`Invalid value '${e.value}' provided for '${e.rawName}' option, expected number`,{cause:{code:"JACKSPEAK",name:e.rawName,found:e.value,wanted:"number"}})}if(s.multiple){let F=r.values,o=F[e.name]??[];F[e.name]=o,o.push(n)}else{let F=r.values;F[e.name]=n}}for(let[e,n]of Object.entries(r.values)){let s=this.#D[e]?.validate,F=this.#D[e]?.validOptions,o=F&&!G(n,F)?{name:e,found:n,validOptions:F}:s&&!s(n)?{name:e,found:n}:void 0;if(o)throw new Error(`Invalid value provided for --${e}: ${JSON.stringify(n)}`,{cause:{...o,code:"JACKSPEAK"}})}return r}#C(t,i,r=t){if(!t.startsWith("no-")||typeof i!="boolean")return;let e=t.substring(3);if(this.#C(e,i,r),this.#D[e]?.type==="boolean")throw new Error(`do not set '${r}', instead set '${e}' as desired.`,{cause:{code:"JACKSPEAK",found:r,wanted:e}})}validate(t){if(!t||typeof t!="object")throw new Error("Invalid config: not an object",{cause:{code:"JACKSPEAK",found:t}});let i=t;for(let r in t){let e=i[r];if(e===void 0)continue;this.#C(r,e);let n=this.#D[r];if(!n)throw new Error(`Unknown config option: ${r}`,{cause:{code:"JACKSPEAK",found:r}});if(!J(e,n.type,!!n.multiple))throw new Error(`Invalid value ${k(e)} for ${r}, expected ${k(n)}`,{cause:{code:"JACKSPEAK",name:r,found:e,wanted:k(n)}});let s=n.validOptions&&!G(e,n.validOptions)?{name:r,found:e,validOptions:n.validOptions}:n.validate&&!n.validate(e)?{name:r,found:e}:void 0;if(s)throw new Error(`Invalid config value for ${r}: ${JSON.stringify(e)}`,{cause:{...s,code:"JACKSPEAK"}})}}writeEnv(t){if(!(!this.#r||!this.#n))for(let[i,r]of Object.entries(t.values)){let e=this.#D[i];this.#r[tD(this.#n,i)]=eD(r,e?.delim)}}heading(t,i,{pre:r=!1}={}){return i===void 0&&(i=this.#t.some(e=>V(e))?2:1),this.#t.push({type:"heading",text:t,level:i,pre:r}),this}description(t,{pre:i}={}){return this.#t.push({type:"description",text:t,pre:i}),this}num(t){return this.#i(t,"number",!1)}numList(t){return this.#i(t,"number",!0)}opt(t){return this.#i(t,"string",!1)}optList(t){return this.#i(t,"string",!0)}flag(t){return this.#i(t,"boolean",!1)}flagList(t){return this.#i(t,"boolean",!0)}addFields(t){return this.#a(this,t)}#i(t,i,r){return this.#a(this,t,{type:i,multiple:r})}#a(t,i,r){return Object.assign(t.#D,Object.fromEntries(Object.entries(i).map(([e,n])=>{this.#l(e,n);let{type:s,multiple:F}=bD(n,r),o={...n,type:s,multiple:F};return $D(o,s,F),t.#t.push({type:"config",name:e,value:o}),[e,o]}))),t}#l(t,i){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(t))throw new TypeError(`Invalid option name: ${t}, must be '-' delimited ASCII alphanumeric`);if(this.#D[t])throw new TypeError(`Cannot redefine option ${t}`);if(this.#e[t])throw new TypeError(`Cannot redefine option ${t}, already in use for ${this.#e[t]}`);if(i.short){if(!/^[a-zA-Z0-9]$/.test(i.short))throw new TypeError(`Invalid ${t} short option: ${i.short}, must be 1 ASCII alphanumeric character`);if(this.#e[i.short])throw new TypeError(`Invalid ${t} short option: ${i.short}, already in use for ${this.#e[i.short]}`);this.#e[i.short]=t,this.#e[t]=t}}usage(){if(this.#F)return this.#F;let t=1,i=(0,AD.cliui)({width:U}),r=this.#t[0],e=r?.type==="heading"?1:0;if(r?.type==="heading"&&i.div({padding:[0,0,0,0],text:P(r.text)}),i.div({padding:[0,0,0,0],text:"Usage:"}),this.#u.usage)i.div({text:this.#u.usage,padding:[0,0,0,2]});else{let o=(0,DD.basename)(String(process.argv[1])),D=[],E=[],h=[],f=[];for(let[C,a]of Object.entries(this.#D))a.short?a.type==="boolean"?D.push(a.short):E.push([a.short,a.hint||C]):a.type==="boolean"?h.push(C):f.push([C,a.hint||C]);let c=D.length?" -"+D.join(""):"",B=E.map(([C,a])=>` --${C}=<${a}>`).join(""),O=h.map(C=>` --${C}`).join(""),$=f.map(([C,a])=>` --${C}=<${a}>`).join(""),p=`${o}${c}${B}${O}${$}`.trim();i.div({text:p,padding:[0,0,0,2]})}i.div({padding:[0,0,0,0],text:""});let n=this.#t[e];if(n&&uD(n)){let o=P(n.text,n.pre);e++,i.div({padding:[0,0,0,0],text:o}),i.div({padding:[0,0,0,0],text:""})}let{rows:s,maxWidth:F}=this.#E(e);for(let o of s)if(o.left){let D=Z(Math.max(t,2));o.left.length>F-3?(i.div({text:o.left,padding:[0,0,0,D]}),i.div({text:o.text,padding:[0,0,0,F]})):i.div({text:o.left,padding:[0,1,0,D],width:F},{padding:[0,0,0,0],text:o.text}),o.skipLine&&i.div({padding:[0,0,0,0],text:""})}else if(V(o)){let{level:D}=o;t=D;let E=D<=2?1:0;i.div({...o,padding:[0,0,E,Z(D)]})}else i.div({...o,padding:[0,0,1,Z(t+1)]});return this.#F=i.toString()}usageMarkdown(){if(this.#s)return this.#s;let t=[],i=1,r=this.#t[0],e=r?.type==="heading"?1:0;if(r?.type==="heading"&&t.push(`# ${q(r.text)}`),t.push("Usage:"),this.#u.usage)t.push(M(this.#u.usage,!0));else{let F=(0,DD.basename)(String(process.argv[1])),o=[],D=[],E=[],h=[];for(let[p,C]of Object.entries(this.#D))C.short?C.type==="boolean"?o.push(C.short):D.push([C.short,C.hint||p]):C.type==="boolean"?E.push(p):h.push([p,C.hint||p]);let f=o.length?" -"+o.join(""):"",c=D.map(([p,C])=>` --${p}=<${C}>`).join(""),B=E.map(p=>` --${p}`).join(""),O=h.map(([p,C])=>` --${p}=<${C}>`).join(""),$=`${F}${f}${c}${B}${O}`.trim();t.push(M($,!0))}let n=this.#t[e];n&&uD(n)&&(t.push(M(n.text,n.pre)),e++);let{rows:s}=this.#E(e);for(let F of s)if(F.left)t.push("#".repeat(i+1)+" "+q(F.left,!0)),F.text&&t.push(M(F.text));else if(V(F)){let{level:o}=F;i=o,t.push(`${"#".repeat(i)} ${q(F.text,F.pre)}`)}else t.push(M(F.text,!!F.pre));return this.#s=t.join(` + +`)+` +`}#E(t){let i=Math.max(12,Math.min(26,Math.floor(U/3))),r=8,e,n=[];for(let s of this.#t.slice(t)){if(s.type!=="config"){e?.type==="config"&&(e.skipLine=!0),e=void 0,s.text=P(s.text,!!s.pre),n.push(s);continue}let{value:F}=s,o=F.description||"",D=F.multiple?"Can be set multiple times":"",E=F.validOptions?.length?"Valid options: "+F.validOptions.map(a=>JSON.stringify(a)).join(", "):"",h=o.includes(` +`)?` + +`:` +`,f=[E,D].join(h).trim(),c=(P(o)+h+f).trim(),B=F.hint||(F.type==="number"?"n":F.type==="string"?s.name:void 0),O=F.short?F.type==="boolean"?`-${F.short} `:`-${F.short}<${B}> `:"",$=F.type==="boolean"?`${O}--${s.name}`:`${O}--${s.name}=<${B}>`,p={text:c,left:$,type:"config"};c.length>U-i&&(p.skipLine=!0),e&&$.length>i&&(e.skipLine=!0),e=p;let C=$.length+4;C>r&&C[t,{type:i.type,...i.multiple?{multiple:!0}:{},...i.delim?{delim:i.delim}:{},...i.short?{short:i.short}:{},...i.description?{description:P(i.description)}:{},...i.validate?{validate:i.validate}:{},...i.validOptions?{validOptions:i.validOptions}:{},...i.default!==void 0?{default:i.default}:{},...i.hint?{hint:i.hint}:{}}]))}[z.inspect.custom](t,i){return`Jack ${(0,z.inspect)(this.toJSON(),i)}`}};exports.Jack=L;var xD=(u={})=>new L(u);exports.jack=xD;var P=(u,t=!1)=>t?u.split(` +`).map(i=>`\u200B${i}`).join(` +`):u.split(/^\s*```\s*$/gm).map((i,r)=>{if(r%2===1){if(!i.trim())return"```\n```\n";let e=i.split(` +`);e.pop(),e.shift();let n=e.reduce((F,o)=>{let D=o.match(/^\s*/)?.[0]??"";return D.length?Math.min(D.length,F):F},1/0),s=isFinite(n)?n:0;return"\n```\n"+e.map(F=>`\u200B${F.substring(s)}`).join(` +`)+"\n```\n"}return i.replace(/([^\n])\n[ \t]*([^\n])/g,(e,n,s)=>/^[-*]/.test(s)?`${n} +${s}`:`${n} ${s}`).replace(/([^\n])[ \t]+([^\n])/g,"$1 $2").replace(/\n{3,}/g,` + +`).replace(/\n[ \t]+/g,` +`).trim()}).join(` +`),M=(u,t=!1)=>{let i=P(u,t).replace(/\\/g,"\\\\");return t?`\`\`\` +${i.replace(/\u200b/g,"")} +\`\`\``:i.replace(/\n +/g,` +`).trim()},q=(u,t=!1)=>{let i=P(u,t).replace(/[\s\u200b]+/g," ").trim();return t?`\`${i}\``:i}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b28827c8cc318ea12cf6ebfd05e2c8e9f718c065 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../node_modules/@isaacs/cliui/src/ansi-regex/index.ts", "../../node_modules/@isaacs/cliui/src/strip-ansi/index.ts", "../../node_modules/@isaacs/cliui/src/eastasianwidth/index.ts", "../../node_modules/@isaacs/cliui/src/emoji-regex/index.ts", "../../node_modules/@isaacs/cliui/src/string-width/index.ts", "../../node_modules/@isaacs/cliui/src/ansi-styles/index.ts", "../../node_modules/@isaacs/cliui/src/wrap-ansi/index.ts", "../../node_modules/@isaacs/cliui/src/index.ts", "../../src/index.ts"], + "sourcesContent": ["// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n", "import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n", "export const eastAsianWidth = (character: string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n", "// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]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DF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE5\\uDEE9\\uDEF0\\uDEF3])\\uFE0F|\\uD83C\\uDFF3\\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FFB-\\uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uD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u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n", "import { stripAnsi } from \"../strip-ansi/index.js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n", "const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n", "import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n", "import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n /* c8 ignore start */\n width: opts?.width || getWindowWidth(),\n wrap: opts?.wrap,\n /* c8 ignore stop */\n })\n", "import {\n inspect,\n InspectOptions,\n parseArgs,\n ParseArgsConfig,\n} from 'node:util'\n\nimport { cliui } from '@isaacs/cliui/min'\nimport { basename } from 'node:path'\n\nexport type ParseArgsOptions = Exclude<\n ParseArgsConfig['options'],\n undefined\n>\nexport type ParseArgsOption = ParseArgsOptions[string]\nexport type ParseArgsDefault = Exclude\n\nexport type ConfigType = 'number' | 'string' | 'boolean'\n\nexport const isConfigType = (t: unknown): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nexport type ConfigValuePrimitive = string | boolean | number\nexport type ConfigValueArray = string[] | boolean[] | number[]\nexport type ConfigValue = ConfigValuePrimitive | ConfigValueArray\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive\n : [T, M] extends [ConfigType, true] ? ConfigValueArray\n : ConfigValue\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport type ReadonlyArrays = readonly number[] | readonly string[]\n\n/**\n * Defines the type of validOptions that are valid, given a config definition's\n * {@link ConfigType}\n */\nexport type ValidOptions =\n T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : ReadonlyArrays\n\nconst isValidOption = (\n v: unknown,\n vo: readonly unknown[],\n): vo is Exclude, undefined> =>\n !!vo &&\n (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v))\n\n/**\n * A config field definition, in its full representation.\n * This is what is passed in to addFields so `type` is required.\n */\nexport type ConfigOption<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n O extends undefined | ValidOptions = undefined | ValidOptions,\n> = {\n type: T\n short?: string\n default?: ValidValue &\n (O extends ReadonlyArrays ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown)\n description?: string\n hint?: T extends 'boolean' ? undefined : string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n validOptions?: O\n delim?: M extends false ? undefined : string\n multiple?: M\n}\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based only\n * on its `type` and `multiple` property\n */\nexport const isConfigOptionOfType = <\n T extends ConfigType,\n M extends boolean,\n>(\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n !!o &&\n typeof o === 'object' &&\n 'type' in o &&\n isConfigType(o.type) &&\n o.type === type &&\n !!(o as { multiple?: boolean }).multiple === multi\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based on\n * it having all valid properties\n */\nexport const isConfigOption = (\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n isConfigOptionOfType(o, type, multi) &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi))\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean,\n O extends ConfigOption = ConfigOption,\n> = Pick, 'type'> & Omit\n\n/**\n * A set of {@link ConfigOption} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOption\n}\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = S & { [longOption in keyof S]: ConfigOption }\n\n/**\n * The 'values' field returned by {@link Jack#parse}. If a value has\n * a default field it will be required on the object otherwise it is optional.\n */\nexport type OptionsResults = {\n [K in keyof T]:\n | (T[K]['validOptions'] extends ReadonlyArrays ?\n T[K] extends ConfigOption<'string' | 'number', false> ?\n T[K]['validOptions'][number]\n : T[K] extends ConfigOption<'string' | 'number', true> ?\n T[K]['validOptions'][number][]\n : never\n : T[K] extends ConfigOption<'string', false> ? string\n : T[K] extends ConfigOption<'string', true> ? string[]\n : T[K] extends ConfigOption<'number', false> ? number\n : T[K] extends ConfigOption<'number', true> ? number[]\n : T[K] extends ConfigOption<'boolean', false> ? boolean\n : T[K] extends ConfigOption<'boolean', true> ? boolean[]\n : never)\n | (T[K]['default'] extends ConfigValue ? never : undefined)\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\n\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOption}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOption\n }\n\nconst width = Math.min(process?.stdout?.columns ?? 80, 80)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string =>\n [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n\nconst toEnvVal = (value: ConfigValue, delim: string = '\\n'): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: ConfigValue) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n { cause: { code: 'JACKSPEAK' } },\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\n\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\n// print the value type, for error message reporting\nconst valueType = (\n v: ConfigValue | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]`\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst validateFieldMeta = (\n field: ConfigOptionMeta,\n fieldMeta?: { type: T; multiple: M },\n): { type: ConfigType; multiple: boolean } => {\n if (fieldMeta) {\n if (field.type !== undefined && field.type !== fieldMeta.type) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: [fieldMeta.type, undefined],\n },\n })\n }\n if (\n field.multiple !== undefined &&\n !!field.multiple !== fieldMeta.multiple\n ) {\n throw new TypeError(`invalid multiple`, {\n cause: {\n found: field.multiple,\n wanted: [fieldMeta.multiple, undefined],\n },\n })\n }\n return fieldMeta\n }\n\n if (!isConfigType(field.type)) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: ['string', 'number', 'boolean'],\n },\n })\n }\n\n return {\n type: field.type,\n multiple: !!field.multiple,\n }\n}\n\nconst validateField = (\n o: ConfigOption,\n type: ConfigType,\n multiple: boolean,\n): ConfigOption => {\n const validateValidOptions = <\n T extends ConfigValue | undefined,\n V extends T extends Array ? U : T,\n >(\n def: T | undefined,\n validOptions: readonly V[] | undefined,\n ) => {\n if (!undefOrTypeArray(validOptions, type)) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: valueType({ type, multiple: true }),\n },\n })\n }\n if (def !== undefined && validOptions !== undefined) {\n const valid =\n Array.isArray(def) ?\n def.every(v => validOptions.includes(v as V))\n : validOptions.includes(def as V)\n if (!valid) {\n throw new TypeError('invalid default value not in validOptions', {\n cause: {\n found: def,\n wanted: validOptions,\n },\n })\n }\n }\n }\n\n if (\n o.default !== undefined &&\n !isValidValue(o.default, type, multiple)\n ) {\n throw new TypeError('invalid default value', {\n cause: {\n found: o.default,\n wanted: valueType({ type, multiple }),\n },\n })\n }\n\n if (\n isConfigOptionOfType(o, 'number', false) ||\n isConfigOptionOfType(o, 'number', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'string', false) ||\n isConfigOptionOfType(o, 'string', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'boolean', false) ||\n isConfigOptionOfType(o, 'boolean', true)\n ) {\n if (o.hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n if (o.validOptions !== undefined) {\n throw new TypeError('cannot provide validOptions for flag')\n }\n }\n\n return o\n}\n\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): ParseArgsOptions => {\n return Object.entries(options).reduce((acc, [longOption, o]) => {\n const p: ParseArgsOption = {\n type: 'string',\n multiple: !!o.multiple,\n ...(typeof o.short === 'string' ? { short: o.short } : undefined),\n }\n const setNoBool = () => {\n if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) {\n acc[`no-${longOption}`] = {\n type: 'boolean',\n multiple: !!o.multiple,\n }\n }\n }\n const setDefault = (\n def: T | undefined,\n fn: (d: T) => ParseArgsDefault,\n ) => {\n if (def !== undefined) {\n p.default = fn(def)\n }\n }\n if (isConfigOption(o, 'number', false)) {\n setDefault(o.default, String)\n } else if (isConfigOption(o, 'number', true)) {\n setDefault(o.default, d => d.map(v => String(v)))\n } else if (\n isConfigOption(o, 'string', false) ||\n isConfigOption(o, 'string', true)\n ) {\n setDefault(o.default, v => v)\n } else if (\n isConfigOption(o, 'boolean', false) ||\n isConfigOption(o, 'boolean', true)\n ) {\n p.type = 'boolean'\n setDefault(o.default, v => v)\n setNoBool()\n }\n acc[longOption] = p\n return acc\n }, {} as ParseArgsOptions)\n}\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: Record\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: Record\n #options: JackOptions\n #fields: UsageField[] = []\n #env: Record\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Resulting definitions, suitable to be passed to Node's `util.parseArgs`,\n * but also including `description` and `short` fields, if set.\n */\n get definitions(): C {\n return this.#configSet\n }\n\n /** map of `{ : }` strings for each short name defined */\n get shorts() {\n return this.#shorts\n }\n\n /**\n * options passed to the {@link Jack} constructor\n */\n get jackOptions() {\n return this.#options\n }\n\n /**\n * the data used to generate {@link Jack#usage} and\n * {@link Jack#usageMarkdown} content.\n */\n get usageFields() {\n return this.#fields\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: Partial>, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n if (source && er instanceof Error) {\n /* c8 ignore next */\n const cause = typeof er.cause === 'object' ? er.cause : {}\n er.cause = { ...cause, path: source }\n Error.captureStackTrace(er, this.setConfigValues)\n }\n throw er\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: {\n code: 'JACKSPEAK',\n found: field,\n },\n })\n }\n /* c8 ignore stop */\n my.default = value as ConfigValue\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const result = parseArgs({\n args,\n options: toParseArgsOptionsConfig(this.#configSet),\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {} as OptionsResults,\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: ConfigValue | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n code: 'JACKSPEAK',\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { code: 'JACKSPEAK', found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as Record\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as Record\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n const cause =\n validOptions && !isValidOption(value, validOptions) ?\n { name: field, found: value, validOptions }\n : valid && !valid(value) ? { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(value)}`,\n { cause: { ...cause, code: 'JACKSPEAK' } },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { code: 'JACKSPEAK', found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { code: 'JACKSPEAK', found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { code: 'JACKSPEAK', found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n const cause =\n config.validOptions && !isValidOption(value, config.validOptions) ?\n { name: field, found: value, validOptions: config.validOptions }\n : config.validate && !config.validate(value) ?\n { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid config value for ${field}: ${JSON.stringify(value)}`,\n {\n cause: { ...cause, code: 'JACKSPEAK' },\n },\n )\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value as ConfigValue,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', false)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', true)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', false)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', true)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', false)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', true)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n return this.#addFields(this as unknown as Jack, fields)\n }\n\n #addFieldsWith<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends ConfigSetFromMetaSet,\n >(fields: F, type: ConfigType, multiple: boolean): Jack {\n return this.#addFields(this as unknown as Jack, fields, {\n type,\n multiple,\n })\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends Jack,\n >(next: O, fields: F, opt?: { type: T; multiple: M }): O {\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const { type, multiple } = validateFieldMeta(field, opt)\n const value = { ...field, type, multiple }\n validateField(value, type, multiple)\n next.#fields.push({ type: 'config', name, value })\n return [name, value]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${name}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n //@ts-ignore\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n 'Valid options: ' +\n value.validOptions.map(v => JSON.stringify(v)).join(', ')\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n"], + "mappings": "8PAEO,IAAMA,EAAY,CAAC,CAAE,UAAAC,EAAY,EA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eastAsianWidth", "character", "x", "y", "codePoint", "characterLength", "code", "stringToArray", "length", "characters", "len", "char", "slice", "text", "start", "end", "textLen", "result", "eawLen", "chars", "charLen", "emojiRegex", "stringWidth", "p", "index_js_2", "k", "index_js_3", "R", "options", "ambiguousCharacterWidth", "width", "O", "c", "s", "styles", "AnsiStyles", "ingest", "set", "key", "open", "close", "red", "green", "blue", "hex", "matches", "colorString", "integer", "remainder", "value", "H", "v", "ESCAPES", "END_CODE", "ANSI_ESCAPE_BELL", "ANSI_CSI", "ANSI_OSC", "ANSI_SGR_TERMINATOR", "ANSI_ESCAPE_LINK", "wrapAnsiCode", "wrapAnsiHyperlink", "uri", "wordLengths", "wrapWord", "rows", "word", "columns", "isInsideEscape", "isInsideLinkEscape", "visible", "index", "stringVisibleTrimSpacesRight", "words", "last", "exec", "returnValue", "escapeCode", "escapeUrl", "lengths", "rowLength", "remainingColumns", "breaksStartingThisLine", "row", "pre", "groups", "wrap", "line", "align", "top", "right", "bottom", "left", "UI", "opts", "args", "cols", "arg", "leftColumnWidth", "r", "i", "noAnsi", "lines", "rrow", "col", "column", "wrapWidth", "ts", "fn", "w", "padding", "addBorder", "lastLine", "source", "previousLine", "match", "leadingWhitespace", "target", "targetTextWidth", "rrows", "widths", "wrapped", "unset", "remainingWidth", "unsetWidth", "_minWidth", "style", "minWidth", "getWindowWidth", "cliui", "node_util_1", "min_1", "node_path_1", "isConfigType", "t", "isValidValue", "v", "type", "multi", "isValidOption", "vo", "x", "isConfigOptionOfType", "o", "isConfigOption", "undefOrType", "undefOrTypeArray", "isHeading", "r", "isDescription", "width", "indent", "n", "toEnvKey", "pref", "key", "toEnvVal", "value", "delim", "str", "fromEnvVal", "env", "multiple", "valueType", "joinTypes", "types", "validateFieldMeta", "field", "fieldMeta", "validateField", "validateValidOptions", "def", "validOptions", "toParseArgsOptionsConfig", "options", "acc", "longOption", "p", "setNoBool", "setDefault", "fn", "d", "Jack", "#configSet", "#shorts", "#options", "#fields", "#env", "#envPrefix", "#allowPositionals", "#usage", "#usageMarkdown", "values", "source", "er", "cause", "my", "args", "ek", "c", "result", "token", "pname", "pos", "pv", "tn", "valid", "#noNoFields", "f", "val", "s", "yes", "opts", "config", "text", "level", "pre", "fields", "#addFieldsWith", "#addFields", "next", "opt", "name", "#validateName", "headingLevel", "ui", "first", "start", "normalize", "cmd", "shortFlags", "shorts", "flags", "sf", "so", "k", "lf", "lo", "usage", "maybeDesc", "print", "rows", "maxWidth", "#usageRows", "row", "configIndent", "b", "out", "normalizeOneLine", "normalizeMarkdown", "maxMax", "prev", "desc", "mult", "dmDelim", "extra", "hint", "short", "left", "len", "_", "jack", "l", "i", "split", "si", "shortest", "ind", "$1", "$2"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61780384c6a0ed43b60dfc8f111723ac03e254bb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts @@ -0,0 +1,323 @@ +import { inspect, InspectOptions, ParseArgsConfig } from 'node:util'; +export type ParseArgsOptions = Exclude; +export type ParseArgsOption = ParseArgsOptions[string]; +export type ParseArgsDefault = Exclude; +export type ConfigType = 'number' | 'string' | 'boolean'; +export declare const isConfigType: (t: unknown) => t is ConfigType; +export type ConfigValuePrimitive = string | boolean | number; +export type ConfigValueArray = string[] | boolean[] | number[]; +export type ConfigValue = ConfigValuePrimitive | ConfigValueArray; +/** + * Given a Jack object, get the typeof its ConfigSet + */ +export type Unwrap = J extends Jack ? C : never; +/** + * Defines the type of value that is valid, given a config definition's + * {@link ConfigType} and boolean multiple setting + */ +export type ValidValue = [ + T, + M +] extends ['number', true] ? number[] : [T, M] extends ['string', true] ? string[] : [T, M] extends ['boolean', true] ? boolean[] : [T, M] extends ['number', false] ? number : [T, M] extends ['string', false] ? string : [T, M] extends ['boolean', false] ? boolean : [T, M] extends ['string', boolean] ? string | string[] : [T, M] extends ['boolean', boolean] ? boolean | boolean[] : [T, M] extends ['number', boolean] ? number | number[] : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive : [T, M] extends [ConfigType, true] ? ConfigValueArray : ConfigValue; +export type ReadonlyArrays = readonly number[] | readonly string[]; +/** + * Defines the type of validOptions that are valid, given a config definition's + * {@link ConfigType} + */ +export type ValidOptions = T extends 'boolean' ? undefined : T extends 'string' ? readonly string[] : T extends 'number' ? readonly number[] : ReadonlyArrays; +/** + * A config field definition, in its full representation. + * This is what is passed in to addFields so `type` is required. + */ +export type ConfigOption = undefined | ValidOptions> = { + type: T; + short?: string; + default?: ValidValue & (O extends ReadonlyArrays ? M extends false ? O[number] : O[number][] : unknown); + description?: string; + hint?: T extends 'boolean' ? undefined : string; + validate?: ((v: unknown) => v is ValidValue) | ((v: unknown) => boolean); + validOptions?: O; + delim?: M extends false ? undefined : string; + multiple?: M; +}; +/** + * Determine whether an unknown object is a {@link ConfigOption} based only + * on its `type` and `multiple` property + */ +export declare const isConfigOptionOfType: (o: unknown, type: T, multi: M) => o is ConfigOption; +/** + * Determine whether an unknown object is a {@link ConfigOption} based on + * it having all valid properties + */ +export declare const isConfigOption: (o: unknown, type: T, multi: M) => o is ConfigOption; +/** + * The meta information for a config option definition, when the + * type and multiple values can be inferred by the method being used + */ +export type ConfigOptionMeta = ConfigOption> = Pick, 'type'> & Omit; +/** + * A set of {@link ConfigOption} objects, referenced by their longOption + * string values. + */ +export type ConfigSet = { + [longOption: string]: ConfigOption; +}; +/** + * A set of {@link ConfigOptionMeta} fields, referenced by their longOption + * string values. + */ +export type ConfigMetaSet = { + [longOption: string]: ConfigOptionMeta; +}; +/** + * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet} + */ +export type ConfigSetFromMetaSet> = S & { + [longOption in keyof S]: ConfigOption; +}; +/** + * The 'values' field returned by {@link Jack#parse}. If a value has + * a default field it will be required on the object otherwise it is optional. + */ +export type OptionsResults = { + [K in keyof T]: (T[K]['validOptions'] extends ReadonlyArrays ? T[K] extends ConfigOption<'string' | 'number', false> ? T[K]['validOptions'][number] : T[K] extends ConfigOption<'string' | 'number', true> ? T[K]['validOptions'][number][] : never : T[K] extends ConfigOption<'string', false> ? string : T[K] extends ConfigOption<'string', true> ? string[] : T[K] extends ConfigOption<'number', false> ? number : T[K] extends ConfigOption<'number', true> ? number[] : T[K] extends ConfigOption<'boolean', false> ? boolean : T[K] extends ConfigOption<'boolean', true> ? boolean[] : never) | (T[K]['default'] extends ConfigValue ? never : undefined); +}; +/** + * The object retured by {@link Jack#parse} + */ +export type Parsed = { + values: OptionsResults; + positionals: string[]; +}; +/** + * A row used when generating the {@link Jack#usage} string + */ +export interface Row { + left?: string; + text: string; + skipLine?: boolean; + type?: string; +} +/** + * A heading for a section in the usage, created by the jack.heading() + * method. + * + * First heading is always level 1, subsequent headings default to 2. + * + * The level of the nearest heading level sets the indentation of the + * description that follows. + */ +export interface Heading extends Row { + type: 'heading'; + text: string; + left?: ''; + skipLine?: boolean; + level: number; + pre?: boolean; +} +/** + * An arbitrary blob of text describing some stuff, set by the + * jack.description() method. + * + * Indentation determined by level of the nearest header. + */ +export interface Description extends Row { + type: 'description'; + text: string; + left?: ''; + skipLine?: boolean; + pre?: boolean; +} +/** + * A heading or description row used when generating the {@link Jack#usage} + * string + */ +export type TextRow = Heading | Description; +/** + * Either a {@link TextRow} or a reference to a {@link ConfigOption} + */ +export type UsageField = TextRow | { + type: 'config'; + name: string; + value: ConfigOption; +}; +/** + * Options provided to the {@link Jack} constructor + */ +export interface JackOptions { + /** + * Whether to allow positional arguments + * + * @default true + */ + allowPositionals?: boolean; + /** + * Prefix to use when reading/writing the environment variables + * + * If not specified, environment behavior will not be available. + */ + envPrefix?: string; + /** + * Environment object to read/write. Defaults `process.env`. + * No effect if `envPrefix` is not set. + */ + env?: Record; + /** + * A short usage string. If not provided, will be generated from the + * options provided, but that can of course be rather verbose if + * there are a lot of options. + */ + usage?: string; + /** + * Stop parsing flags and opts at the first positional argument. + * This is to support cases like `cmd [flags] [options]`, where + * each subcommand may have different options. This effectively treats + * any positional as a `--` argument. Only relevant if `allowPositionals` + * is true. + * + * To do subcommands, set this option, look at the first positional, and + * parse the remaining positionals as appropriate. + * + * @default false + */ + stopAtPositional?: boolean; + /** + * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function, + * will be called with each positional argument encountered. If the function + * returns true, then parsing will stop at that point. + */ + stopAtPositionalTest?: (arg: string) => boolean; +} +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export declare class Jack { + #private; + constructor(options?: JackOptions); + /** + * Resulting definitions, suitable to be passed to Node's `util.parseArgs`, + * but also including `description` and `short` fields, if set. + */ + get definitions(): C; + /** map of `{ : }` strings for each short name defined */ + get shorts(): Record; + /** + * options passed to the {@link Jack} constructor + */ + get jackOptions(): JackOptions; + /** + * the data used to generate {@link Jack#usage} and + * {@link Jack#usageMarkdown} content. + */ + get usageFields(): UsageField[]; + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values: Partial>, source?: string): this; + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args?: string[]): Parsed; + loadEnvDefaults(): void; + applyDefaults(p: Parsed): void; + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args: string[]): Parsed; + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o: unknown): asserts o is Parsed['values']; + writeEnv(p: Parsed): void; + /** + * Add a heading to the usage output banner + */ + heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add a long-form description to the usage output at this position. + */ + description(text: string, { pre }?: { + pre?: boolean; + }): Jack; + /** + * Add one or more number fields. + */ + num>(fields: F): Jack>; + /** + * Add one or more multiple number fields. + */ + numList>(fields: F): Jack>; + /** + * Add one or more string option fields. + */ + opt>(fields: F): Jack>; + /** + * Add one or more multiple string option fields. + */ + optList>(fields: F): Jack>; + /** + * Add one or more flag fields. + */ + flag>(fields: F): Jack>; + /** + * Add one or more multiple flag fields. + */ + flagList>(fields: F): Jack>; + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields: F): Jack; + /** + * Return the usage banner for the given configuration + */ + usage(): string; + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown(): string; + /** + * Return the configuration options as a plain object + */ + toJSON(): { + [k: string]: { + hint?: string | undefined; + default?: ConfigValue | undefined; + validOptions?: readonly number[] | readonly string[] | undefined; + validate?: ((v: unknown) => boolean) | ((v: unknown) => v is ConfigValue) | undefined; + description?: string | undefined; + short?: string | undefined; + delim?: string | undefined; + multiple?: boolean | undefined; + type: ConfigType; + }; + }; + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_: number, options: InspectOptions): string; +} +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export declare const jack: (options?: JackOptions) => Jack<{}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4c2b9e34d4a5d22119f2536738e72f2c4685d422 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EAEd,eAAe,EAChB,MAAM,WAAW,CAAA;AAKlB,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,eAAe,CAAC,SAAS,CAAC,EAC1B,SAAS,CACV,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;AAEtE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExD,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,UAEQ,CAAA;AAEvD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAC5D,MAAM,MAAM,gBAAgB,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,OAAO,GAAG,OAAO,IAE3B;IAAC,CAAC;IAAE,CAAC;CAAC,SAAS,CAAC,QA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7qCG,OAAO,KAAK,OAAO,SADnB,OAAO,KAAK,CAAC,eAAoB;;;;;;;;IAmsC1C;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAGpD;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,aAAsB,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8ac4564f1c824f4f9ab7326c32eaef21739be766 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js @@ -0,0 +1,936 @@ +import { inspect, parseArgs, } from 'node:util'; +import { cliui } from '@isaacs/cliui/min'; +import { basename } from 'node:path'; +export const isConfigType = (t) => typeof t === 'string' && + (t === 'string' || t === 'number' || t === 'boolean'); +const isValidValue = (v, type, multi) => { + if (multi) { + if (!Array.isArray(v)) + return false; + return !v.some((v) => !isValidValue(v, type, false)); + } + if (Array.isArray(v)) + return false; + return typeof v === type; +}; +const isValidOption = (v, vo) => !!vo && + (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v)); +/** + * Determine whether an unknown object is a {@link ConfigOption} based only + * on its `type` and `multiple` property + */ +export const isConfigOptionOfType = (o, type, multi) => !!o && + typeof o === 'object' && + 'type' in o && + isConfigType(o.type) && + o.type === type && + !!o.multiple === multi; +/** + * Determine whether an unknown object is a {@link ConfigOption} based on + * it having all valid properties + */ +export const isConfigOption = (o, type, multi) => isConfigOptionOfType(o, type, multi) && + undefOrType(o.short, 'string') && + undefOrType(o.description, 'string') && + undefOrType(o.hint, 'string') && + undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && + (o.default === undefined || isValidValue(o.default, type, multi)); +const isHeading = (r) => r.type === 'heading'; +const isDescription = (r) => r.type === 'description'; +const width = Math.min(process?.stdout?.columns ?? 80, 80); +// indentation spaces from heading level +const indent = (n) => (n - 1) * 2; +const toEnvKey = (pref, key) => [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')] + .join(' ') + .trim() + .toUpperCase() + .replace(/ /g, '_'); +const toEnvVal = (value, delim = '\n') => { + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' + : '0' + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; + if (typeof str !== 'string') { + throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`, { cause: { code: 'JACKSPEAK' } }); + } + /* c8 ignore stop */ + return str; +}; +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] + : type === 'string' ? env + : type === 'boolean' ? env === '1' + : +env.trim()); +const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +// print the value type, for error message reporting +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]` + : `${v.type}${v.multiple ? '[]' : ''}`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] + : `(${types.join('|')})`; +const validateFieldMeta = (field, fieldMeta) => { + if (fieldMeta) { + if (field.type !== undefined && field.type !== fieldMeta.type) { + throw new TypeError(`invalid type`, { + cause: { + found: field.type, + wanted: [fieldMeta.type, undefined], + }, + }); + } + if (field.multiple !== undefined && + !!field.multiple !== fieldMeta.multiple) { + throw new TypeError(`invalid multiple`, { + cause: { + found: field.multiple, + wanted: [fieldMeta.multiple, undefined], + }, + }); + } + return fieldMeta; + } + if (!isConfigType(field.type)) { + throw new TypeError(`invalid type`, { + cause: { + found: field.type, + wanted: ['string', 'number', 'boolean'], + }, + }); + } + return { + type: field.type, + multiple: !!field.multiple, + }; +}; +const validateField = (o, type, multiple) => { + const validateValidOptions = (def, validOptions) => { + if (!undefOrTypeArray(validOptions, type)) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: valueType({ type, multiple: true }), + }, + }); + } + if (def !== undefined && validOptions !== undefined) { + const valid = Array.isArray(def) ? + def.every(v => validOptions.includes(v)) + : validOptions.includes(def); + if (!valid) { + throw new TypeError('invalid default value not in validOptions', { + cause: { + found: def, + wanted: validOptions, + }, + }); + } + } + }; + if (o.default !== undefined && + !isValidValue(o.default, type, multiple)) { + throw new TypeError('invalid default value', { + cause: { + found: o.default, + wanted: valueType({ type, multiple }), + }, + }); + } + if (isConfigOptionOfType(o, 'number', false) || + isConfigOptionOfType(o, 'number', true)) { + validateValidOptions(o.default, o.validOptions); + } + else if (isConfigOptionOfType(o, 'string', false) || + isConfigOptionOfType(o, 'string', true)) { + validateValidOptions(o.default, o.validOptions); + } + else if (isConfigOptionOfType(o, 'boolean', false) || + isConfigOptionOfType(o, 'boolean', true)) { + if (o.hint !== undefined) { + throw new TypeError('cannot provide hint for flag'); + } + if (o.validOptions !== undefined) { + throw new TypeError('cannot provide validOptions for flag'); + } + } + return o; +}; +const toParseArgsOptionsConfig = (options) => { + return Object.entries(options).reduce((acc, [longOption, o]) => { + const p = { + type: 'string', + multiple: !!o.multiple, + ...(typeof o.short === 'string' ? { short: o.short } : undefined), + }; + const setNoBool = () => { + if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) { + acc[`no-${longOption}`] = { + type: 'boolean', + multiple: !!o.multiple, + }; + } + }; + const setDefault = (def, fn) => { + if (def !== undefined) { + p.default = fn(def); + } + }; + if (isConfigOption(o, 'number', false)) { + setDefault(o.default, String); + } + else if (isConfigOption(o, 'number', true)) { + setDefault(o.default, d => d.map(v => String(v))); + } + else if (isConfigOption(o, 'string', false) || + isConfigOption(o, 'string', true)) { + setDefault(o.default, v => v); + } + else if (isConfigOption(o, 'boolean', false) || + isConfigOption(o, 'boolean', true)) { + p.type = 'boolean'; + setDefault(o.default, v => v); + setNoBool(); + } + acc[longOption] = p; + return acc; + }, {}); +}; +/** + * Class returned by the {@link jack} function and all configuration + * definition methods. This is what gets chained together. + */ +export class Jack { + #configSet; + #shorts; + #options; + #fields = []; + #env; + #envPrefix; + #allowPositionals; + #usage; + #usageMarkdown; + constructor(options = {}) { + this.#options = options; + this.#allowPositionals = options.allowPositionals !== false; + this.#env = + this.#options.env === undefined ? process.env : this.#options.env; + this.#envPrefix = options.envPrefix; + // We need to fib a little, because it's always the same object, but it + // starts out as having an empty config set. Then each method that adds + // fields returns `this as Jack` + this.#configSet = Object.create(null); + this.#shorts = Object.create(null); + } + /** + * Resulting definitions, suitable to be passed to Node's `util.parseArgs`, + * but also including `description` and `short` fields, if set. + */ + get definitions() { + return this.#configSet; + } + /** map of `{ : }` strings for each short name defined */ + get shorts() { + return this.#shorts; + } + /** + * options passed to the {@link Jack} constructor + */ + get jackOptions() { + return this.#options; + } + /** + * the data used to generate {@link Jack#usage} and + * {@link Jack#usageMarkdown} content. + */ + get usageFields() { + return this.#fields; + } + /** + * Set the default value (which will still be overridden by env or cli) + * as if from a parsed config file. The optional `source` param, if + * provided, will be included in error messages if a value is invalid or + * unknown. + */ + setConfigValues(values, source = '') { + try { + this.validate(values); + } + catch (er) { + if (source && er instanceof Error) { + /* c8 ignore next */ + const cause = typeof er.cause === 'object' ? er.cause : {}; + er.cause = { ...cause, path: source }; + Error.captureStackTrace(er, this.setConfigValues); + } + throw er; + } + for (const [field, value] of Object.entries(values)) { + const my = this.#configSet[field]; + // already validated, just for TS's benefit + /* c8 ignore start */ + if (!my) { + throw new Error('unexpected field in config set: ' + field, { + cause: { + code: 'JACKSPEAK', + found: field, + }, + }); + } + /* c8 ignore stop */ + my.default = value; + } + return this; + } + /** + * Parse a string of arguments, and return the resulting + * `{ values, positionals }` object. + * + * If an {@link JackOptions#envPrefix} is set, then it will read default + * values from the environment, and write the resulting values back + * to the environment as well. + * + * Environment values always take precedence over any other value, except + * an explicit CLI setting. + */ + parse(args = process.argv) { + this.loadEnvDefaults(); + const p = this.parseRaw(args); + this.applyDefaults(p); + this.writeEnv(p); + return p; + } + loadEnvDefaults() { + if (this.#envPrefix) { + for (const [field, my] of Object.entries(this.#configSet)) { + const ek = toEnvKey(this.#envPrefix, field); + const env = this.#env[ek]; + if (env !== undefined) { + my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim); + } + } + } + } + applyDefaults(p) { + for (const [field, c] of Object.entries(this.#configSet)) { + if (c.default !== undefined && !(field in p.values)) { + //@ts-ignore + p.values[field] = c.default; + } + } + } + /** + * Only parse the command line arguments passed in. + * Does not strip off the `node script.js` bits, so it must be just the + * arguments you wish to have parsed. + * Does not read from or write to the environment, or set defaults. + */ + parseRaw(args) { + if (args === process.argv) { + args = args.slice(process._eval !== undefined ? 1 : 2); + } + const result = parseArgs({ + args, + options: toParseArgsOptionsConfig(this.#configSet), + // always strict, but using our own logic + strict: false, + allowPositionals: this.#allowPositionals, + tokens: true, + }); + const p = { + values: {}, + positionals: [], + }; + for (const token of result.tokens) { + if (token.kind === 'positional') { + p.positionals.push(token.value); + if (this.#options.stopAtPositional || + this.#options.stopAtPositionalTest?.(token.value)) { + p.positionals.push(...args.slice(token.index + 1)); + break; + } + } + else if (token.kind === 'option') { + let value = undefined; + if (token.name.startsWith('no-')) { + const my = this.#configSet[token.name]; + const pname = token.name.substring('no-'.length); + const pos = this.#configSet[pname]; + if (pos && + pos.type === 'boolean' && + (!my || + (my.type === 'boolean' && !!my.multiple === !!pos.multiple))) { + value = false; + token.name = pname; + } + } + const my = this.#configSet[token.name]; + if (!my) { + throw new Error(`Unknown option '${token.rawName}'. ` + + `To specify a positional argument starting with a '-', ` + + `place it at the end of the command after '--', as in ` + + `'-- ${token.rawName}'`, { + cause: { + code: 'JACKSPEAK', + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); + } + if (value === undefined) { + if (token.value === undefined) { + if (my.type !== 'boolean') { + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + code: 'JACKSPEAK', + name: token.rawName, + wanted: valueType(my), + }, + }); + } + value = true; + } + else { + if (my.type === 'boolean') { + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { code: 'JACKSPEAK', found: token } }); + } + if (my.type === 'string') { + value = token.value; + } + else { + value = +token.value; + if (value !== value) { + throw new Error(`Invalid value '${token.value}' provided for ` + + `'${token.rawName}' option, expected number`, { + cause: { + code: 'JACKSPEAK', + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); + } + } + } + } + if (my.multiple) { + const pv = p.values; + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); + } + else { + const pv = p.values; + pv[token.name] = value; + } + } + } + for (const [field, value] of Object.entries(p.values)) { + const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + const cause = validOptions && !isValidOption(value, validOptions) ? + { name: field, found: value, validOptions } + : valid && !valid(value) ? { name: field, found: value } + : undefined; + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause: { ...cause, code: 'JACKSPEAK' } }); + } + } + return p; + } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // recurse so we get the core config key we care about. + this.#noNoFields(yes, val, s); + if (this.#configSet[yes]?.type === 'boolean') { + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { code: 'JACKSPEAK', found: s, wanted: yes } }); + } + } + /** + * Validate that any arbitrary object is a valid configuration `values` + * object. Useful when loading config files or other sources. + */ + validate(o) { + if (!o || typeof o !== 'object') { + throw new Error('Invalid config: not an object', { + cause: { code: 'JACKSPEAK', found: o }, + }); + } + const opts = o; + for (const field in o) { + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); + const config = this.#configSet[field]; + if (!config) { + throw new Error(`Unknown config option: ${field}`, { + cause: { code: 'JACKSPEAK', found: field }, + }); + } + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + code: 'JACKSPEAK', + name: field, + found: value, + wanted: valueType(config), + }, + }); + } + const cause = config.validOptions && !isValidOption(value, config.validOptions) ? + { name: field, found: value, validOptions: config.validOptions } + : config.validate && !config.validate(value) ? + { name: field, found: value } + : undefined; + if (cause) { + throw new Error(`Invalid config value for ${field}: ${JSON.stringify(value)}`, { + cause: { ...cause, code: 'JACKSPEAK' }, + }); + } + } + } + writeEnv(p) { + if (!this.#env || !this.#envPrefix) + return; + for (const [field, value] of Object.entries(p.values)) { + const my = this.#configSet[field]; + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); + } + } + /** + * Add a heading to the usage output banner + */ + heading(text, level, { pre = false } = {}) { + if (level === undefined) { + level = this.#fields.some(r => isHeading(r)) ? 2 : 1; + } + this.#fields.push({ type: 'heading', text, level, pre }); + return this; + } + /** + * Add a long-form description to the usage output at this position. + */ + description(text, { pre } = {}) { + this.#fields.push({ type: 'description', text, pre }); + return this; + } + /** + * Add one or more number fields. + */ + num(fields) { + return this.#addFieldsWith(fields, 'number', false); + } + /** + * Add one or more multiple number fields. + */ + numList(fields) { + return this.#addFieldsWith(fields, 'number', true); + } + /** + * Add one or more string option fields. + */ + opt(fields) { + return this.#addFieldsWith(fields, 'string', false); + } + /** + * Add one or more multiple string option fields. + */ + optList(fields) { + return this.#addFieldsWith(fields, 'string', true); + } + /** + * Add one or more flag fields. + */ + flag(fields) { + return this.#addFieldsWith(fields, 'boolean', false); + } + /** + * Add one or more multiple flag fields. + */ + flagList(fields) { + return this.#addFieldsWith(fields, 'boolean', true); + } + /** + * Generic field definition method. Similar to flag/flagList/number/etc, + * but you must specify the `type` (and optionally `multiple` and `delim`) + * fields on each one, or Jack won't know how to define them. + */ + addFields(fields) { + return this.#addFields(this, fields); + } + #addFieldsWith(fields, type, multiple) { + return this.#addFields(this, fields, { + type, + multiple, + }); + } + #addFields(next, fields, opt) { + Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => { + this.#validateName(name, field); + const { type, multiple } = validateFieldMeta(field, opt); + const value = { ...field, type, multiple }; + validateField(value, type, multiple); + next.#fields.push({ type: 'config', name, value }); + return [name, value]; + }))); + return next; + } + #validateName(name, field) { + if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) { + throw new TypeError(`Invalid option name: ${name}, ` + + `must be '-' delimited ASCII alphanumeric`); + } + if (this.#configSet[name]) { + throw new TypeError(`Cannot redefine option ${name}`); + } + if (this.#shorts[name]) { + throw new TypeError(`Cannot redefine option ${name}, already ` + + `in use for ${this.#shorts[name]}`); + } + if (field.short) { + if (!/^[a-zA-Z0-9]$/.test(field.short)) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + 'must be 1 ASCII alphanumeric character'); + } + if (this.#shorts[field.short]) { + throw new TypeError(`Invalid ${name} short option: ${field.short}, ` + + `already in use for ${this.#shorts[field.short]}`); + } + this.#shorts[field.short] = name; + this.#shorts[name] = name; + } + } + /** + * Return the usage banner for the given configuration + */ + usage() { + if (this.#usage) + return this.#usage; + let headingLevel = 1; + //@ts-ignore + const ui = cliui({ width }); + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + ui.div({ + padding: [0, 0, 0, 0], + text: normalize(first.text), + }); + } + ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' }); + if (this.#options.usage) { + ui.div({ + text: this.#options.usage, + padding: [0, 0, 0, 2], + }); + } + else { + const cmd = basename(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + ui.div({ + text: usage, + padding: [0, 0, 0, 2], + }); + } + ui.div({ padding: [0, 0, 0, 0], text: '' }); + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + const print = normalize(maybeDesc.text, maybeDesc.pre); + start++; + ui.div({ padding: [0, 0, 0, 0], text: print }); + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = basename(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { + // turn each config type into a row, and figure out the width of the + // left hand indentation for the option descriptions. + const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); + let maxWidth = 8; + let prev = undefined; + const rows = []; + for (const field of this.#fields.slice(start)) { + if (field.type !== 'config') { + if (prev?.type === 'config') + prev.skipLine = true; + prev = undefined; + field.text = normalize(field.text, !!field.pre); + rows.push(field); + continue; + } + const { value } = field; + const desc = value.description || ''; + const mult = value.multiple ? 'Can be set multiple times' : ''; + const opts = value.validOptions?.length ? + 'Valid options: ' + + value.validOptions.map(v => JSON.stringify(v)).join(', ') + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); + const hint = value.hint || + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name + : undefined); + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` + : `-${value.short}<${hint}> `; + const left = value.type === 'boolean' ? + `${short}--${field.name}` + : `${short}--${field.name}=<${hint}>`; + const row = { text, left, type: 'config' }; + if (text.length > width - maxMax) { + row.skipLine = true; + } + if (prev && left.length > maxMax) + prev.skipLine = true; + prev = row; + const len = left.length + 4; + if (len > maxWidth && len < maxMax) { + maxWidth = len; + } + rows.push(row); + } + return { rows, maxWidth }; + } + /** + * Return the configuration options as a plain object + */ + toJSON() { + return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [ + field, + { + type: def.type, + ...(def.multiple ? { multiple: true } : {}), + ...(def.delim ? { delim: def.delim } : {}), + ...(def.short ? { short: def.short } : {}), + ...(def.description ? + { description: normalize(def.description) } + : {}), + ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), + ...(def.default !== undefined ? { default: def.default } : {}), + ...(def.hint ? { hint: def.hint } : {}), + }, + ])); + } + /** + * Custom printer for `util.inspect` + */ + [inspect.custom](_, options) { + return `Jack ${inspect(this.toJSON(), options)}`; + } +} +/** + * Main entry point. Create and return a {@link Jack} object. + */ +export const jack = (options = {}) => new Jack(options); +// Unwrap and un-indent, so we can wrap description +// strings however makes them look nice in the code. +const normalize = (s, pre = false) => { + if (pre) + // prepend a ZWSP to each line so cliui doesn't strip it. + return s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n'); + return s + .split(/^\s*```\s*$/gm) + .map((s, i) => { + if (i % 2 === 1) { + if (!s.trim()) { + return `\`\`\`\n\`\`\`\n`; + } + // outdent the ``` blocks, but preserve whitespace otherwise. + const split = s.split('\n'); + // throw out the \n at the start and end + split.pop(); + split.shift(); + const si = split.reduce((shortest, l) => { + /* c8 ignore next */ + const ind = l.match(/^\s*/)?.[0] ?? ''; + if (ind.length) + return Math.min(ind.length, shortest); + else + return shortest; + }, Infinity); + /* c8 ignore next */ + const i = isFinite(si) ? si : 0; + return ('\n```\n' + + split.map(s => `\u200b${s.substring(i)}`).join('\n') + + '\n```\n'); + } + return (s + // remove single line breaks, except for lists + .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) + // normalize mid-line whitespace + .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') + // two line breaks are enough + .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim()); + }) + .join('\n'); +}; +// normalize for markdown printing, remove leading spaces on lines +const normalizeMarkdown = (s, pre = false) => { + const n = normalize(s, pre).replace(/\\/g, '\\\\'); + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') + .trim(); + return pre ? `\`${n}\`` : n; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..78e3651a0ec058b00788514b7063f0428bfcf62d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["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AAE,KAAK,EAAE,EAAE,CACnD;YACD,gCAAgC;aAC/B,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;YAC1C,6BAA6B;aAC5B,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,2CAA2C;aAC1C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC;aAC1B,IAAI,EAAE,CACV,CAAA;IACH,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC,CAAA;AAED,kEAAkE;AAClE,MAAM,iBAAiB,GAAG,CAAC,CAAS,EAAE,MAAe,KAAK,EAAU,EAAE;IACpE,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAClD,OAAO,GAAG,CAAC,CAAC;QACR,WAAW,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU;QAC/C,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;AACrC,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAE,MAAe,KAAK,EAAE,EAAE;IAC3D,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,IAAI,EAAE,CAAA;IACT,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA","sourcesContent":["import {\n inspect,\n InspectOptions,\n parseArgs,\n ParseArgsConfig,\n} from 'node:util'\n\nimport { cliui } from '@isaacs/cliui/min'\nimport { basename } from 'node:path'\n\nexport type ParseArgsOptions = Exclude<\n ParseArgsConfig['options'],\n undefined\n>\nexport type ParseArgsOption = ParseArgsOptions[string]\nexport type ParseArgsDefault = Exclude\n\nexport type ConfigType = 'number' | 'string' | 'boolean'\n\nexport const isConfigType = (t: unknown): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nexport type ConfigValuePrimitive = string | boolean | number\nexport type ConfigValueArray = string[] | boolean[] | number[]\nexport type ConfigValue = ConfigValuePrimitive | ConfigValueArray\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive\n : [T, M] extends [ConfigType, true] ? ConfigValueArray\n : ConfigValue\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport type ReadonlyArrays = readonly number[] | readonly string[]\n\n/**\n * Defines the type of validOptions that are valid, given a config definition's\n * {@link ConfigType}\n */\nexport type ValidOptions =\n T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : ReadonlyArrays\n\nconst isValidOption = (\n v: unknown,\n vo: readonly unknown[],\n): vo is Exclude, undefined> =>\n !!vo &&\n (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v))\n\n/**\n * A config field definition, in its full representation.\n * This is what is passed in to addFields so `type` is required.\n */\nexport type ConfigOption<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n O extends undefined | ValidOptions = undefined | ValidOptions,\n> = {\n type: T\n short?: string\n default?: ValidValue &\n (O extends ReadonlyArrays ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown)\n description?: string\n hint?: T extends 'boolean' ? undefined : string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n validOptions?: O\n delim?: M extends false ? undefined : string\n multiple?: M\n}\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based only\n * on its `type` and `multiple` property\n */\nexport const isConfigOptionOfType = <\n T extends ConfigType,\n M extends boolean,\n>(\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n !!o &&\n typeof o === 'object' &&\n 'type' in o &&\n isConfigType(o.type) &&\n o.type === type &&\n !!(o as { multiple?: boolean }).multiple === multi\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based on\n * it having all valid properties\n */\nexport const isConfigOption = (\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n isConfigOptionOfType(o, type, multi) &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi))\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean,\n O extends ConfigOption = ConfigOption,\n> = Pick, 'type'> & Omit\n\n/**\n * A set of {@link ConfigOption} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOption\n}\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = S & { [longOption in keyof S]: ConfigOption }\n\n/**\n * The 'values' field returned by {@link Jack#parse}. If a value has\n * a default field it will be required on the object otherwise it is optional.\n */\nexport type OptionsResults = {\n [K in keyof T]:\n | (T[K]['validOptions'] extends ReadonlyArrays ?\n T[K] extends ConfigOption<'string' | 'number', false> ?\n T[K]['validOptions'][number]\n : T[K] extends ConfigOption<'string' | 'number', true> ?\n T[K]['validOptions'][number][]\n : never\n : T[K] extends ConfigOption<'string', false> ? string\n : T[K] extends ConfigOption<'string', true> ? string[]\n : T[K] extends ConfigOption<'number', false> ? number\n : T[K] extends ConfigOption<'number', true> ? number[]\n : T[K] extends ConfigOption<'boolean', false> ? boolean\n : T[K] extends ConfigOption<'boolean', true> ? boolean[]\n : never)\n | (T[K]['default'] extends ConfigValue ? never : undefined)\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\n\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOption}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOption\n }\n\nconst width = Math.min(process?.stdout?.columns ?? 80, 80)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string =>\n [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n\nconst toEnvVal = (value: ConfigValue, delim: string = '\\n'): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: ConfigValue) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n { cause: { code: 'JACKSPEAK' } },\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\n\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\n// print the value type, for error message reporting\nconst valueType = (\n v: ConfigValue | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]`\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst validateFieldMeta = (\n field: ConfigOptionMeta,\n fieldMeta?: { type: T; multiple: M },\n): { type: ConfigType; multiple: boolean } => {\n if (fieldMeta) {\n if (field.type !== undefined && field.type !== fieldMeta.type) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: [fieldMeta.type, undefined],\n },\n })\n }\n if (\n field.multiple !== undefined &&\n !!field.multiple !== fieldMeta.multiple\n ) {\n throw new TypeError(`invalid multiple`, {\n cause: {\n found: field.multiple,\n wanted: [fieldMeta.multiple, undefined],\n },\n })\n }\n return fieldMeta\n }\n\n if (!isConfigType(field.type)) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: ['string', 'number', 'boolean'],\n },\n })\n }\n\n return {\n type: field.type,\n multiple: !!field.multiple,\n }\n}\n\nconst validateField = (\n o: ConfigOption,\n type: ConfigType,\n multiple: boolean,\n): ConfigOption => {\n const validateValidOptions = <\n T extends ConfigValue | undefined,\n V extends T extends Array ? U : T,\n >(\n def: T | undefined,\n validOptions: readonly V[] | undefined,\n ) => {\n if (!undefOrTypeArray(validOptions, type)) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: valueType({ type, multiple: true }),\n },\n })\n }\n if (def !== undefined && validOptions !== undefined) {\n const valid =\n Array.isArray(def) ?\n def.every(v => validOptions.includes(v as V))\n : validOptions.includes(def as V)\n if (!valid) {\n throw new TypeError('invalid default value not in validOptions', {\n cause: {\n found: def,\n wanted: validOptions,\n },\n })\n }\n }\n }\n\n if (\n o.default !== undefined &&\n !isValidValue(o.default, type, multiple)\n ) {\n throw new TypeError('invalid default value', {\n cause: {\n found: o.default,\n wanted: valueType({ type, multiple }),\n },\n })\n }\n\n if (\n isConfigOptionOfType(o, 'number', false) ||\n isConfigOptionOfType(o, 'number', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'string', false) ||\n isConfigOptionOfType(o, 'string', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'boolean', false) ||\n isConfigOptionOfType(o, 'boolean', true)\n ) {\n if (o.hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n if (o.validOptions !== undefined) {\n throw new TypeError('cannot provide validOptions for flag')\n }\n }\n\n return o\n}\n\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): ParseArgsOptions => {\n return Object.entries(options).reduce((acc, [longOption, o]) => {\n const p: ParseArgsOption = {\n type: 'string',\n multiple: !!o.multiple,\n ...(typeof o.short === 'string' ? { short: o.short } : undefined),\n }\n const setNoBool = () => {\n if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) {\n acc[`no-${longOption}`] = {\n type: 'boolean',\n multiple: !!o.multiple,\n }\n }\n }\n const setDefault = (\n def: T | undefined,\n fn: (d: T) => ParseArgsDefault,\n ) => {\n if (def !== undefined) {\n p.default = fn(def)\n }\n }\n if (isConfigOption(o, 'number', false)) {\n setDefault(o.default, String)\n } else if (isConfigOption(o, 'number', true)) {\n setDefault(o.default, d => d.map(v => String(v)))\n } else if (\n isConfigOption(o, 'string', false) ||\n isConfigOption(o, 'string', true)\n ) {\n setDefault(o.default, v => v)\n } else if (\n isConfigOption(o, 'boolean', false) ||\n isConfigOption(o, 'boolean', true)\n ) {\n p.type = 'boolean'\n setDefault(o.default, v => v)\n setNoBool()\n }\n acc[longOption] = p\n return acc\n }, {} as ParseArgsOptions)\n}\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: Record\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: Record\n #options: JackOptions\n #fields: UsageField[] = []\n #env: Record\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Resulting definitions, suitable to be passed to Node's `util.parseArgs`,\n * but also including `description` and `short` fields, if set.\n */\n get definitions(): C {\n return this.#configSet\n }\n\n /** map of `{ : }` strings for each short name defined */\n get shorts() {\n return this.#shorts\n }\n\n /**\n * options passed to the {@link Jack} constructor\n */\n get jackOptions() {\n return this.#options\n }\n\n /**\n * the data used to generate {@link Jack#usage} and\n * {@link Jack#usageMarkdown} content.\n */\n get usageFields() {\n return this.#fields\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: Partial>, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n if (source && er instanceof Error) {\n /* c8 ignore next */\n const cause = typeof er.cause === 'object' ? er.cause : {}\n er.cause = { ...cause, path: source }\n Error.captureStackTrace(er, this.setConfigValues)\n }\n throw er\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: {\n code: 'JACKSPEAK',\n found: field,\n },\n })\n }\n /* c8 ignore stop */\n my.default = value as ConfigValue\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const result = parseArgs({\n args,\n options: toParseArgsOptionsConfig(this.#configSet),\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {} as OptionsResults,\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: ConfigValue | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n code: 'JACKSPEAK',\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { code: 'JACKSPEAK', found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as Record\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as Record\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n const cause =\n validOptions && !isValidOption(value, validOptions) ?\n { name: field, found: value, validOptions }\n : valid && !valid(value) ? { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(value)}`,\n { cause: { ...cause, code: 'JACKSPEAK' } },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { code: 'JACKSPEAK', found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { code: 'JACKSPEAK', found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { code: 'JACKSPEAK', found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n const cause =\n config.validOptions && !isValidOption(value, config.validOptions) ?\n { name: field, found: value, validOptions: config.validOptions }\n : config.validate && !config.validate(value) ?\n { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid config value for ${field}: ${JSON.stringify(value)}`,\n {\n cause: { ...cause, code: 'JACKSPEAK' },\n },\n )\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value as ConfigValue,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', false)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', true)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', false)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', true)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', false)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', true)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n return this.#addFields(this as unknown as Jack, fields)\n }\n\n #addFieldsWith<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends ConfigSetFromMetaSet,\n >(fields: F, type: ConfigType, multiple: boolean): Jack {\n return this.#addFields(this as unknown as Jack, fields, {\n type,\n multiple,\n })\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends Jack,\n >(next: O, fields: F, opt?: { type: T; multiple: M }): O {\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const { type, multiple } = validateFieldMeta(field, opt)\n const value = { ...field, type, multiple }\n validateField(value, type, multiple)\n next.#fields.push({ type: 'config', name, value })\n return [name, value]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${name}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n //@ts-ignore\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n 'Valid options: ' +\n value.validOptions.map(v => JSON.stringify(v)).join(', ')\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..720b63988bfed3f6bc79dbde143ad1f06086028d --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js @@ -0,0 +1,33 @@ +import{inspect as q,parseArgs as yD}from"node:util";var iD=({onlyFirst:u=!1}={})=>{let t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,u?void 0:"g")},FD=iD(),P=u=>u.replace(FD,""),rD=u=>{var t=u.charCodeAt(0),e=u.length==2?u.charCodeAt(1):0,D=t;return 55296<=t&&t<=56319&&56320<=e&&e<=57343&&(t&=1023,e&=1023,D=t<<10|e,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},sD=()=>/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\u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DD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;function h(u,t={}){if(typeof u!="string"||u.length===0||(t={ambiguousIsNarrow:!0,...t},u=P(u),u.length===0))return 0;u=u.replace(sD()," ");let e=t.ambiguousIsNarrow?1:2,D=0;for(let n of u){let i=n.codePointAt(0);if(!(!i||i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(rD(n)){case"F":case"W":D+=2;break;case"A":D+=e;break;default:D+=1}}return D}var y={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},jD=Object.keys(y.modifier),CD=Object.keys(y.color),oD=Object.keys(y.bgColor),SD=[...CD,...oD],U=class{},G=new Map,T=u=>Object.fromEntries(Object.entries(u).map(([t,[e,D]])=>(G.set(e,D),[t,U.prototype[t]={open:`\x1B[${e}m`,close:`\x1B[${D}m`}]))),ED=new class extends U{codes=G;modifier=T(y.modifier);color={...T(y.color),close:"\x1B[39m",ansi:u=>`\x1B[${u}m`,ansi256:u=>`\x1B[38;5;${u}m`,ansi16m:(u,t,e)=>`\x1B[38;2;${u};${t};${e}m`};bgColor={...T(y.bgColor),close:"\x1B[49m",ansi:u=>`\x1B[${u+10}m`,ansi256:u=>`\x1B[48;5;${u}m`,ansi16m:(u,t,e)=>`\x1B[48;2;${u};${t};${e}m`};rgbToAnsi256(u,t,e){return u===t&&t===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(t/255*5)+Math.round(e/255*5)}hexToRgb(u){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!t)return[0,0,0];let[e]=t;e.length===3&&(e=[...e].map(n=>n+n).join(""));let D=Number.parseInt(e,16);return[D>>16&255,D>>8&255,D&255]}hexToAnsi256(u){return this.rgbToAnsi256(...this.hexToRgb(u))}ansi256ToAnsi(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let t,e,D;if(u>=232)t=((u-232)*10+8)/255,e=t,D=t;else{u-=16;let r=u%36;t=Math.floor(u/36)/5,e=Math.floor(r/6)/5,D=r%6/5}let n=Math.max(t,e,D)*2;if(n===0)return 30;let i=30+(Math.round(D)<<2|Math.round(e)<<1|Math.round(t));return n===2&&(i+=60),i}rgbToAnsi(u,t,e){return this.ansi256ToAnsi(this.rgbToAnsi256(u,t,e))}hexToAnsi(u){return this.ansi256ToAnsi(this.hexToAnsi256(u))}},j=new Set(["\x1B","\x9B"]),aD=39,M="\x07",_="[",lD="]",H="m",N=`${lD}8;;`,R=u=>`${j.values().next().value}${_}${u}${H}`,V=u=>`${j.values().next().value}${N}${u}${M}`,dD=u=>u.split(" ").map(t=>h(t)),k=(u,t,e)=>{let D=[...t],n=!1,i=!1,r=h(P(String(u[u.length-1])));for(let[F,s]of D.entries()){let C=h(s);if(r+C<=e?u[u.length-1]+=s:(u.push(s),r=0),j.has(s)&&(n=!0,i=D.slice(F+1).join("").startsWith(N)),n){i?s===M&&(n=!1,i=!1):s===H&&(n=!1);continue}r+=C,r===e&&F0&&u.length>1&&(u[u.length-2]=String(u[u.length-1])+u.pop())},hD=u=>{let t=u.split(" "),e=t.length;for(;e>0&&!(h(String(t[e-1]))>0);)e--;return e===t.length?u:t.slice(0,e).join(" ")+t.slice(e).join("")},pD=(u,t,e={})=>{if(e.trim!==!1&&u.trim()==="")return"";let D="",n,i,r=dD(u),F=[""];for(let[C,o]of u.split(" ").entries()){e.trim!==!1&&(F[F.length-1]=String(F[F.length-1]).trimStart());let E=h(String(F[F.length-1]));C!==0&&(E>=t&&(e.wordWrap===!1||e.trim===!1)&&(F.push(""),E=0),(E>0||e.trim===!1)&&(F[F.length-1]+=" ",E++));let l=Number(r[C]);if(e.hard&&l>t){let p=t-E,c=1+Math.floor((l-p-1)/t);Math.floor((l-1)/t)t&&E>0&&l>0){if(e.wordWrap===!1&&Et&&e.wordWrap===!1){k(F,o,t);continue}F[F.length-1]+=o}e.trim!==!1&&(F=F.map(C=>hD(C)));let s=[...F.join(` +`)];for(let[C,o]of s.entries()){if(D+=o,j.has(o)){let{groups:l}=new RegExp(`(?:\\${_}(?\\d+)m|\\${N}(?.*)${M})`).exec(s.slice(C).join(""))||{groups:{}};if(l.code!==void 0){let p=Number.parseFloat(l.code);n=p===aD?void 0:p}else l.uri!==void 0&&(i=l.uri.length===0?void 0:l.uri)}let E=ED.codes.get(Number(n));s[C+1]===` +`?(i&&(D+=V("")),n&&E&&(D+=R(E))):o===` +`&&(n&&E&&(D+=R(n)),i&&(D+=V(i)))}return D},BD=(u,t,e)=>String(u).normalize().replace(/\r\n/g,` +`).split(` +`).map(D=>pD(D,t,e)).join(` +`),cD={right:(u,t)=>`${" ".repeat(Math.max(0,t-h(u)))}${u}`,center:(u,t)=>`${" ".repeat(Math.max(0,t-h(u))>>1)}${u}`},fD=0,$=1,gD=2,x=3,AD=class{width;wrap;rows;constructor(u){this.width=u.width,this.wrap=u.wrap??!0,this.rows=[]}span(...u){let t=this.div(...u);t.span=!0}resetOutput(){this.rows=[]}div(...u){if(u.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...u)&&typeof u[0]=="string")return this.applyLayoutDSL(u[0]);let t=Object.assign(u.map(e=>typeof e=="string"?this.colFromString(e):e),{span:!1});return this.rows.push(t),t}shouldApplyLayoutDSL(...u){return u.length===1&&typeof u[0]=="string"&&/[\t\n]/.test(u[0])}applyLayoutDSL(u){let t=u.split(` +`).map(n=>n.split(" ")),e=0;t.forEach(n=>{n.length>1&&h(String(n[0]))>e&&(e=Math.min(Math.floor(this.width*.5),h(String(n[0]))))}),t.forEach(n=>{this.div(...n.map((i,r)=>({text:i.trim(),padding:this.measurePadding(i),width:r===0&&n.length>1?e:void 0})))});let D=this.rows[this.rows.length-1];if(!D)throw new Error("no rows found");return D}colFromString(u){return{text:u,padding:this.measurePadding(u)}}measurePadding(u){let t=P(u),[e="",D=""]=[t.match(/\s*$/)?.[0],t.match(/^\s*/)?.[0]];return[0,e.length,0,D.length]}toString(){let u=[];return this.rows.forEach(t=>{this.rowToString(t,u)}),u.filter(t=>!t.hidden).map(t=>t.text).join(` +`)}rowToString(u,t){return this.rasterize(u).forEach((e,D)=>{let n="";e.forEach((i,r)=>{let F=u[r],{width:s}=F,C=this.negatePadding(F),o=i;if(C>h(i)&&(o+=" ".repeat(C-h(i))),F.align&&F.align!=="left"&&this.wrap){let l=cD[F.align];if(o=l(o.trim(),C),h(o)0){let l=t[t.length-1];if(!l)throw new Error("last line not found");n=this.renderInline(n,l)}}),t.push({text:n.replace(/ +$/,""),span:u.span})}),t}renderInline(u,t){let e=u.match(/^ */),D=e?e[0].length:0,n=t.text,i=h(n.trimEnd());return t.span?this.wrap?D{n.width=e[i],this.wrap?D=BD(n.text,this.negatePadding(n),{hard:!0}).split(` +`):D=n.text.split(` +`),n.border&&(D.unshift("."+"-".repeat(this.negatePadding(n)+2)+"."),D.push("'"+"-".repeat(this.negatePadding(n)+2)+"'")),n.padding&&(D.unshift(...new Array(n.padding[fD]||0).fill("")),D.push(...new Array(n.padding[gD]||0).fill(""))),D.forEach((r,F)=>{t[F]||t.push([]);let s=t[F]??[];for(let C=0;Ci.width||h(i.text));let t=u.length,e=this.width,D=u.map(i=>{if(i.width)return t--,e-=i.width,i.width}),n=t?Math.floor(e/t):0;return D.map((i,r)=>{if(i===void 0){let F=u[r]??{text:"",padding:[]};return Math.max(n,mD(F))}return i})}},Z=(u,t,e)=>u.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":"",mD=u=>{let t=u.padding||[],e=1+(t[x]||0)+(t[$]||0);return u.border?e+4:e},wD=()=>typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80,Y=(u={})=>new AD({width:u?.width||wD(),wrap:u?.wrap});import{basename as Q}from"node:path";var uD=u=>typeof u=="string"&&(u==="string"||u==="number"||u==="boolean"),O=(u,t,e)=>e?Array.isArray(u)?!u.some(D=>!O(D,t,!1)):!1:Array.isArray(u)?!1:typeof u===t,W=(u,t)=>!!t&&(Array.isArray(u)?u.every(e=>W(e,t)):t.includes(u)),g=(u,t,e)=>!!u&&typeof u=="object"&&"type"in u&&uD(u.type)&&u.type===t&&!!u.multiple===e,b=(u,t,e)=>g(u,t,e)&&S(u.short,"string")&&S(u.description,"string")&&S(u.hint,"string")&&S(u.validate,"function")&&(u.type==="boolean"?u.validOptions===void 0:nD(u.validOptions,u.type))&&(u.default===void 0||O(u.default,t,e)),K=u=>u.type==="heading",X=u=>u.type==="description",I=Math.min(process?.stdout?.columns??80,80),J=u=>(u-1)*2,DD=(u,t)=>[u,t.replace(/[^a-zA-Z0-9]+/g," ")].join(" ").trim().toUpperCase().replace(/ /g,"_"),tD=(u,t=` +`)=>{let e=typeof u=="string"?u:typeof u=="boolean"?u?"1":"0":typeof u=="number"?String(u):Array.isArray(u)?u.map(D=>tD(D)).join(t):void 0;if(typeof e!="string")throw new Error(`could not serialize value to environment: ${JSON.stringify(u)}`,{cause:{code:"JACKSPEAK"}});return e},eD=(u,t,e,D=` +`)=>e?u?u.split(D).map(n=>eD(n,t,!1)):[]:t==="string"?u:t==="boolean"?u==="1":+u.trim(),S=(u,t)=>u===void 0||typeof u===t,nD=(u,t)=>u===void 0||Array.isArray(u)&&u.every(e=>typeof e===t),m=u=>typeof u=="string"?"string":typeof u=="boolean"?"boolean":typeof u=="number"?"number":Array.isArray(u)?`${bD([...new Set(u.map(t=>m(t)))])}[]`:`${u.type}${u.multiple?"[]":""}`,bD=u=>u.length===1&&typeof u[0]=="string"?u[0]:`(${u.join("|")})`,vD=(u,t)=>{if(t){if(u.type!==void 0&&u.type!==t.type)throw new TypeError("invalid type",{cause:{found:u.type,wanted:[t.type,void 0]}});if(u.multiple!==void 0&&!!u.multiple!==t.multiple)throw new TypeError("invalid multiple",{cause:{found:u.multiple,wanted:[t.multiple,void 0]}});return t}if(!uD(u.type))throw new TypeError("invalid type",{cause:{found:u.type,wanted:["string","number","boolean"]}});return{type:u.type,multiple:!!u.multiple}},$D=(u,t,e)=>{let D=(n,i)=>{if(!nD(i,t))throw new TypeError("invalid validOptions",{cause:{found:i,wanted:m({type:t,multiple:!0})}});if(n!==void 0&&i!==void 0&&!(Array.isArray(n)?n.every(F=>i.includes(F)):i.includes(n)))throw new TypeError("invalid default value not in validOptions",{cause:{found:n,wanted:i}})};if(u.default!==void 0&&!O(u.default,t,e))throw new TypeError("invalid default value",{cause:{found:u.default,wanted:m({type:t,multiple:e})}});if(g(u,"number",!1)||g(u,"number",!0))D(u.default,u.validOptions);else if(g(u,"string",!1)||g(u,"string",!0))D(u.default,u.validOptions);else if(g(u,"boolean",!1)||g(u,"boolean",!0)){if(u.hint!==void 0)throw new TypeError("cannot provide hint for flag");if(u.validOptions!==void 0)throw new TypeError("cannot provide validOptions for flag")}return u},xD=u=>Object.entries(u).reduce((t,[e,D])=>{let n={type:"string",multiple:!!D.multiple,...typeof D.short=="string"?{short:D.short}:void 0},i=()=>{!e.startsWith("no-")&&!u[`no-${e}`]&&(t[`no-${e}`]={type:"boolean",multiple:!!D.multiple})},r=(F,s)=>{F!==void 0&&(n.default=s(F))};return b(D,"number",!1)?r(D.default,String):b(D,"number",!0)?r(D.default,F=>F.map(s=>String(s))):b(D,"string",!1)||b(D,"string",!0)?r(D.default,F=>F):(b(D,"boolean",!1)||b(D,"boolean",!0))&&(n.type="boolean",r(D.default,F=>F),i()),t[e]=n,t},{}),z=class{#D;#e;#u;#t=[];#F;#i;#C;#r;#s;constructor(t={}){this.#u=t,this.#C=t.allowPositionals!==!1,this.#F=this.#u.env===void 0?process.env:this.#u.env,this.#i=t.envPrefix,this.#D=Object.create(null),this.#e=Object.create(null)}get definitions(){return this.#D}get shorts(){return this.#e}get jackOptions(){return this.#u}get usageFields(){return this.#t}setConfigValues(t,e=""){try{this.validate(t)}catch(D){if(e&&D instanceof Error){let n=typeof D.cause=="object"?D.cause:{};D.cause={...n,path:e},Error.captureStackTrace(D,this.setConfigValues)}throw D}for(let[D,n]of Object.entries(t)){let i=this.#D[D];if(!i)throw new Error("unexpected field in config set: "+D,{cause:{code:"JACKSPEAK",found:D}});i.default=n}return this}parse(t=process.argv){this.loadEnvDefaults();let e=this.parseRaw(t);return this.applyDefaults(e),this.writeEnv(e),e}loadEnvDefaults(){if(this.#i)for(let[t,e]of Object.entries(this.#D)){let D=DD(this.#i,t),n=this.#F[D];n!==void 0&&(e.default=eD(n,e.type,!!e.multiple,e.delim))}}applyDefaults(t){for(let[e,D]of Object.entries(this.#D))D.default!==void 0&&!(e in t.values)&&(t.values[e]=D.default)}parseRaw(t){t===process.argv&&(t=t.slice(process._eval!==void 0?1:2));let e=yD({args:t,options:xD(this.#D),strict:!1,allowPositionals:this.#C,tokens:!0}),D={values:{},positionals:[]};for(let n of e.tokens)if(n.kind==="positional"){if(D.positionals.push(n.value),this.#u.stopAtPositional||this.#u.stopAtPositionalTest?.(n.value)){D.positionals.push(...t.slice(n.index+1));break}}else if(n.kind==="option"){let i;if(n.name.startsWith("no-")){let F=this.#D[n.name],s=n.name.substring(3),C=this.#D[s];C&&C.type==="boolean"&&(!F||F.type==="boolean"&&!!F.multiple==!!C.multiple)&&(i=!1,n.name=s)}let r=this.#D[n.name];if(!r)throw new Error(`Unknown option '${n.rawName}'. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${n.rawName}'`,{cause:{code:"JACKSPEAK",found:n.rawName+(n.value?`=${n.value}`:"")}});if(i===void 0)if(n.value===void 0){if(r.type!=="boolean")throw new Error(`No value provided for ${n.rawName}, expected ${r.type}`,{cause:{code:"JACKSPEAK",name:n.rawName,wanted:m(r)}});i=!0}else{if(r.type==="boolean")throw new Error(`Flag ${n.rawName} does not take a value, received '${n.value}'`,{cause:{code:"JACKSPEAK",found:n}});if(r.type==="string")i=n.value;else if(i=+n.value,i!==i)throw new Error(`Invalid value '${n.value}' provided for '${n.rawName}' option, expected number`,{cause:{code:"JACKSPEAK",name:n.rawName,found:n.value,wanted:"number"}})}if(r.multiple){let F=D.values,s=F[n.name]??[];F[n.name]=s,s.push(i)}else{let F=D.values;F[n.name]=i}}for(let[n,i]of Object.entries(D.values)){let r=this.#D[n]?.validate,F=this.#D[n]?.validOptions,s=F&&!W(i,F)?{name:n,found:i,validOptions:F}:r&&!r(i)?{name:n,found:i}:void 0;if(s)throw new Error(`Invalid value provided for --${n}: ${JSON.stringify(i)}`,{cause:{...s,code:"JACKSPEAK"}})}return D}#o(t,e,D=t){if(!t.startsWith("no-")||typeof e!="boolean")return;let n=t.substring(3);if(this.#o(n,e,D),this.#D[n]?.type==="boolean")throw new Error(`do not set '${D}', instead set '${n}' as desired.`,{cause:{code:"JACKSPEAK",found:D,wanted:n}})}validate(t){if(!t||typeof t!="object")throw new Error("Invalid config: not an object",{cause:{code:"JACKSPEAK",found:t}});let e=t;for(let D in t){let n=e[D];if(n===void 0)continue;this.#o(D,n);let i=this.#D[D];if(!i)throw new Error(`Unknown config option: ${D}`,{cause:{code:"JACKSPEAK",found:D}});if(!O(n,i.type,!!i.multiple))throw new Error(`Invalid value ${m(n)} for ${D}, expected ${m(i)}`,{cause:{code:"JACKSPEAK",name:D,found:n,wanted:m(i)}});let r=i.validOptions&&!W(n,i.validOptions)?{name:D,found:n,validOptions:i.validOptions}:i.validate&&!i.validate(n)?{name:D,found:n}:void 0;if(r)throw new Error(`Invalid config value for ${D}: ${JSON.stringify(n)}`,{cause:{...r,code:"JACKSPEAK"}})}}writeEnv(t){if(!(!this.#F||!this.#i))for(let[e,D]of Object.entries(t.values)){let n=this.#D[e];this.#F[DD(this.#i,e)]=tD(D,n?.delim)}}heading(t,e,{pre:D=!1}={}){return e===void 0&&(e=this.#t.some(n=>K(n))?2:1),this.#t.push({type:"heading",text:t,level:e,pre:D}),this}description(t,{pre:e}={}){return this.#t.push({type:"description",text:t,pre:e}),this}num(t){return this.#n(t,"number",!1)}numList(t){return this.#n(t,"number",!0)}opt(t){return this.#n(t,"string",!1)}optList(t){return this.#n(t,"string",!0)}flag(t){return this.#n(t,"boolean",!1)}flagList(t){return this.#n(t,"boolean",!0)}addFields(t){return this.#E(this,t)}#n(t,e,D){return this.#E(this,t,{type:e,multiple:D})}#E(t,e,D){return Object.assign(t.#D,Object.fromEntries(Object.entries(e).map(([n,i])=>{this.#l(n,i);let{type:r,multiple:F}=vD(i,D),s={...i,type:r,multiple:F};return $D(s,r,F),t.#t.push({type:"config",name:n,value:s}),[n,s]}))),t}#l(t,e){if(!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(t))throw new TypeError(`Invalid option name: ${t}, must be '-' delimited ASCII alphanumeric`);if(this.#D[t])throw new TypeError(`Cannot redefine option ${t}`);if(this.#e[t])throw new TypeError(`Cannot redefine option ${t}, already in use for ${this.#e[t]}`);if(e.short){if(!/^[a-zA-Z0-9]$/.test(e.short))throw new TypeError(`Invalid ${t} short option: ${e.short}, must be 1 ASCII alphanumeric character`);if(this.#e[e.short])throw new TypeError(`Invalid ${t} short option: ${e.short}, already in use for ${this.#e[e.short]}`);this.#e[e.short]=t,this.#e[t]=t}}usage(){if(this.#r)return this.#r;let t=1,e=Y({width:I}),D=this.#t[0],n=D?.type==="heading"?1:0;if(D?.type==="heading"&&e.div({padding:[0,0,0,0],text:A(D.text)}),e.div({padding:[0,0,0,0],text:"Usage:"}),this.#u.usage)e.div({text:this.#u.usage,padding:[0,0,0,2]});else{let s=Q(String(process.argv[1])),C=[],o=[],E=[],l=[];for(let[a,B]of Object.entries(this.#D))B.short?B.type==="boolean"?C.push(B.short):o.push([B.short,B.hint||a]):B.type==="boolean"?E.push(a):l.push([a,B.hint||a]);let p=C.length?" -"+C.join(""):"",c=o.map(([a,B])=>` --${a}=<${B}>`).join(""),w=E.map(a=>` --${a}`).join(""),f=l.map(([a,B])=>` --${a}=<${B}>`).join(""),d=`${s}${p}${c}${w}${f}`.trim();e.div({text:d,padding:[0,0,0,2]})}e.div({padding:[0,0,0,0],text:""});let i=this.#t[n];if(i&&X(i)){let s=A(i.text,i.pre);n++,e.div({padding:[0,0,0,0],text:s}),e.div({padding:[0,0,0,0],text:""})}let{rows:r,maxWidth:F}=this.#a(n);for(let s of r)if(s.left){let C=J(Math.max(t,2));s.left.length>F-3?(e.div({text:s.left,padding:[0,0,0,C]}),e.div({text:s.text,padding:[0,0,0,F]})):e.div({text:s.left,padding:[0,1,0,C],width:F},{padding:[0,0,0,0],text:s.text}),s.skipLine&&e.div({padding:[0,0,0,0],text:""})}else if(K(s)){let{level:C}=s;t=C;let o=C<=2?1:0;e.div({...s,padding:[0,0,o,J(C)]})}else e.div({...s,padding:[0,0,1,J(t+1)]});return this.#r=e.toString()}usageMarkdown(){if(this.#s)return this.#s;let t=[],e=1,D=this.#t[0],n=D?.type==="heading"?1:0;if(D?.type==="heading"&&t.push(`# ${L(D.text)}`),t.push("Usage:"),this.#u.usage)t.push(v(this.#u.usage,!0));else{let F=Q(String(process.argv[1])),s=[],C=[],o=[],E=[];for(let[d,a]of Object.entries(this.#D))a.short?a.type==="boolean"?s.push(a.short):C.push([a.short,a.hint||d]):a.type==="boolean"?o.push(d):E.push([d,a.hint||d]);let l=s.length?" -"+s.join(""):"",p=C.map(([d,a])=>` --${d}=<${a}>`).join(""),c=o.map(d=>` --${d}`).join(""),w=E.map(([d,a])=>` --${d}=<${a}>`).join(""),f=`${F}${l}${p}${c}${w}`.trim();t.push(v(f,!0))}let i=this.#t[n];i&&X(i)&&(t.push(v(i.text,i.pre)),n++);let{rows:r}=this.#a(n);for(let F of r)if(F.left)t.push("#".repeat(e+1)+" "+L(F.left,!0)),F.text&&t.push(v(F.text));else if(K(F)){let{level:s}=F;e=s,t.push(`${"#".repeat(e)} ${L(F.text,F.pre)}`)}else t.push(v(F.text,!!F.pre));return this.#s=t.join(` + +`)+` +`}#a(t){let e=Math.max(12,Math.min(26,Math.floor(I/3))),D=8,n,i=[];for(let r of this.#t.slice(t)){if(r.type!=="config"){n?.type==="config"&&(n.skipLine=!0),n=void 0,r.text=A(r.text,!!r.pre),i.push(r);continue}let{value:F}=r,s=F.description||"",C=F.multiple?"Can be set multiple times":"",o=F.validOptions?.length?"Valid options: "+F.validOptions.map(B=>JSON.stringify(B)).join(", "):"",E=s.includes(` +`)?` + +`:` +`,l=[o,C].join(E).trim(),p=(A(s)+E+l).trim(),c=F.hint||(F.type==="number"?"n":F.type==="string"?r.name:void 0),w=F.short?F.type==="boolean"?`-${F.short} `:`-${F.short}<${c}> `:"",f=F.type==="boolean"?`${w}--${r.name}`:`${w}--${r.name}=<${c}>`,d={text:p,left:f,type:"config"};p.length>I-e&&(d.skipLine=!0),n&&f.length>e&&(n.skipLine=!0),n=d;let a=f.length+4;a>D&&a[t,{type:e.type,...e.multiple?{multiple:!0}:{},...e.delim?{delim:e.delim}:{},...e.short?{short:e.short}:{},...e.description?{description:A(e.description)}:{},...e.validate?{validate:e.validate}:{},...e.validOptions?{validOptions:e.validOptions}:{},...e.default!==void 0?{default:e.default}:{},...e.hint?{hint:e.hint}:{}}]))}[q.custom](t,e){return`Jack ${q(this.toJSON(),e)}`}},ID=(u={})=>new z(u),A=(u,t=!1)=>t?u.split(` +`).map(e=>`\u200B${e}`).join(` +`):u.split(/^\s*```\s*$/gm).map((e,D)=>{if(D%2===1){if(!e.trim())return"```\n```\n";let n=e.split(` +`);n.pop(),n.shift();let i=n.reduce((F,s)=>{let C=s.match(/^\s*/)?.[0]??"";return C.length?Math.min(C.length,F):F},1/0),r=isFinite(i)?i:0;return"\n```\n"+n.map(F=>`\u200B${F.substring(r)}`).join(` +`)+"\n```\n"}return e.replace(/([^\n])\n[ \t]*([^\n])/g,(n,i,r)=>/^[-*]/.test(r)?`${i} +${r}`:`${i} ${r}`).replace(/([^\n])[ \t]+([^\n])/g,"$1 $2").replace(/\n{3,}/g,` + +`).replace(/\n[ \t]+/g,` +`).trim()}).join(` +`),v=(u,t=!1)=>{let e=A(u,t).replace(/\\/g,"\\\\");return t?`\`\`\` +${e.replace(/\u200b/g,"")} +\`\`\``:e.replace(/\n +/g,` +`).trim()},L=(u,t=!1)=>{let e=A(u,t).replace(/[\s\u200b]+/g," ").trim();return t?`\`${e}\``:e};export{z as Jack,b as isConfigOption,g as isConfigOptionOfType,uD as isConfigType,ID as jack}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..eda81fe55718b8d14190e04101b763586d4a8ce0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/index.ts", "../../node_modules/@isaacs/cliui/src/ansi-regex/index.ts", "../../node_modules/@isaacs/cliui/src/strip-ansi/index.ts", "../../node_modules/@isaacs/cliui/src/eastasianwidth/index.ts", "../../node_modules/@isaacs/cliui/src/emoji-regex/index.ts", "../../node_modules/@isaacs/cliui/src/string-width/index.ts", "../../node_modules/@isaacs/cliui/src/ansi-styles/index.ts", "../../node_modules/@isaacs/cliui/src/wrap-ansi/index.ts", "../../node_modules/@isaacs/cliui/src/index.ts"], + "sourcesContent": ["import {\n inspect,\n InspectOptions,\n parseArgs,\n ParseArgsConfig,\n} from 'node:util'\n\nimport { cliui } from '@isaacs/cliui/min'\nimport { basename } from 'node:path'\n\nexport type ParseArgsOptions = Exclude<\n ParseArgsConfig['options'],\n undefined\n>\nexport type ParseArgsOption = ParseArgsOptions[string]\nexport type ParseArgsDefault = Exclude\n\nexport type ConfigType = 'number' | 'string' | 'boolean'\n\nexport const isConfigType = (t: unknown): t is ConfigType =>\n typeof t === 'string' &&\n (t === 'string' || t === 'number' || t === 'boolean')\n\nexport type ConfigValuePrimitive = string | boolean | number\nexport type ConfigValueArray = string[] | boolean[] | number[]\nexport type ConfigValue = ConfigValuePrimitive | ConfigValueArray\n\n/**\n * Given a Jack object, get the typeof its ConfigSet\n */\nexport type Unwrap = J extends Jack ? C : never\n\n/**\n * Defines the type of value that is valid, given a config definition's\n * {@link ConfigType} and boolean multiple setting\n */\nexport type ValidValue<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n> =\n [T, M] extends ['number', true] ? number[]\n : [T, M] extends ['string', true] ? string[]\n : [T, M] extends ['boolean', true] ? boolean[]\n : [T, M] extends ['number', false] ? number\n : [T, M] extends ['string', false] ? string\n : [T, M] extends ['boolean', false] ? boolean\n : [T, M] extends ['string', boolean] ? string | string[]\n : [T, M] extends ['boolean', boolean] ? boolean | boolean[]\n : [T, M] extends ['number', boolean] ? number | number[]\n : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive\n : [T, M] extends [ConfigType, true] ? ConfigValueArray\n : ConfigValue\n\nconst isValidValue = (\n v: unknown,\n type: T,\n multi: M,\n): v is ValidValue => {\n if (multi) {\n if (!Array.isArray(v)) return false\n return !v.some((v: unknown) => !isValidValue(v, type, false))\n }\n if (Array.isArray(v)) return false\n return typeof v === type\n}\n\nexport type ReadonlyArrays = readonly number[] | readonly string[]\n\n/**\n * Defines the type of validOptions that are valid, given a config definition's\n * {@link ConfigType}\n */\nexport type ValidOptions =\n T extends 'boolean' ? undefined\n : T extends 'string' ? readonly string[]\n : T extends 'number' ? readonly number[]\n : ReadonlyArrays\n\nconst isValidOption = (\n v: unknown,\n vo: readonly unknown[],\n): vo is Exclude, undefined> =>\n !!vo &&\n (Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v))\n\n/**\n * A config field definition, in its full representation.\n * This is what is passed in to addFields so `type` is required.\n */\nexport type ConfigOption<\n T extends ConfigType = ConfigType,\n M extends boolean = boolean,\n O extends undefined | ValidOptions = undefined | ValidOptions,\n> = {\n type: T\n short?: string\n default?: ValidValue &\n (O extends ReadonlyArrays ?\n M extends false ?\n O[number]\n : O[number][]\n : unknown)\n description?: string\n hint?: T extends 'boolean' ? undefined : string\n validate?:\n | ((v: unknown) => v is ValidValue)\n | ((v: unknown) => boolean)\n validOptions?: O\n delim?: M extends false ? undefined : string\n multiple?: M\n}\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based only\n * on its `type` and `multiple` property\n */\nexport const isConfigOptionOfType = <\n T extends ConfigType,\n M extends boolean,\n>(\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n !!o &&\n typeof o === 'object' &&\n 'type' in o &&\n isConfigType(o.type) &&\n o.type === type &&\n !!(o as { multiple?: boolean }).multiple === multi\n\n/**\n * Determine whether an unknown object is a {@link ConfigOption} based on\n * it having all valid properties\n */\nexport const isConfigOption = (\n o: unknown,\n type: T,\n multi: M,\n): o is ConfigOption =>\n isConfigOptionOfType(o, type, multi) &&\n undefOrType(o.short, 'string') &&\n undefOrType(o.description, 'string') &&\n undefOrType(o.hint, 'string') &&\n undefOrType(o.validate, 'function') &&\n (o.type === 'boolean' ?\n o.validOptions === undefined\n : undefOrTypeArray(o.validOptions, o.type)) &&\n (o.default === undefined || isValidValue(o.default, type, multi))\n\n/**\n * The meta information for a config option definition, when the\n * type and multiple values can be inferred by the method being used\n */\nexport type ConfigOptionMeta<\n T extends ConfigType,\n M extends boolean,\n O extends ConfigOption = ConfigOption,\n> = Pick, 'type'> & Omit\n\n/**\n * A set of {@link ConfigOption} objects, referenced by their longOption\n * string values.\n */\nexport type ConfigSet = {\n [longOption: string]: ConfigOption\n}\n\n/**\n * A set of {@link ConfigOptionMeta} fields, referenced by their longOption\n * string values.\n */\nexport type ConfigMetaSet = {\n [longOption: string]: ConfigOptionMeta\n}\n\n/**\n * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}\n */\nexport type ConfigSetFromMetaSet<\n T extends ConfigType,\n M extends boolean,\n S extends ConfigMetaSet,\n> = S & { [longOption in keyof S]: ConfigOption }\n\n/**\n * The 'values' field returned by {@link Jack#parse}. If a value has\n * a default field it will be required on the object otherwise it is optional.\n */\nexport type OptionsResults = {\n [K in keyof T]:\n | (T[K]['validOptions'] extends ReadonlyArrays ?\n T[K] extends ConfigOption<'string' | 'number', false> ?\n T[K]['validOptions'][number]\n : T[K] extends ConfigOption<'string' | 'number', true> ?\n T[K]['validOptions'][number][]\n : never\n : T[K] extends ConfigOption<'string', false> ? string\n : T[K] extends ConfigOption<'string', true> ? string[]\n : T[K] extends ConfigOption<'number', false> ? number\n : T[K] extends ConfigOption<'number', true> ? number[]\n : T[K] extends ConfigOption<'boolean', false> ? boolean\n : T[K] extends ConfigOption<'boolean', true> ? boolean[]\n : never)\n | (T[K]['default'] extends ConfigValue ? never : undefined)\n}\n\n/**\n * The object retured by {@link Jack#parse}\n */\nexport type Parsed = {\n values: OptionsResults\n positionals: string[]\n}\n\n/**\n * A row used when generating the {@link Jack#usage} string\n */\nexport interface Row {\n left?: string\n text: string\n skipLine?: boolean\n type?: string\n}\n\n/**\n * A heading for a section in the usage, created by the jack.heading()\n * method.\n *\n * First heading is always level 1, subsequent headings default to 2.\n *\n * The level of the nearest heading level sets the indentation of the\n * description that follows.\n */\nexport interface Heading extends Row {\n type: 'heading'\n text: string\n left?: ''\n skipLine?: boolean\n level: number\n pre?: boolean\n}\n\nconst isHeading = (r: { type?: string }): r is Heading =>\n r.type === 'heading'\n\n/**\n * An arbitrary blob of text describing some stuff, set by the\n * jack.description() method.\n *\n * Indentation determined by level of the nearest header.\n */\nexport interface Description extends Row {\n type: 'description'\n text: string\n left?: ''\n skipLine?: boolean\n pre?: boolean\n}\n\nconst isDescription = (r: { type?: string }): r is Description =>\n r.type === 'description'\n\n/**\n * A heading or description row used when generating the {@link Jack#usage}\n * string\n */\nexport type TextRow = Heading | Description\n\n/**\n * Either a {@link TextRow} or a reference to a {@link ConfigOption}\n */\nexport type UsageField =\n | TextRow\n | {\n type: 'config'\n name: string\n value: ConfigOption\n }\n\nconst width = Math.min(process?.stdout?.columns ?? 80, 80)\n\n// indentation spaces from heading level\nconst indent = (n: number) => (n - 1) * 2\n\nconst toEnvKey = (pref: string, key: string): string =>\n [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]\n .join(' ')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_')\n\nconst toEnvVal = (value: ConfigValue, delim: string = '\\n'): string => {\n const str =\n typeof value === 'string' ? value\n : typeof value === 'boolean' ?\n value ? '1'\n : '0'\n : typeof value === 'number' ? String(value)\n : Array.isArray(value) ?\n value.map((v: ConfigValue) => toEnvVal(v)).join(delim)\n : /* c8 ignore start */ undefined\n if (typeof str !== 'string') {\n throw new Error(\n `could not serialize value to environment: ${JSON.stringify(value)}`,\n { cause: { code: 'JACKSPEAK' } },\n )\n }\n /* c8 ignore stop */\n return str\n}\n\nconst fromEnvVal = (\n env: string,\n type: T,\n multiple: M,\n delim: string = '\\n',\n): ValidValue =>\n (multiple ?\n env ? env.split(delim).map(v => fromEnvVal(v, type, false))\n : []\n : type === 'string' ? env\n : type === 'boolean' ? env === '1'\n : +env.trim()) as ValidValue\n\nconst undefOrType = (v: unknown, t: string): boolean =>\n v === undefined || typeof v === t\n\nconst undefOrTypeArray = (v: unknown, t: string): boolean =>\n v === undefined || (Array.isArray(v) && v.every(x => typeof x === t))\n\n// print the value type, for error message reporting\nconst valueType = (\n v: ConfigValue | { type: ConfigType; multiple?: boolean },\n): string =>\n typeof v === 'string' ? 'string'\n : typeof v === 'boolean' ? 'boolean'\n : typeof v === 'number' ? 'number'\n : Array.isArray(v) ?\n `${joinTypes([...new Set(v.map(v => valueType(v)))])}[]`\n : `${v.type}${v.multiple ? '[]' : ''}`\n\nconst joinTypes = (types: string[]): string =>\n types.length === 1 && typeof types[0] === 'string' ?\n types[0]\n : `(${types.join('|')})`\n\nconst validateFieldMeta = (\n field: ConfigOptionMeta,\n fieldMeta?: { type: T; multiple: M },\n): { type: ConfigType; multiple: boolean } => {\n if (fieldMeta) {\n if (field.type !== undefined && field.type !== fieldMeta.type) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: [fieldMeta.type, undefined],\n },\n })\n }\n if (\n field.multiple !== undefined &&\n !!field.multiple !== fieldMeta.multiple\n ) {\n throw new TypeError(`invalid multiple`, {\n cause: {\n found: field.multiple,\n wanted: [fieldMeta.multiple, undefined],\n },\n })\n }\n return fieldMeta\n }\n\n if (!isConfigType(field.type)) {\n throw new TypeError(`invalid type`, {\n cause: {\n found: field.type,\n wanted: ['string', 'number', 'boolean'],\n },\n })\n }\n\n return {\n type: field.type,\n multiple: !!field.multiple,\n }\n}\n\nconst validateField = (\n o: ConfigOption,\n type: ConfigType,\n multiple: boolean,\n): ConfigOption => {\n const validateValidOptions = <\n T extends ConfigValue | undefined,\n V extends T extends Array ? U : T,\n >(\n def: T | undefined,\n validOptions: readonly V[] | undefined,\n ) => {\n if (!undefOrTypeArray(validOptions, type)) {\n throw new TypeError('invalid validOptions', {\n cause: {\n found: validOptions,\n wanted: valueType({ type, multiple: true }),\n },\n })\n }\n if (def !== undefined && validOptions !== undefined) {\n const valid =\n Array.isArray(def) ?\n def.every(v => validOptions.includes(v as V))\n : validOptions.includes(def as V)\n if (!valid) {\n throw new TypeError('invalid default value not in validOptions', {\n cause: {\n found: def,\n wanted: validOptions,\n },\n })\n }\n }\n }\n\n if (\n o.default !== undefined &&\n !isValidValue(o.default, type, multiple)\n ) {\n throw new TypeError('invalid default value', {\n cause: {\n found: o.default,\n wanted: valueType({ type, multiple }),\n },\n })\n }\n\n if (\n isConfigOptionOfType(o, 'number', false) ||\n isConfigOptionOfType(o, 'number', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'string', false) ||\n isConfigOptionOfType(o, 'string', true)\n ) {\n validateValidOptions(o.default, o.validOptions)\n } else if (\n isConfigOptionOfType(o, 'boolean', false) ||\n isConfigOptionOfType(o, 'boolean', true)\n ) {\n if (o.hint !== undefined) {\n throw new TypeError('cannot provide hint for flag')\n }\n if (o.validOptions !== undefined) {\n throw new TypeError('cannot provide validOptions for flag')\n }\n }\n\n return o\n}\n\nconst toParseArgsOptionsConfig = (\n options: ConfigSet,\n): ParseArgsOptions => {\n return Object.entries(options).reduce((acc, [longOption, o]) => {\n const p: ParseArgsOption = {\n type: 'string',\n multiple: !!o.multiple,\n ...(typeof o.short === 'string' ? { short: o.short } : undefined),\n }\n const setNoBool = () => {\n if (!longOption.startsWith('no-') && !options[`no-${longOption}`]) {\n acc[`no-${longOption}`] = {\n type: 'boolean',\n multiple: !!o.multiple,\n }\n }\n }\n const setDefault = (\n def: T | undefined,\n fn: (d: T) => ParseArgsDefault,\n ) => {\n if (def !== undefined) {\n p.default = fn(def)\n }\n }\n if (isConfigOption(o, 'number', false)) {\n setDefault(o.default, String)\n } else if (isConfigOption(o, 'number', true)) {\n setDefault(o.default, d => d.map(v => String(v)))\n } else if (\n isConfigOption(o, 'string', false) ||\n isConfigOption(o, 'string', true)\n ) {\n setDefault(o.default, v => v)\n } else if (\n isConfigOption(o, 'boolean', false) ||\n isConfigOption(o, 'boolean', true)\n ) {\n p.type = 'boolean'\n setDefault(o.default, v => v)\n setNoBool()\n }\n acc[longOption] = p\n return acc\n }, {} as ParseArgsOptions)\n}\n\n/**\n * Options provided to the {@link Jack} constructor\n */\nexport interface JackOptions {\n /**\n * Whether to allow positional arguments\n *\n * @default true\n */\n allowPositionals?: boolean\n\n /**\n * Prefix to use when reading/writing the environment variables\n *\n * If not specified, environment behavior will not be available.\n */\n envPrefix?: string\n\n /**\n * Environment object to read/write. Defaults `process.env`.\n * No effect if `envPrefix` is not set.\n */\n env?: Record\n\n /**\n * A short usage string. If not provided, will be generated from the\n * options provided, but that can of course be rather verbose if\n * there are a lot of options.\n */\n usage?: string\n\n /**\n * Stop parsing flags and opts at the first positional argument.\n * This is to support cases like `cmd [flags] [options]`, where\n * each subcommand may have different options. This effectively treats\n * any positional as a `--` argument. Only relevant if `allowPositionals`\n * is true.\n *\n * To do subcommands, set this option, look at the first positional, and\n * parse the remaining positionals as appropriate.\n *\n * @default false\n */\n stopAtPositional?: boolean\n\n /**\n * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,\n * will be called with each positional argument encountered. If the function\n * returns true, then parsing will stop at that point.\n */\n stopAtPositionalTest?: (arg: string) => boolean\n}\n\n/**\n * Class returned by the {@link jack} function and all configuration\n * definition methods. This is what gets chained together.\n */\nexport class Jack {\n #configSet: C\n #shorts: Record\n #options: JackOptions\n #fields: UsageField[] = []\n #env: Record\n #envPrefix?: string\n #allowPositionals: boolean\n #usage?: string\n #usageMarkdown?: string\n\n constructor(options: JackOptions = {}) {\n this.#options = options\n this.#allowPositionals = options.allowPositionals !== false\n this.#env =\n this.#options.env === undefined ? process.env : this.#options.env\n this.#envPrefix = options.envPrefix\n // We need to fib a little, because it's always the same object, but it\n // starts out as having an empty config set. Then each method that adds\n // fields returns `this as Jack`\n this.#configSet = Object.create(null) as C\n this.#shorts = Object.create(null)\n }\n\n /**\n * Resulting definitions, suitable to be passed to Node's `util.parseArgs`,\n * but also including `description` and `short` fields, if set.\n */\n get definitions(): C {\n return this.#configSet\n }\n\n /** map of `{ : }` strings for each short name defined */\n get shorts() {\n return this.#shorts\n }\n\n /**\n * options passed to the {@link Jack} constructor\n */\n get jackOptions() {\n return this.#options\n }\n\n /**\n * the data used to generate {@link Jack#usage} and\n * {@link Jack#usageMarkdown} content.\n */\n get usageFields() {\n return this.#fields\n }\n\n /**\n * Set the default value (which will still be overridden by env or cli)\n * as if from a parsed config file. The optional `source` param, if\n * provided, will be included in error messages if a value is invalid or\n * unknown.\n */\n setConfigValues(values: Partial>, source = '') {\n try {\n this.validate(values)\n } catch (er) {\n if (source && er instanceof Error) {\n /* c8 ignore next */\n const cause = typeof er.cause === 'object' ? er.cause : {}\n er.cause = { ...cause, path: source }\n Error.captureStackTrace(er, this.setConfigValues)\n }\n throw er\n }\n for (const [field, value] of Object.entries(values)) {\n const my = this.#configSet[field]\n // already validated, just for TS's benefit\n /* c8 ignore start */\n if (!my) {\n throw new Error('unexpected field in config set: ' + field, {\n cause: {\n code: 'JACKSPEAK',\n found: field,\n },\n })\n }\n /* c8 ignore stop */\n my.default = value as ConfigValue\n }\n return this\n }\n\n /**\n * Parse a string of arguments, and return the resulting\n * `{ values, positionals }` object.\n *\n * If an {@link JackOptions#envPrefix} is set, then it will read default\n * values from the environment, and write the resulting values back\n * to the environment as well.\n *\n * Environment values always take precedence over any other value, except\n * an explicit CLI setting.\n */\n parse(args: string[] = process.argv): Parsed {\n this.loadEnvDefaults()\n const p = this.parseRaw(args)\n this.applyDefaults(p)\n this.writeEnv(p)\n return p\n }\n\n loadEnvDefaults() {\n if (this.#envPrefix) {\n for (const [field, my] of Object.entries(this.#configSet)) {\n const ek = toEnvKey(this.#envPrefix, field)\n const env = this.#env[ek]\n if (env !== undefined) {\n my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim)\n }\n }\n }\n }\n\n applyDefaults(p: Parsed) {\n for (const [field, c] of Object.entries(this.#configSet)) {\n if (c.default !== undefined && !(field in p.values)) {\n //@ts-ignore\n p.values[field] = c.default\n }\n }\n }\n\n /**\n * Only parse the command line arguments passed in.\n * Does not strip off the `node script.js` bits, so it must be just the\n * arguments you wish to have parsed.\n * Does not read from or write to the environment, or set defaults.\n */\n parseRaw(args: string[]): Parsed {\n if (args === process.argv) {\n args = args.slice(\n (process as { _eval?: string })._eval !== undefined ? 1 : 2,\n )\n }\n\n const result = parseArgs({\n args,\n options: toParseArgsOptionsConfig(this.#configSet),\n // always strict, but using our own logic\n strict: false,\n allowPositionals: this.#allowPositionals,\n tokens: true,\n })\n\n const p: Parsed = {\n values: {} as OptionsResults,\n positionals: [],\n }\n for (const token of result.tokens) {\n if (token.kind === 'positional') {\n p.positionals.push(token.value)\n if (\n this.#options.stopAtPositional ||\n this.#options.stopAtPositionalTest?.(token.value)\n ) {\n p.positionals.push(...args.slice(token.index + 1))\n break\n }\n } else if (token.kind === 'option') {\n let value: ConfigValue | undefined = undefined\n if (token.name.startsWith('no-')) {\n const my = this.#configSet[token.name]\n const pname = token.name.substring('no-'.length)\n const pos = this.#configSet[pname]\n if (\n pos &&\n pos.type === 'boolean' &&\n (!my ||\n (my.type === 'boolean' && !!my.multiple === !!pos.multiple))\n ) {\n value = false\n token.name = pname\n }\n }\n const my = this.#configSet[token.name]\n if (!my) {\n throw new Error(\n `Unknown option '${token.rawName}'. ` +\n `To specify a positional argument starting with a '-', ` +\n `place it at the end of the command after '--', as in ` +\n `'-- ${token.rawName}'`,\n {\n cause: {\n code: 'JACKSPEAK',\n found:\n token.rawName + (token.value ? `=${token.value}` : ''),\n },\n },\n )\n }\n if (value === undefined) {\n if (token.value === undefined) {\n if (my.type !== 'boolean') {\n throw new Error(\n `No value provided for ${token.rawName}, expected ${my.type}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n wanted: valueType(my),\n },\n },\n )\n }\n value = true\n } else {\n if (my.type === 'boolean') {\n throw new Error(\n `Flag ${token.rawName} does not take a value, received '${token.value}'`,\n { cause: { code: 'JACKSPEAK', found: token } },\n )\n }\n if (my.type === 'string') {\n value = token.value\n } else {\n value = +token.value\n if (value !== value) {\n throw new Error(\n `Invalid value '${token.value}' provided for ` +\n `'${token.rawName}' option, expected number`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: token.rawName,\n found: token.value,\n wanted: 'number',\n },\n },\n )\n }\n }\n }\n }\n if (my.multiple) {\n const pv = p.values as Record\n const tn = pv[token.name] ?? []\n pv[token.name] = tn\n tn.push(value)\n } else {\n const pv = p.values as Record\n pv[token.name] = value\n }\n }\n }\n\n for (const [field, value] of Object.entries(p.values)) {\n const valid = this.#configSet[field]?.validate\n const validOptions = this.#configSet[field]?.validOptions\n const cause =\n validOptions && !isValidOption(value, validOptions) ?\n { name: field, found: value, validOptions }\n : valid && !valid(value) ? { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid value provided for --${field}: ${JSON.stringify(value)}`,\n { cause: { ...cause, code: 'JACKSPEAK' } },\n )\n }\n }\n\n return p\n }\n\n /**\n * do not set fields as 'no-foo' if 'foo' exists and both are bools\n * just set foo.\n */\n #noNoFields(f: string, val: unknown, s: string = f) {\n if (!f.startsWith('no-') || typeof val !== 'boolean') return\n const yes = f.substring('no-'.length)\n // recurse so we get the core config key we care about.\n this.#noNoFields(yes, val, s)\n if (this.#configSet[yes]?.type === 'boolean') {\n throw new Error(\n `do not set '${s}', instead set '${yes}' as desired.`,\n { cause: { code: 'JACKSPEAK', found: s, wanted: yes } },\n )\n }\n }\n\n /**\n * Validate that any arbitrary object is a valid configuration `values`\n * object. Useful when loading config files or other sources.\n */\n validate(o: unknown): asserts o is Parsed['values'] {\n if (!o || typeof o !== 'object') {\n throw new Error('Invalid config: not an object', {\n cause: { code: 'JACKSPEAK', found: o },\n })\n }\n const opts = o as Record\n for (const field in o) {\n const value = opts[field]\n /* c8 ignore next - for TS */\n if (value === undefined) continue\n this.#noNoFields(field, value)\n const config = this.#configSet[field]\n if (!config) {\n throw new Error(`Unknown config option: ${field}`, {\n cause: { code: 'JACKSPEAK', found: field },\n })\n }\n if (!isValidValue(value, config.type, !!config.multiple)) {\n throw new Error(\n `Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`,\n {\n cause: {\n code: 'JACKSPEAK',\n name: field,\n found: value,\n wanted: valueType(config),\n },\n },\n )\n }\n const cause =\n config.validOptions && !isValidOption(value, config.validOptions) ?\n { name: field, found: value, validOptions: config.validOptions }\n : config.validate && !config.validate(value) ?\n { name: field, found: value }\n : undefined\n if (cause) {\n throw new Error(\n `Invalid config value for ${field}: ${JSON.stringify(value)}`,\n {\n cause: { ...cause, code: 'JACKSPEAK' },\n },\n )\n }\n }\n }\n\n writeEnv(p: Parsed) {\n if (!this.#env || !this.#envPrefix) return\n for (const [field, value] of Object.entries(p.values)) {\n const my = this.#configSet[field]\n this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(\n value as ConfigValue,\n my?.delim,\n )\n }\n }\n\n /**\n * Add a heading to the usage output banner\n */\n heading(\n text: string,\n level?: 1 | 2 | 3 | 4 | 5 | 6,\n { pre = false }: { pre?: boolean } = {},\n ): Jack {\n if (level === undefined) {\n level = this.#fields.some(r => isHeading(r)) ? 2 : 1\n }\n this.#fields.push({ type: 'heading', text, level, pre })\n return this\n }\n\n /**\n * Add a long-form description to the usage output at this position.\n */\n description(text: string, { pre }: { pre?: boolean } = {}): Jack {\n this.#fields.push({ type: 'description', text, pre })\n return this\n }\n\n /**\n * Add one or more number fields.\n */\n num>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', false)\n }\n\n /**\n * Add one or more multiple number fields.\n */\n numList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'number', true)\n }\n\n /**\n * Add one or more string option fields.\n */\n opt>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', false)\n }\n\n /**\n * Add one or more multiple string option fields.\n */\n optList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'string', true)\n }\n\n /**\n * Add one or more flag fields.\n */\n flag>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', false)\n }\n\n /**\n * Add one or more multiple flag fields.\n */\n flagList>(\n fields: F,\n ): Jack> {\n return this.#addFieldsWith(fields, 'boolean', true)\n }\n\n /**\n * Generic field definition method. Similar to flag/flagList/number/etc,\n * but you must specify the `type` (and optionally `multiple` and `delim`)\n * fields on each one, or Jack won't know how to define them.\n */\n addFields(fields: F): Jack {\n return this.#addFields(this as unknown as Jack, fields)\n }\n\n #addFieldsWith<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends ConfigSetFromMetaSet,\n >(fields: F, type: ConfigType, multiple: boolean): Jack {\n return this.#addFields(this as unknown as Jack, fields, {\n type,\n multiple,\n })\n }\n\n #addFields<\n T extends ConfigType,\n M extends boolean,\n F extends ConfigMetaSet,\n O extends Jack,\n >(next: O, fields: F, opt?: { type: T; multiple: M }): O {\n Object.assign(\n next.#configSet,\n Object.fromEntries(\n Object.entries(fields).map(([name, field]) => {\n this.#validateName(name, field)\n const { type, multiple } = validateFieldMeta(field, opt)\n const value = { ...field, type, multiple }\n validateField(value, type, multiple)\n next.#fields.push({ type: 'config', name, value })\n return [name, value]\n }),\n ),\n )\n return next\n }\n\n #validateName(name: string, field: { short?: string }) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {\n throw new TypeError(\n `Invalid option name: ${name}, ` +\n `must be '-' delimited ASCII alphanumeric`,\n )\n }\n if (this.#configSet[name]) {\n throw new TypeError(`Cannot redefine option ${name}`)\n }\n if (this.#shorts[name]) {\n throw new TypeError(\n `Cannot redefine option ${name}, already ` +\n `in use for ${this.#shorts[name]}`,\n )\n }\n if (field.short) {\n if (!/^[a-zA-Z0-9]$/.test(field.short)) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n 'must be 1 ASCII alphanumeric character',\n )\n }\n if (this.#shorts[field.short]) {\n throw new TypeError(\n `Invalid ${name} short option: ${field.short}, ` +\n `already in use for ${this.#shorts[field.short]}`,\n )\n }\n this.#shorts[field.short] = name\n this.#shorts[name] = name\n }\n }\n\n /**\n * Return the usage banner for the given configuration\n */\n usage(): string {\n if (this.#usage) return this.#usage\n\n let headingLevel = 1\n //@ts-ignore\n const ui = cliui({ width })\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n ui.div({\n padding: [0, 0, 0, 0],\n text: normalize(first.text),\n })\n }\n ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' })\n if (this.#options.usage) {\n ui.div({\n text: this.#options.usage,\n padding: [0, 0, 0, 2],\n })\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n ui.div({\n text: usage,\n padding: [0, 0, 0, 2],\n })\n }\n\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n const print = normalize(maybeDesc.text, maybeDesc.pre)\n start++\n ui.div({ padding: [0, 0, 0, 0], text: print })\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n\n const { rows, maxWidth } = this.#usageRows(start)\n\n // every heading/description after the first gets indented by 2\n // extra spaces.\n for (const row of rows) {\n if (row.left) {\n // If the row is too long, don't wrap it\n // Bump the right-hand side down a line to make room\n const configIndent = indent(Math.max(headingLevel, 2))\n if (row.left.length > maxWidth - 3) {\n ui.div({ text: row.left, padding: [0, 0, 0, configIndent] })\n ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] })\n } else {\n ui.div(\n {\n text: row.left,\n padding: [0, 1, 0, configIndent],\n width: maxWidth,\n },\n { padding: [0, 0, 0, 0], text: row.text },\n )\n }\n if (row.skipLine) {\n ui.div({ padding: [0, 0, 0, 0], text: '' })\n }\n } else {\n if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n // only h1 and h2 have bottom padding\n // h3-h6 do not\n const b = level <= 2 ? 1 : 0\n ui.div({ ...row, padding: [0, 0, b, indent(level)] })\n } else {\n ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] })\n }\n }\n }\n\n return (this.#usage = ui.toString())\n }\n\n /**\n * Return the usage banner markdown for the given configuration\n */\n usageMarkdown(): string {\n if (this.#usageMarkdown) return this.#usageMarkdown\n\n const out: string[] = []\n\n let headingLevel = 1\n const first = this.#fields[0]\n let start = first?.type === 'heading' ? 1 : 0\n if (first?.type === 'heading') {\n out.push(`# ${normalizeOneLine(first.text)}`)\n }\n out.push('Usage:')\n if (this.#options.usage) {\n out.push(normalizeMarkdown(this.#options.usage, true))\n } else {\n const cmd = basename(String(process.argv[1]))\n const shortFlags: string[] = []\n const shorts: string[][] = []\n const flags: string[] = []\n const opts: string[][] = []\n for (const [field, config] of Object.entries(this.#configSet)) {\n if (config.short) {\n if (config.type === 'boolean') shortFlags.push(config.short)\n else shorts.push([config.short, config.hint || field])\n } else {\n if (config.type === 'boolean') flags.push(field)\n else opts.push([field, config.hint || field])\n }\n }\n const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''\n const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const lf = flags.map(k => ` --${k}`).join('')\n const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('')\n const usage = `${cmd}${sf}${so}${lf}${lo}`.trim()\n out.push(normalizeMarkdown(usage, true))\n }\n\n const maybeDesc = this.#fields[start]\n if (maybeDesc && isDescription(maybeDesc)) {\n out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre))\n start++\n }\n\n const { rows } = this.#usageRows(start)\n\n // heading level in markdown is number of # ahead of text\n for (const row of rows) {\n if (row.left) {\n out.push(\n '#'.repeat(headingLevel + 1) +\n ' ' +\n normalizeOneLine(row.left, true),\n )\n if (row.text) out.push(normalizeMarkdown(row.text))\n } else if (isHeading(row)) {\n const { level } = row\n headingLevel = level\n out.push(\n `${'#'.repeat(headingLevel)} ${normalizeOneLine(\n row.text,\n row.pre,\n )}`,\n )\n } else {\n out.push(normalizeMarkdown(row.text, !!(row as Description).pre))\n }\n }\n\n return (this.#usageMarkdown = out.join('\\n\\n') + '\\n')\n }\n\n #usageRows(start: number) {\n // turn each config type into a row, and figure out the width of the\n // left hand indentation for the option descriptions.\n const maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)))\n let maxWidth = 8\n let prev: Row | TextRow | undefined = undefined\n const rows: (Row | TextRow)[] = []\n for (const field of this.#fields.slice(start)) {\n if (field.type !== 'config') {\n if (prev?.type === 'config') prev.skipLine = true\n prev = undefined\n field.text = normalize(field.text, !!field.pre)\n rows.push(field)\n continue\n }\n const { value } = field\n const desc = value.description || ''\n const mult = value.multiple ? 'Can be set multiple times' : ''\n const opts =\n value.validOptions?.length ?\n 'Valid options: ' +\n value.validOptions.map(v => JSON.stringify(v)).join(', ')\n : ''\n const dmDelim = desc.includes('\\n') ? '\\n\\n' : '\\n'\n const extra = [opts, mult].join(dmDelim).trim()\n const text = (normalize(desc) + dmDelim + extra).trim()\n const hint =\n value.hint ||\n (value.type === 'number' ? 'n'\n : value.type === 'string' ? field.name\n : undefined)\n const short =\n !value.short ? ''\n : value.type === 'boolean' ? `-${value.short} `\n : `-${value.short}<${hint}> `\n const left =\n value.type === 'boolean' ?\n `${short}--${field.name}`\n : `${short}--${field.name}=<${hint}>`\n const row: Row = { text, left, type: 'config' }\n if (text.length > width - maxMax) {\n row.skipLine = true\n }\n if (prev && left.length > maxMax) prev.skipLine = true\n prev = row\n const len = left.length + 4\n if (len > maxWidth && len < maxMax) {\n maxWidth = len\n }\n\n rows.push(row)\n }\n\n return { rows, maxWidth }\n }\n\n /**\n * Return the configuration options as a plain object\n */\n toJSON() {\n return Object.fromEntries(\n Object.entries(this.#configSet).map(([field, def]) => [\n field,\n {\n type: def.type,\n ...(def.multiple ? { multiple: true } : {}),\n ...(def.delim ? { delim: def.delim } : {}),\n ...(def.short ? { short: def.short } : {}),\n ...(def.description ?\n { description: normalize(def.description) }\n : {}),\n ...(def.validate ? { validate: def.validate } : {}),\n ...(def.validOptions ? { validOptions: def.validOptions } : {}),\n ...(def.default !== undefined ? { default: def.default } : {}),\n ...(def.hint ? { hint: def.hint } : {}),\n },\n ]),\n )\n }\n\n /**\n * Custom printer for `util.inspect`\n */\n [inspect.custom](_: number, options: InspectOptions) {\n return `Jack ${inspect(this.toJSON(), options)}`\n }\n}\n\n/**\n * Main entry point. Create and return a {@link Jack} object.\n */\nexport const jack = (options: JackOptions = {}) => new Jack(options)\n\n// Unwrap and un-indent, so we can wrap description\n// strings however makes them look nice in the code.\nconst normalize = (s: string, pre = false) => {\n if (pre)\n // prepend a ZWSP to each line so cliui doesn't strip it.\n return s\n .split('\\n')\n .map(l => `\\u200b${l}`)\n .join('\\n')\n return s\n .split(/^\\s*```\\s*$/gm)\n .map((s, i) => {\n if (i % 2 === 1) {\n if (!s.trim()) {\n return `\\`\\`\\`\\n\\`\\`\\`\\n`\n }\n // outdent the ``` blocks, but preserve whitespace otherwise.\n const split = s.split('\\n')\n // throw out the \\n at the start and end\n split.pop()\n split.shift()\n const si = split.reduce((shortest, l) => {\n /* c8 ignore next */\n const ind = l.match(/^\\s*/)?.[0] ?? ''\n if (ind.length) return Math.min(ind.length, shortest)\n else return shortest\n }, Infinity)\n /* c8 ignore next */\n const i = isFinite(si) ? si : 0\n return (\n '\\n```\\n' +\n split.map(s => `\\u200b${s.substring(i)}`).join('\\n') +\n '\\n```\\n'\n )\n }\n return (\n s\n // remove single line breaks, except for lists\n .replace(/([^\\n])\\n[ \\t]*([^\\n])/g, (_, $1, $2) =>\n !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\\n${$2}`,\n )\n // normalize mid-line whitespace\n .replace(/([^\\n])[ \\t]+([^\\n])/g, '$1 $2')\n // two line breaks are enough\n .replace(/\\n{3,}/g, '\\n\\n')\n // remove any spaces at the start of a line\n .replace(/\\n[ \\t]+/g, '\\n')\n .trim()\n )\n })\n .join('\\n')\n}\n\n// normalize for markdown printing, remove leading spaces on lines\nconst normalizeMarkdown = (s: string, pre: boolean = false): string => {\n const n = normalize(s, pre).replace(/\\\\/g, '\\\\\\\\')\n return pre ?\n `\\`\\`\\`\\n${n.replace(/\\u200b/g, '')}\\n\\`\\`\\``\n : n.replace(/\\n +/g, '\\n').trim()\n}\n\nconst normalizeOneLine = (s: string, pre: boolean = false) => {\n const n = normalize(s, pre)\n .replace(/[\\s\\u200b]+/g, ' ')\n .trim()\n return pre ? `\\`${n}\\`` : n\n}\n", "// TODO! cut this down? do we need the onlyFirst option?\n\nexport const ansiRegex = ({ onlyFirst = false } = {}) => {\n // Valid string terminator sequences are BEL, ESC\\, and 0x9c\n const ST = \"(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)\";\n\n // OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n const osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n // CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n const csi =\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]\";\n\n const pattern = `${osc}|${csi}`;\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n", "import { ansiRegex } from \"../ansi-regex/index.js\";\nconst regex = ansiRegex();\nexport const stripAnsi = (str: string) => str.replace(regex, \"\");\n", "export const eastAsianWidth = (character: string) => {\n var x = character.charCodeAt(0);\n var y = character.length == 2 ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {\n x &= 0x3ff;\n y &= 0x3ff;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if (\n 0x3000 == codePoint ||\n (0xff01 <= codePoint && codePoint <= 0xff60) ||\n (0xffe0 <= codePoint && codePoint <= 0xffe6)\n ) {\n return \"F\";\n }\n if (\n 0x20a9 == codePoint ||\n (0xff61 <= codePoint && codePoint <= 0xffbe) ||\n (0xffc2 <= codePoint && codePoint <= 0xffc7) ||\n (0xffca <= codePoint && codePoint <= 0xffcf) ||\n (0xffd2 <= codePoint && codePoint <= 0xffd7) ||\n (0xffda <= codePoint && codePoint <= 0xffdc) ||\n (0xffe8 <= codePoint && codePoint <= 0xffee)\n ) {\n return \"H\";\n }\n if (\n (0x1100 <= codePoint && codePoint <= 0x115f) ||\n (0x11a3 <= codePoint && codePoint <= 0x11a7) ||\n (0x11fa <= codePoint && codePoint <= 0x11ff) ||\n (0x2329 <= codePoint && codePoint <= 0x232a) ||\n (0x2e80 <= codePoint && codePoint <= 0x2e99) ||\n (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||\n (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||\n (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||\n (0x3001 <= codePoint && codePoint <= 0x303e) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30ff) ||\n (0x3105 <= codePoint && codePoint <= 0x312d) ||\n (0x3131 <= codePoint && codePoint <= 0x318e) ||\n (0x3190 <= codePoint && codePoint <= 0x31ba) ||\n (0x31c0 <= codePoint && codePoint <= 0x31e3) ||\n (0x31f0 <= codePoint && codePoint <= 0x321e) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32fe) ||\n (0x3300 <= codePoint && codePoint <= 0x4dbf) ||\n (0x4e00 <= codePoint && codePoint <= 0xa48c) ||\n (0xa490 <= codePoint && codePoint <= 0xa4c6) ||\n (0xa960 <= codePoint && codePoint <= 0xa97c) ||\n (0xac00 <= codePoint && codePoint <= 0xd7a3) ||\n (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||\n (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||\n (0xf900 <= codePoint && codePoint <= 0xfaff) ||\n (0xfe10 <= codePoint && codePoint <= 0xfe19) ||\n (0xfe30 <= codePoint && codePoint <= 0xfe52) ||\n (0xfe54 <= codePoint && codePoint <= 0xfe66) ||\n (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||\n (0x1b000 <= codePoint && codePoint <= 0x1b001) ||\n (0x1f200 <= codePoint && codePoint <= 0x1f202) ||\n (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||\n (0x1f240 <= codePoint && codePoint <= 0x1f248) ||\n (0x1f250 <= codePoint && codePoint <= 0x1f251) ||\n (0x20000 <= codePoint && codePoint <= 0x2f73f) ||\n (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||\n (0x30000 <= codePoint && codePoint <= 0x3fffd)\n ) {\n return \"W\";\n }\n if (\n (0x0020 <= codePoint && codePoint <= 0x007e) ||\n (0x00a2 <= codePoint && codePoint <= 0x00a3) ||\n (0x00a5 <= codePoint && codePoint <= 0x00a6) ||\n 0x00ac == codePoint ||\n 0x00af == codePoint ||\n (0x27e6 <= codePoint && codePoint <= 0x27ed) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)\n ) {\n return \"Na\";\n }\n if (\n 0x00a1 == codePoint ||\n 0x00a4 == codePoint ||\n (0x00a7 <= codePoint && codePoint <= 0x00a8) ||\n 0x00aa == codePoint ||\n (0x00ad <= codePoint && codePoint <= 0x00ae) ||\n (0x00b0 <= codePoint && codePoint <= 0x00b4) ||\n (0x00b6 <= codePoint && codePoint <= 0x00ba) ||\n (0x00bc <= codePoint && codePoint <= 0x00bf) ||\n 0x00c6 == codePoint ||\n 0x00d0 == codePoint ||\n (0x00d7 <= codePoint && codePoint <= 0x00d8) ||\n (0x00de <= codePoint && codePoint <= 0x00e1) ||\n 0x00e6 == codePoint ||\n (0x00e8 <= codePoint && codePoint <= 0x00ea) ||\n (0x00ec <= codePoint && codePoint <= 0x00ed) ||\n 0x00f0 == codePoint ||\n (0x00f2 <= codePoint && codePoint <= 0x00f3) ||\n (0x00f7 <= codePoint && codePoint <= 0x00fa) ||\n 0x00fc == codePoint ||\n 0x00fe == codePoint ||\n 0x0101 == codePoint ||\n 0x0111 == codePoint ||\n 0x0113 == codePoint ||\n 0x011b == codePoint ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n 0x012b == codePoint ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n 0x0138 == codePoint ||\n (0x013f <= codePoint && codePoint <= 0x0142) ||\n 0x0144 == codePoint ||\n (0x0148 <= codePoint && codePoint <= 0x014b) ||\n 0x014d == codePoint ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n 0x016b == codePoint ||\n 0x01ce == codePoint ||\n 0x01d0 == codePoint ||\n 0x01d2 == codePoint ||\n 0x01d4 == codePoint ||\n 0x01d6 == codePoint ||\n 0x01d8 == codePoint ||\n 0x01da == codePoint ||\n 0x01dc == codePoint ||\n 0x0251 == codePoint ||\n 0x0261 == codePoint ||\n 0x02c4 == codePoint ||\n 0x02c7 == codePoint ||\n (0x02c9 <= codePoint && codePoint <= 0x02cb) ||\n 0x02cd == codePoint ||\n 0x02d0 == codePoint ||\n (0x02d8 <= codePoint && codePoint <= 0x02db) ||\n 0x02dd == codePoint ||\n 0x02df == codePoint ||\n (0x0300 <= codePoint && codePoint <= 0x036f) ||\n (0x0391 <= codePoint && codePoint <= 0x03a1) ||\n (0x03a3 <= codePoint && codePoint <= 0x03a9) ||\n (0x03b1 <= codePoint && codePoint <= 0x03c1) ||\n (0x03c3 <= codePoint && codePoint <= 0x03c9) ||\n 0x0401 == codePoint ||\n (0x0410 <= codePoint && codePoint <= 0x044f) ||\n 0x0451 == codePoint ||\n 0x2010 == codePoint ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201c <= codePoint && codePoint <= 0x201d) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n 0x2030 == codePoint ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n 0x2035 == codePoint ||\n 0x203b == codePoint ||\n 0x203e == codePoint ||\n 0x2074 == codePoint ||\n 0x207f == codePoint ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n 0x20ac == codePoint ||\n 0x2103 == codePoint ||\n 0x2105 == codePoint ||\n 0x2109 == codePoint ||\n 0x2113 == codePoint ||\n 0x2116 == codePoint ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n 0x2126 == codePoint ||\n 0x212b == codePoint ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215b <= codePoint && codePoint <= 0x215e) ||\n (0x2160 <= codePoint && codePoint <= 0x216b) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n 0x2189 == codePoint ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21b8 <= codePoint && codePoint <= 0x21b9) ||\n 0x21d2 == codePoint ||\n 0x21d4 == codePoint ||\n 0x21e7 == codePoint ||\n 0x2200 == codePoint ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n 0x220b == codePoint ||\n 0x220f == codePoint ||\n 0x2211 == codePoint ||\n 0x2215 == codePoint ||\n 0x221a == codePoint ||\n (0x221d <= codePoint && codePoint <= 0x2220) ||\n 0x2223 == codePoint ||\n 0x2225 == codePoint ||\n (0x2227 <= codePoint && codePoint <= 0x222c) ||\n 0x222e == codePoint ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223c <= codePoint && codePoint <= 0x223d) ||\n 0x2248 == codePoint ||\n 0x224c == codePoint ||\n 0x2252 == codePoint ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226a <= codePoint && codePoint <= 0x226b) ||\n (0x226e <= codePoint && codePoint <= 0x226f) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n 0x2295 == codePoint ||\n 0x2299 == codePoint ||\n 0x22a5 == codePoint ||\n 0x22bf == codePoint ||\n 0x2312 == codePoint ||\n (0x2460 <= codePoint && codePoint <= 0x24e9) ||\n (0x24eb <= codePoint && codePoint <= 0x254b) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258f) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25a0 <= codePoint && codePoint <= 0x25a1) ||\n (0x25a3 <= codePoint && codePoint <= 0x25a9) ||\n (0x25b2 <= codePoint && codePoint <= 0x25b3) ||\n (0x25b6 <= codePoint && codePoint <= 0x25b7) ||\n (0x25bc <= codePoint && codePoint <= 0x25bd) ||\n (0x25c0 <= codePoint && codePoint <= 0x25c1) ||\n (0x25c6 <= codePoint && codePoint <= 0x25c8) ||\n 0x25cb == codePoint ||\n (0x25ce <= codePoint && codePoint <= 0x25d1) ||\n (0x25e2 <= codePoint && codePoint <= 0x25e5) ||\n 0x25ef == codePoint ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n 0x2609 == codePoint ||\n (0x260e <= codePoint && codePoint <= 0x260f) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n 0x261c == codePoint ||\n 0x261e == codePoint ||\n 0x2640 == codePoint ||\n 0x2642 == codePoint ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266a) ||\n (0x266c <= codePoint && codePoint <= 0x266d) ||\n 0x266f == codePoint ||\n (0x269e <= codePoint && codePoint <= 0x269f) ||\n (0x26be <= codePoint && codePoint <= 0x26bf) ||\n (0x26c4 <= codePoint && codePoint <= 0x26cd) ||\n (0x26cf <= codePoint && codePoint <= 0x26e1) ||\n 0x26e3 == codePoint ||\n (0x26e8 <= codePoint && codePoint <= 0x26ff) ||\n 0x273d == codePoint ||\n 0x2757 == codePoint ||\n (0x2776 <= codePoint && codePoint <= 0x277f) ||\n (0x2b55 <= codePoint && codePoint <= 0x2b59) ||\n (0x3248 <= codePoint && codePoint <= 0x324f) ||\n (0xe000 <= codePoint && codePoint <= 0xf8ff) ||\n (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||\n 0xfffd == codePoint ||\n (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||\n (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||\n (0x1f130 <= codePoint && codePoint <= 0x1f169) ||\n (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||\n (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||\n (0xf0000 <= codePoint && codePoint <= 0xffffd) ||\n (0x100000 <= codePoint && codePoint <= 0x10fffd)\n ) {\n return \"A\";\n }\n\n return \"N\";\n};\n\nexport const characterLength = (character: string) => {\n var code = eastAsianWidth(character);\n if (code == \"F\" || code == \"W\" || code == \"A\") {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nexport const stringToArray = (str: string) => {\n return str.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n};\n\nexport const length = (str: string) => {\n var characters = stringToArray(str);\n var len = 0;\n for (const char of characters) {\n len = len + characterLength(char);\n }\n return len;\n};\n\nexport const slice = (text: string, start: number, end: number) => {\n const textLen = length(text);\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = \"\";\n var eawLen = 0;\n var chars = stringToArray(text);\n for (const char of chars) {\n var charLen = length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n", "// https://mths.be/emoji\nexport const emojiRegex = () =>\n /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(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DF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2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\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\uDF93\\uDFA0-\\uDFC1\\uDFC5\\uDFC6\\uDFC8\\uDFC9\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC07\\uDC09-\\uDC14\\uDC16-\\uDC3A\\uDC3C-\\uDC3E\\uDC40\\uDC44\\uDC45\\uDC51-\\uDC65\\uDC6A\\uDC79-\\uDC7B\\uDC7D-\\uDC80\\uDC84\\uDC88-\\uDC8E\\uDC90\\uDC92-\\uDCA9\\uDCAB-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDDA4\\uDDFB-\\uDE2D\\uDE2F-\\uDE34\\uDE37-\\uDE44\\uDE48-\\uDE4A\\uDE80-\\uDEA2\\uDEA4-\\uDEB3\\uDEB7-\\uDEBF\\uDEC1-\\uDEC5\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD1D\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78\\uDD7A-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCB\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8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C]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n", "import { stripAnsi } from \"../strip-ansi/index.js\";\nimport { eastAsianWidth } from \"../eastasianwidth/index.js\";\nimport { emojiRegex } from \"../emoji-regex/index.js\";\n\nexport type Options = {\n ambiguousIsNarrow?: boolean;\n};\n\nexport function stringWidth(str: string, options: Options = {}) {\n if (typeof str !== \"string\" || str.length === 0) {\n return 0;\n }\n\n options = {\n ambiguousIsNarrow: true,\n ...options,\n };\n\n str = stripAnsi(str);\n\n if (str.length === 0) {\n return 0;\n }\n\n str = str.replace(emojiRegex(), \" \");\n\n const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n let width = 0;\n\n for (const character of str) {\n const codePoint = character.codePointAt(0);\n\n // Ignore control characters\n if (\n !codePoint ||\n codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f)\n ) {\n continue;\n }\n\n // Ignore combining characters\n if (codePoint >= 0x300 && codePoint <= 0x36f) {\n continue;\n }\n\n const code = eastAsianWidth(character);\n switch (code) {\n case \"F\":\n case \"W\":\n width += 2;\n break;\n case \"A\":\n width += ambiguousCharacterWidth;\n break;\n default:\n width += 1;\n }\n }\n\n return width;\n}\n", "const styles = {\n modifier: {\n reset: [0, 0],\n // 21 isn't widely supported and 22 does the same thing\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n },\n color: {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39], // Alias of `blackBright`\n grey: [90, 39], // Alias of `blackBright`\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39],\n },\n bgColor: {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49], // Alias of `bgBlackBright`\n bgGrey: [100, 49], // Alias of `bgBlackBright`\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49],\n },\n} as const;\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\ninterface AnsiStyles extends Record {}\nclass AnsiStyles {}\n\nexport const codes = new Map();\nconst ingest = (set: Record) =>\n Object.fromEntries(\n Object.entries(set).map(([key, [open, close]]) => {\n codes.set(open, close);\n return [\n key,\n (AnsiStyles.prototype[key] = {\n open: `\\u001B[${open}m`,\n close: `\\u001B[${close}m`,\n }),\n ];\n }),\n );\n\nexport const ansiStyles = new (class extends AnsiStyles {\n codes = codes;\n\n modifier = ingest(styles.modifier);\n\n color = {\n ...ingest(styles.color),\n close: \"\\x1B[39m\",\n ansi: (code: number) => `\\u001B[${code}m`,\n ansi256: (code: number) => `\\u001B[${38};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${38};2;${red};${green};${blue}m`,\n };\n\n bgColor = {\n ...ingest(styles.bgColor),\n close: \"\\u001B[49m\",\n ansi: (code: number) => `\\u001B[${code + 10}m`,\n ansi256: (code: number) => `\\u001B[${48};5;${code}m`,\n ansi16m: (red: number, green: number, blue: number) =>\n `\\u001B[${48};2;${red};${green};${blue}m`,\n };\n\n rgbToAnsi256(red: number, green: number, blue: number) {\n // We use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n if (red === green && green === blue) {\n if (red < 8) return 16;\n if (red > 248) return 231;\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n }\n\n hexToRgb(hex: number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map((character) => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [\n (integer >> 16) & 0xff,\n (integer >> 8) & 0xff,\n integer & 0xff,\n ];\n }\n\n hexToAnsi256(hex: number) {\n return this.rgbToAnsi256(...this.hexToRgb(hex));\n }\n ansi256ToAnsi(code: number) {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 +\n ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n }\n rgbToAnsi(red: number, green: number, blue: number) {\n return this.ansi256ToAnsi(this.rgbToAnsi256(red, green, blue));\n }\n hexToAnsi(hex: number) {\n return this.ansi256ToAnsi(this.hexToAnsi256(hex));\n }\n})();\n", "import { stringWidth } from \"../string-width/index.js\";\nimport { stripAnsi } from \"../strip-ansi/index.js\";\nimport { ansiStyles } from \"../ansi-styles/index.js\";\n\nconst ESCAPES = new Set([\"\\u001B\", \"\\u009B\"]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = \"\\u0007\";\nconst ANSI_CSI = \"[\";\nconst ANSI_OSC = \"]\";\nconst ANSI_SGR_TERMINATOR = \"m\";\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = (code: number) =>\n `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (uri: string) =>\n `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = (str: string) =>\n str.split(\" \").map((character) => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows: string[], word: string, columns: number) => {\n const characters = [...word];\n\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let visible = stringWidth(stripAnsi(String(rows[rows.length - 1])));\n\n for (const [index, character] of characters.entries()) {\n const characterLength = stringWidth(character);\n\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n } else {\n rows.push(character);\n visible = 0;\n }\n\n if (ESCAPES.has(character)) {\n isInsideEscape = true;\n isInsideLinkEscape = characters\n .slice(index + 1)\n .join(\"\")\n .startsWith(ANSI_ESCAPE_LINK);\n }\n\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n } else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n\n continue;\n }\n\n visible += characterLength;\n\n if (visible === columns && index < characters.length - 1) {\n rows.push(\"\");\n visible = 0;\n }\n }\n\n // It's possible that the last row we copy over is only\n // ansi escape characters, handle this edge-case\n if (!visible && String(rows[rows.length - 1]).length > 0 && rows.length > 1) {\n rows[rows.length - 2] = String(rows[rows.length - 1]) + rows.pop();\n }\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = (str: string) => {\n const words = str.split(\" \");\n let last = words.length;\n\n while (last > 0) {\n if (stringWidth(String(words[last - 1])) > 0) {\n break;\n }\n\n last--;\n }\n\n if (last === words.length) {\n return str;\n }\n\n return words.slice(0, last).join(\" \") + words.slice(last).join(\"\");\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nexport type Options = { trim?: boolean; wordWrap?: boolean; hard?: boolean };\nconst exec = (str: string, columns: number, options: Options = {}) => {\n if (options.trim !== false && str.trim() === \"\") {\n return \"\";\n }\n\n let returnValue = \"\";\n let escapeCode;\n let escapeUrl;\n\n const lengths = wordLengths(str);\n let rows = [\"\"];\n\n for (const [index, word] of str.split(\" \").entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = String(rows[rows.length - 1]).trimStart();\n }\n\n let rowLength = stringWidth(String(rows[rows.length - 1]));\n\n if (index !== 0) {\n if (\n rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)\n ) {\n // If we start with a new word but the current row length equals the length of the columns, add a new row\n rows.push(\"\");\n rowLength = 0;\n }\n\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += \" \";\n rowLength++;\n }\n }\n\n // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n const len = Number(lengths[index]);\n if (options.hard && len > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine =\n 1 + Math.floor((len - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((len - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push(\"\");\n }\n\n wrapWord(rows, word, columns);\n continue;\n }\n\n if (rowLength + len > columns && rowLength > 0 && len > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows.push(\"\");\n }\n\n if (rowLength + len > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n\n rows[rows.length - 1] += word;\n }\n\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n\n const pre = [...rows.join(\"\\n\")];\n\n for (const [index, character] of pre.entries()) {\n returnValue += character;\n\n if (ESCAPES.has(character)) {\n const { groups } = (new RegExp(\n `(?:\\\\${ANSI_CSI}(?\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`,\n ).exec(pre.slice(index).join(\"\")) || { groups: {} }) as {\n groups: {\n code?: string;\n uri?: string;\n };\n };\n if (groups.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n } else if (groups.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n\n const code = ansiStyles.codes.get(Number(escapeCode));\n\n if (pre[index + 1] === \"\\n\") {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(\"\");\n }\n\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(code);\n }\n } else if (character === \"\\n\") {\n if (escapeCode && code) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n\n return returnValue;\n};\n\n// For each newline, invoke the method separately\nexport const wrap = (str: string, columns: number, options: Options) =>\n String(str)\n .normalize()\n .replace(/\\r\\n/g, \"\\n\")\n .split(\"\\n\")\n .map((line) => exec(line, columns, options))\n .join(\"\\n\");\n", "import { stringWidth } from './string-width/index.js'\nimport { stripAnsi } from './strip-ansi/index.js'\nimport { wrap } from './wrap-ansi/index.js'\n\nconst align = {\n right: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)))}${str}`,\n center: (str: string, width: number): string =>\n `${' '.repeat(Math.max(0, width - stringWidth(str)) >> 1)}${str}`,\n}\n\nconst top = 0\nconst right = 1\nconst bottom = 2\nconst left = 3\n\nexport type UIOptions = {\n width: number\n wrap?: boolean\n rows?: string[]\n}\n\nexport type Column = {\n text: string\n width?: number\n align?: 'right' | 'left' | 'center'\n padding?: number[]\n border?: boolean\n}\n\nexport type ColumnArray = Column[] & {\n span?: boolean\n}\n\nexport type Line = {\n hidden?: boolean\n text: string\n span?: boolean\n}\n\nexport class UI {\n width: number\n wrap: boolean\n rows: ColumnArray[]\n\n constructor(opts: UIOptions) {\n this.width = opts.width\n /* c8 ignore start */\n this.wrap = opts.wrap ?? true\n /* c8 ignore stop */\n this.rows = []\n }\n\n span(...args: ColumnArray) {\n const cols = this.div(...args)\n cols.span = true\n }\n\n resetOutput() {\n this.rows = []\n }\n\n div(...args: (Column | string)[]): ColumnArray {\n if (args.length === 0) {\n this.div('')\n }\n\n if (\n this.wrap &&\n this.shouldApplyLayoutDSL(...args) &&\n typeof args[0] === 'string'\n ) {\n return this.applyLayoutDSL(args[0])\n }\n\n const cols: ColumnArray = Object.assign(\n args.map(arg => {\n if (typeof arg === 'string') {\n return this.colFromString(arg)\n }\n return arg\n }),\n { span: false },\n )\n\n this.rows.push(cols)\n return cols\n }\n\n shouldApplyLayoutDSL(...args: (Column | string)[]): boolean {\n return (\n args.length === 1 &&\n typeof args[0] === 'string' &&\n /[\\t\\n]/.test(args[0])\n )\n }\n\n applyLayoutDSL(str: string): ColumnArray {\n const rows = str.split('\\n').map(row => row.split('\\t'))\n let leftColumnWidth = 0\n\n // simple heuristic for layout, make sure the\n // second column lines up along the left-hand.\n // don't allow the first column to take up more\n // than 50% of the screen.\n rows.forEach(columns => {\n if (\n columns.length > 1 &&\n stringWidth(String(columns[0])) > leftColumnWidth\n ) {\n leftColumnWidth = Math.min(\n Math.floor(this.width * 0.5),\n stringWidth(String(columns[0])),\n )\n }\n })\n\n // generate a table:\n // replacing ' ' with padding calculations.\n // using the algorithmically generated width.\n rows.forEach(columns => {\n this.div(\n ...columns.map((r, i) => {\n return {\n text: r.trim(),\n padding: this.measurePadding(r),\n width:\n i === 0 && columns.length > 1 ? leftColumnWidth : undefined,\n } as Column\n }),\n )\n })\n\n const row = this.rows[this.rows.length - 1]\n /* c8 ignore start */\n if (!row) {\n throw new Error('no rows found')\n }\n /* c8 ignore stop */\n return row\n }\n\n colFromString(text: string): Column {\n return {\n text,\n padding: this.measurePadding(text),\n }\n }\n\n measurePadding(str: string): number[] {\n // measure padding without ansi escape codes\n const noAnsi = stripAnsi(str)\n const [right = '', left = ''] = [\n noAnsi.match(/\\s*$/)?.[0],\n noAnsi.match(/^\\s*/)?.[0],\n ]\n return [0, right.length, 0, left.length]\n }\n\n toString(): string {\n const lines: Line[] = []\n\n this.rows.forEach(row => {\n this.rowToString(row, lines)\n })\n\n // don't display any lines with the\n // hidden flag set.\n return lines\n .filter(line => !line.hidden)\n .map(line => line.text)\n .join('\\n')\n }\n\n rowToString(row: ColumnArray, lines: Line[]) {\n this.rasterize(row).forEach((rrow, r) => {\n let str = ''\n rrow.forEach((col: string, c: number) => {\n const column = row[c] as Column\n const { width } = column as Column // the width with padding.\n const wrapWidth = this.negatePadding(column) // the width without padding.\n\n let ts = col // temporary string used during alignment/padding.\n\n if (wrapWidth > stringWidth(col)) {\n ts += ' '.repeat(wrapWidth - stringWidth(col))\n }\n\n // align the string within its column.\n if (column.align && column.align !== 'left' && this.wrap) {\n const fn = align[column.align as 'right' | 'center']\n ts = fn(ts.trim(), wrapWidth)\n if (stringWidth(ts) < wrapWidth) {\n /* c8 ignore start */\n const w = width || 0\n /* c8 ignore stop */\n ts += ' '.repeat(w - stringWidth(ts) - 1)\n }\n }\n\n // apply border and padding to string.\n const padding = column.padding || [0, 0, 0, 0]\n if (padding[left]) {\n str += ' '.repeat(padding[left])\n }\n\n str += addBorder(column, ts, '| ')\n str += ts\n str += addBorder(column, ts, ' |')\n if (padding[right]) {\n str += ' '.repeat(padding[right])\n }\n\n // if prior row is span, try to render the\n // current row on the prior line.\n if (r === 0 && lines.length > 0) {\n const lastLine = lines[lines.length - 1]\n /* c8 ignore start */\n if (!lastLine) {\n throw new Error('last line not found')\n }\n /* c8 ignore stop */\n str = this.renderInline(str, lastLine)\n }\n })\n\n // remove trailing whitespace.\n lines.push({\n text: str.replace(/ +$/, ''),\n span: row.span,\n })\n })\n\n return lines\n }\n\n // if the full 'source' can render in\n // the target line, do so.\n renderInline(source: string, previousLine: Line) {\n const match = source.match(/^ */)\n /* c8 ignore start */\n const leadingWhitespace = match ? match[0].length : 0\n /* c8 ignore stop */\n const target = previousLine.text\n const targetTextWidth = stringWidth(target.trimEnd())\n\n if (!previousLine.span) {\n return source\n }\n\n // if we're not applying wrapping logic,\n // just always append to the span.\n if (!this.wrap) {\n previousLine.hidden = true\n return target + source\n }\n\n if (leadingWhitespace < targetTextWidth) {\n return source\n }\n\n previousLine.hidden = true\n\n return (\n target.trimEnd() +\n ' '.repeat(leadingWhitespace - targetTextWidth) +\n source.trimStart()\n )\n }\n\n rasterize(row: ColumnArray) {\n const rrows: string[][] = []\n const widths = this.columnWidths(row)\n let wrapped: string[]\n\n // word wrap all columns, and create\n // a data-structure that is easy to rasterize.\n row.forEach((col, c) => {\n // leave room for left and right padding.\n col.width = widths[c]\n if (this.wrap) {\n wrapped = wrap(col.text, this.negatePadding(col), {\n hard: true,\n }).split('\\n')\n } else {\n wrapped = col.text.split('\\n')\n }\n\n if (col.border) {\n wrapped.unshift(\n '.' + '-'.repeat(this.negatePadding(col) + 2) + '.',\n )\n wrapped.push(\"'\" + '-'.repeat(this.negatePadding(col) + 2) + \"'\")\n }\n\n // add top and bottom padding.\n if (col.padding) {\n wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))\n wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))\n }\n\n wrapped.forEach((str: string, r: number) => {\n if (!rrows[r]) {\n rrows.push([])\n }\n\n /* c8 ignore start */\n const rrow = rrows[r] ?? []\n /* c8 ignore stop */\n\n for (let i = 0; i < c; i++) {\n if (rrow[i] === undefined) {\n rrow.push('')\n }\n }\n\n rrow.push(str)\n })\n })\n\n return rrows\n }\n\n negatePadding(col: Column) {\n /* c8 ignore start */\n let wrapWidth = col.width || 0\n /* c8 ignore stop */\n if (col.padding) {\n wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)\n }\n\n if (col.border) {\n wrapWidth -= 4\n }\n\n return wrapWidth\n }\n\n columnWidths(row: ColumnArray) {\n if (!this.wrap) {\n return row.map(col => {\n return col.width || stringWidth(col.text)\n })\n }\n\n let unset = row.length\n let remainingWidth = this.width\n\n // column widths can be set in config.\n const widths = row.map(col => {\n if (col.width) {\n unset--\n remainingWidth -= col.width\n return col.width\n }\n\n return undefined\n })\n\n // any unset widths should be calculated.\n /* c8 ignore start */\n const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0\n /* c8 ignore stop */\n\n return widths.map((w, i) => {\n if (w === undefined) {\n /* c8 ignore start */\n const col = row[i] ?? { text: '', padding: [] }\n /* c8 ignore stop */\n return Math.max(unsetWidth, _minWidth(col))\n }\n\n return w\n })\n }\n}\n\nconst addBorder = (col: Column, ts: string, style: string) => {\n if (col.border) {\n if (/[.']-+[.']/.test(ts)) {\n return ''\n }\n\n if (ts.trim().length !== 0) {\n return style\n }\n\n return ' '\n }\n\n return ''\n}\n\n// calculates the minimum width of\n// a column, based on padding preferences.\nconst _minWidth = (col: Column) => {\n const padding = col.padding || []\n const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)\n if (col.border) {\n return minWidth + 4\n }\n\n return minWidth\n}\n\nconst getWindowWidth = (): number => {\n /* c8 ignore start */\n if (\n typeof process === 'object' &&\n process.stdout &&\n process.stdout.columns\n ) {\n return process.stdout.columns\n }\n return 80\n}\n/* c8 ignore stop */\n\nexport const cliui = (opts: Partial = {}) =>\n new UI({\n /* c8 ignore start */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,EACxCA,CACd,EAAG,GAAQ,EAELH,EAAI,SAASE,CAAE,EAAIA,EAAK,EAC9B,MACE,UACAD,EAAM,IAAIxD,GAAK,SAASA,EAAE,UAAUuD,CAAC,CAAC,EAAE,EAAE,KAAK;CAAI,EACnD,SAEJ,CACA,OACEvD,EAEG,QAAQ,0BAA2B,CAACoD,EAAGQ,EAAIC,IACzC,QAAQ,KAAKA,CAAE,EAAoB,GAAGD,CAAE;EAAKC,CAAE,GAA5B,GAAGD,CAAE,IAAIC,CAAE,EAAmB,EAGnD,QAAQ,wBAAyB,OAAO,EAExC,QAAQ,UAAW;;CAAM,EAEzB,QAAQ,YAAa;CAAI,EACzB,KAAI,CAEX,CAAC,EACA,KAAK;CAAI,EAIRrB,EAAoB,CAACxC,EAAWM,EAAe,KAAiB,CACpE,IAAMjE,EAAI8E,EAAUnB,EAAGM,CAAG,EAAE,QAAQ,MAAO,MAAM,EACjD,OAAOA,EACH;EAAWjE,EAAE,QAAQ,UAAW,EAAE,CAAC;QACnCA,EAAE,QAAQ,QAAS;CAAI,EAAE,KAAI,CACnC,EAEMkG,EAAmB,CAACvC,EAAWM,EAAe,KAAS,CAC3D,IAAMjE,EAAI8E,EAAUnB,EAAGM,CAAG,EACvB,QAAQ,eAAgB,GAAG,EAC3B,KAAI,EACP,OAAOA,EAAM,KAAKjE,CAAC,KAAOA,CAC5B", + "names": ["inspect", "parseArgs", "ansiRegex", "onlyFirst", "pattern", "regex", "stripAnsi", "str", "eastAsianWidth", "character", "x", "y", "codePoint", "emojiRegex", "stringWidth", "options", "ambiguousCharacterWidth", "width", "styles", "modifierNames", "foregroundColorNames", "backgroundColorNames", "colorNames", "AnsiStyles", "codes", "ingest", "set", "key", "open", "close", "ansiStyles", "code", "red", "green", "blue", "hex", "matches", "colorString", "integer", "remainder", "value", "result", "ESCAPES", "END_CODE", "ANSI_ESCAPE_BELL", "ANSI_CSI", "ANSI_OSC", "ANSI_SGR_TERMINATOR", "ANSI_ESCAPE_LINK", "wrapAnsiCode", "wrapAnsiHyperlink", "uri", "wordLengths", "wrapWord", "rows", "word", "columns", "characters", "isInsideEscape", "isInsideLinkEscape", "visible", "index", "characterLength", "stringVisibleTrimSpacesRight", "words", "last", "exec", "returnValue", "escapeCode", "escapeUrl", "lengths", "rowLength", "len", "remainingColumns", "breaksStartingThisLine", "row", "pre", "groups", "wrap", "line", "align", "top", "right", "bottom", "left", "UI", "opts", "args", "cols", "arg", "leftColumnWidth", "r", "i", "text", "noAnsi", "lines", "rrow", "col", "c", "column", "wrapWidth", "ts", "fn", "w", "padding", "addBorder", "lastLine", "source", "previousLine", "match", "leadingWhitespace", "target", "targetTextWidth", "rrows", "widths", "wrapped", "unset", "remainingWidth", "unsetWidth", "_minWidth", "style", "minWidth", "getWindowWidth", "cliui", "basename", "isConfigType", "t", "isValidValue", "v", "type", "multi", "isValidOption", "vo", "x", "isConfigOptionOfType", "o", "isConfigOption", "undefOrType", "undefOrTypeArray", "isHeading", "r", "isDescription", "width", "indent", "n", "toEnvKey", "pref", "key", "toEnvVal", "value", "delim", "str", "fromEnvVal", "env", "multiple", "valueType", "joinTypes", "types", "validateFieldMeta", "field", "fieldMeta", "validateField", "validateValidOptions", "def", "validOptions", "toParseArgsOptionsConfig", "options", "acc", "longOption", "p", "setNoBool", "setDefault", "fn", "d", "Jack", "#configSet", "#shorts", "#options", "#fields", "#env", "#envPrefix", "#allowPositionals", "#usage", "#usageMarkdown", "values", "source", "er", "cause", "my", "args", "ek", "c", "result", "parseArgs", "token", "pname", "pos", "pv", "tn", "valid", "#noNoFields", "f", "val", "s", "yes", "opts", "config", "text", "level", "pre", "fields", "#addFieldsWith", "#addFields", "next", "opt", "name", "#validateName", "headingLevel", "ui", "cD", "first", "start", "normalize", "cmd", "shortFlags", "shorts", "flags", "sf", "so", "k", "lf", "lo", "usage", "maybeDesc", "print", "rows", "maxWidth", "#usageRows", "row", "configIndent", "b", "out", "normalizeOneLine", "normalizeMarkdown", "maxMax", "prev", "desc", "mult", "dmDelim", "extra", "hint", "short", "left", "len", "inspect", "_", "jack", "l", "i", "split", "si", "shortest", "ind", "$1", "$2"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/jackspeak/package.json b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7b4d9a09b7b741fcee01f90160eb28eca89fe6fe --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/jackspeak/package.json @@ -0,0 +1,115 @@ +{ + "name": "jackspeak", + "version": "4.2.3", + "description": "A very strict and proper argument parser.", + "tshy": { + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.js", + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build-examples": "for i in examples/*.js ; do node $i -h > ${i/.js/.txt}; done", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy && bash build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "license": "BlueOak-1.0.0", + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/node": "^25.2.0", + "esbuild": "^0.27.3", + "prettier": "^3.3.3", + "tap": "^21.5.1", + "tshy": "^3.1.3", + "typedoc": "^0.28.16" + }, + "dependencies": { + "@isaacs/cliui": "^9.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/jackspeak.git" + }, + "keywords": [ + "argument", + "parser", + "args", + "option", + "flag", + "cli", + "command", + "line", + "parse", + "parsing" + ], + "author": "Isaac Z. Schlueter ", + "tap": { + "typecheck": true + }, + "module": "./dist/esm/index.js" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..c5402b9577a8cdd966c0974e5b74cc7b85f536c5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/README.md b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b990a37946b49085b7a830f578f52c242af840e8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/README.md @@ -0,0 +1,469 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import { LRUCache } from 'lru-cache' +// or: +const { LRUCache } = require('lru-cache') +// or in minified form for web browsers: +import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs' + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key, reason) => { + freeFromMemoryOrWhatever(value) + }, + + // for use when you need to know that an item is being inserted + // note that this does NOT allow you to prevent the insertion, + // it just allows you to know about it. + onInsert: (value, key, reason) => { + logInsertionOrWhatever(key, value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async (key, staleValue, { options, signal, context }) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in the cache, then less recently used items +will fall out. That's what an LRU cache is. + +For full description of the API and all options, please see [the +LRUCache typedocs](https://isaacs.github.io/node-lru-cache/) + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl), + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Storing Undefined Values + +This cache never stores undefined values, as `undefined` is used +internally in a few places to indicate that a key is not in the +cache. + +You may call `cache.set(key, undefined)`, but this is just +an alias for `cache.delete(key)`. Note that this has the effect +that `cache.has(key)` will return _false_ after setting it to +undefined. + +```js +cache.set(myKey, undefined) +cache.has(myKey) // false! +``` + +If you need to track `undefined` values, and still note that the +key is in the cache, an easy workaround is to use a sigil object +of your own. + +```js +import { LRUCache } from 'lru-cache' +const undefinedValue = Symbol('undefined') +const cache = new LRUCache(...) +const mySet = (key, value) => + cache.set(key, value === undefined ? undefinedValue : value) +const myGet = (key, value) => { + const v = cache.get(key) + return v === undefinedValue ? undefined : v +} +``` + +## Tracing and Observability + +Most methods can accept a `status` option, which is an +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +object that will be decorated along the operation with +indications about what was done and why. + +Additionally, this library is instrumented using the +[`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) +module on Node and other platforms that support it. In order to +get diagnostics metrics, listen on the +`channel('lru-cache:metrics')`. To get Tracing Channel traces, +subscribe to the `tracingChannel('lru-cache')`. The +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +objects will be provided as the message context to those channel +listeners. + +For example, you could do the following to get comprehensive +information about every LRUCache instance in your application: + +```ts +import { tracingChannel, subscribe } from 'node:diagnostics_channel' + +subscribe('lru-cache:metrics', (message, name) => { + // name will always be 'lru-cache:metrics' + // message will be the LRUCache.Status object for whatever + // synchronous operation was performed. + console.error('LRUCache Metrics', message) +}) + +tracingChannel('lru-cache').subscribe({ + start: status => { + // a traced operation is starting + }, + asyncStart: status => { + // an async traced operation is starting + }, + asyncEnd: status => { + // an async traced operation is ending + } + error: status => { + // a traced operation failed + }, + end: status => { + // a traced operation is complete + }, +}) +``` + +The async `cache.fetch()` and `cache.forceFetch` methods are +covered by `tracingChannels`. All the other operations are +covered by the `lru-cache:metrics` channel, because they are +strictly synchronous, and thus don't have an asynchronous +lifecycle to track. + +Note that using `status` objects or using +`node:diagnostics_channel` listeners _will_ impose a modest +performance penalty. Creating data objects is not ever free; do +not believe anyone who tells you otherwise. But it is as small as +possible. + +### Platform Compatibility Caveat + +Not all platforms support the `node:diagnostics_channel` module. +Currently, this is only available in Node, Bun, and Deno, and +some edge computing platforms that provide a Node compatibility +layer. + +To work around this, if you are loading in a non-Node +environment, the package.json exports will direct your module +loader to pull in a version that starts out with a dummy +implementation, then does a conditional dynamic `import` of the +`node:diagnostics_channel` module, and then swaps out those +dummy objects with the real thing if it succeeds. This means that +cache metrics and tracing channels started in the first load-time +tick of your application will _not_ be covered, except in +environments that load using the `require` import +condition, or both the `node` and `esm` import conditions +together. + +Top-level await _could_ be used to remove this caveat, but that +feature is dead on arrival, unfortunately. See +[#397](https://github.com/isaacs/node-lru-cache/issues/397) and +[#398](https://github.com/isaacs/node-lru-cache/issues/398) for +more details. + +## Performance + +As of April 2026, version 11 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. + +2. Failing that, if you can use short non-numeric strings (ie, + less than 256 characters) as your keys, and you do not need + any of the other features of this library, use [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). + +3. If the types of your keys will be anything else, especially + long strings, strings that look like floats, objects, or some + mix of types, or if you aren't sure, then this library will + work well for you. + + If you do not need the features that this library provides + (like asynchronous fetching, a variety of TTL staleness + options, and so on), then [mnemonist's + LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is + also a very good option, and just slightly faster than this + module (since it does considerably less). + +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior or observability features, unless absolutely + needed. These features are convenient, and necessary in some + use cases, and every attempt has been made to make the + performance impact minimal, but it isn't nothing. + +## Testing + +When writing tests that involve TTL-related functionality, note +that this module creates an internal reference to the global +`performance` or `Date` objects at import time. If you import it +statically at the top level, those references cannot be mocked or +overridden in your test environment. + +To avoid this, dynamically import the package within your tests +so that the references are captured after your mocks are applied. +For example: + +```ts +// ❌ Not recommended +import { LRUCache } from 'lru-cache' +// mocking timers, e.g. jest.useFakeTimers() + +// ✅ Recommended for TTL tests +// mocking timers, e.g. jest.useFakeTimers() +const { LRUCache } = await import('lru-cache') +``` + +This ensures that your mocked timers or time sources are +respected when testing TTL behavior. + +Additionally, you can pass in a `perf` option when creating your +LRUCache instance. This option accepts any object with a `now` +method that returns a number. + +For example, this would be a very bare-bones time-mocking system +you could use in your tests, without any particular test +framework: + +```ts +import { LRUCache } from 'lru-cache' + +let myClockTime = 0 + +const cache = new LRUCache({ + max: 10, + ttl: 1000, + perf: { + now: () => myClockTime, + }, +}) + +// run tests, updating myClockTime as needed +``` + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +## Breaking Changes in Version 8 + +- The `fetchContext` option was renamed to `context`, and may no + longer be set on the cache instance itself. +- Rewritten in TypeScript, so pretty much all the types moved + around a lot. +- The AbortController/AbortSignal polyfill was removed. For this + reason, **Node version 16.14.0 or higher is now required**. +- Internal properties were moved to actual private class + properties. +- Keys and values must not be `null` or `undefined`. +- Minified export available at `'lru-cache/min'`, for both CJS + and MJS builds. + +## Breaking Changes in Version 9 + +- Named export only, no default export. +- AbortController polyfill returned, albeit with a warning when + used. + +## Breaking Changes in Version 10 + +- `cache.fetch()` return type is now `Promise` + instead of `Promise`. This is an irrelevant change + practically speaking, but can require changes for TypeScript + users. + +For more info, see the [change log](CHANGELOG.md). diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a457786d20197b3115836d0595c16a611e35a613 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map new file mode 100644 index 0000000000000000000000000000000000000000..bb68231347982f31702357b18b7c6b96cbc5bda7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5360898f63eb8b73515bb4a68a5570c1883c48f2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..8f6a8f12edb3994a96b807888e8cf3c5b28b5c4b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fa98a0f5eb4361545b9df395db12785d73bbf1b9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IA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C,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..179694b1b7b75e0e801cb6fee7023704e6708b98 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c1652fa0d4073c83cea41bd198d58bc9f2a11fcd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAA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\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..8e42461074475a389975c8dc9ae5db3d943efe53 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),x=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},B=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},C=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=C.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof y=="function"?(this.#S=y,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";B(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#x=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#C(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let _=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,_,o),o&&(o.set="add"),y=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#x(u),this.#I(u,_,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#x(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=x()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return y(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#C(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#C(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#C(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..80b762edb8101ce4978eb63a53ed9ffa49c5c3e1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAA,QAAUD,EACVC,EAAA,QAAUD,mGCFVE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,KAAK,IAAI,EAAG,CAAC,EAAI,WACxBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,OAAO,iBAAmBC,EAC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I,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3e239ce91c97e051e8812141758926d4261e31b7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..bd4c80f461d6c1e5a88e89c53d4dbd89ab32d228 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a193c90f059b85e452e0f49c523ad9b51aaf1690 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..abdcb32ec56f317c993d63d9810a4fdac7dcfddd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.cjs","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map new file mode 100644 index 0000000000000000000000000000000000000000..7cfc73f194c5ce3b20093c4ff3add04e3ac9adb5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.d.cts","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6cf41c4fafa45db86b0f376a5e3c3b91e4e0efd5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-cjs.d.cts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..bdd4f41f903666aa1d989767d0af245ef5a7efb4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-cjs.cjs.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3ab3f75260aecd96eb9cf0ad81b384510ada0ca9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,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AAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..179694b1b7b75e0e801cb6fee7023704e6708b98 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..81f103350a31d7fcea9a2bde9bfbc58230358352 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,G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,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAl9DD,4BAk9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..8e42461074475a389975c8dc9ae5db3d943efe53 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),x=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},B=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},C=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=C.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof y=="function"?(this.#S=y,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";B(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#x=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#C(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let _=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,_,o),o&&(o.set="add"),y=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#x(u),this.#I(u,_,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#x(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=x()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return y(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#C(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#C(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#C(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..171cf936da70b5c0295daa7655473bc44e7ccd75 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-cjs.cts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAA,QAAUD,EACVC,EAAA,QAAUD,mGCFVE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,KAAK,IAAI,EAAG,CAAC,EAAI,WACxBA,GAAO,KAAK,IAAI,EAAG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,CAAA,EACnCwD,IAAM,QAAW,aAAaA,CAAC,EAErC,KAAKxD,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2c0f7d519967f7afc7d23504622c990af01b5f93 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map new file mode 100644 index 0000000000000000000000000000000000000000..47bd2c0da1de4bb615d16c66fce778bb750c862c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,mEAAmE;AACnE,uEAAkE;AAGrD,QAAA,OAAO,GAAqB,IAAA,kCAAO,EAAC,mBAAmB,CAAC,CAAA;AACxD,QAAA,OAAO,GAA4B,IAAA,yCAAc,EAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e9e25d06eb481fc2584d6e6d9eec9a7f27a01d4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..30f39a05a5630ca2102986aa8012273fabcbe454 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +const node_diagnostics_channel_1 = require("node:diagnostics_channel"); +exports.metrics = (0, node_diagnostics_channel_1.channel)('lru-cache:metrics'); +exports.tracing = (0, node_diagnostics_channel_1.tracingChannel)('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fa98a0f5eb4361545b9df395db12785d73bbf1b9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IAET,IAAI,EAAE,WAAW,CAA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AAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..179694b1b7b75e0e801cb6fee7023704e6708b98 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c1652fa0d4073c83cea41bd198d58bc9f2a11fcd --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot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QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAl9DD,4BAk9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..a03fc77191387355a41e289da1611b323ad20537 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U=require("node:diagnostics_channel");O.metrics=(0,U.channel)("lru-cache:metrics");O.tracing=(0,U.tracingChannel)("lru-cache")});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},q=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},x=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#_;#r;#y;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#y,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#_=x.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof _=="function"?(this.#S=_,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";q(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let _=h.now-d;h.remainingTTL=o-_}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let _=(n||r())-d;return o-_},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#y=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#x(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#y&&(n.size=this.#y[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#y&&(r.size=this.#y[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:_=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let y=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&y>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,y,o),o&&(o.set="add"),_=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#C(u),this.#I(u,y,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(_||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#a=this.#h=0,this.#_.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return _(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),_(f,!1)),_=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},y=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(y).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#q(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#q(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#x(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#q(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#x(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#x(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#x(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#B(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#B(this.#u[t],this.#l[t]),this.#B(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#_.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#a=0,this.#h=0,this.#_.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b2b45305b659a5f8e65be8af3ff8fa14cf491890 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAEA,IAAAA,EAAA,QAAA,0BAAA,EAGaC,EAAA,WAA4BD,EAAA,SAAQ,mBAAmB,EACvDC,EAAA,WAAmCD,EAAA,gBAAe,WAAW,mGCE7DE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ACH,OAAO,KAAKyD,GAAO,QAAQ,CAC7B,CACAA,GAAOD,EAA8B,CACnC,QAAWhI,KAAS,KAAKM,GAAU,CAAE,WAAY,EAAI,CAAE,EAAG,CACxD,IAAMmD,EAAI,KAAK5E,GAASmB,CAAK,EAC7B,GAAI,KAAKF,GAAmB2D,CAAC,EAC3BA,EAAE,kBAAkB,MAAM,IAAI,MAAM,SAAS,CAAC,MACzC,CACL,IAAM1D,EAAI,KAAKnB,GAASoB,CAAK,EACzB,KAAKR,IACP,KAAKrB,KAAWsF,EAAQ1D,EAAQiI,CAAM,EAEpC,KAAKtI,IACP,KAAKP,IAAW,KAAK,CAACsE,EAAQ1D,EAAQiI,CAAM,CAAC,CAEjD,CACF,CAKA,GAHA,KAAKrJ,GAAQ,MAAK,EACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW0D,KAAK,KAAKxD,IAAoB,CAAA,EACnCwD,IAAM,QAAW,aAAaA,CAAC,EAErC,KAAKxD,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["node_diagnostics_channel_1", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3e239ce91c97e051e8812141758926d4261e31b7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..bd4c80f461d6c1e5a88e89c53d4dbd89ab32d228 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a193c90f059b85e452e0f49c523ad9b51aaf1690 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fd6eeeedb126fb20c93f43ffa1f01f718832081c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..bd4c80f461d6c1e5a88e89c53d4dbd89ab32d228 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..59bb467886e82e23fb0b944fe70daff949e6351c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/commonjs/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a457786d20197b3115836d0595c16a611e35a613 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2595c3988df7927dc419a0736229de561c8c11ca --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAyB,CAAA;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5360898f63eb8b73515bb4a68a5570c1883c48f2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..37524f355f050c78f6ab163497dcadcd9e80c2bf --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js @@ -0,0 +1,4 @@ +const dummy = { hasSubscribers: false }; +export const metrics = dummy; +export const tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fa98a0f5eb4361545b9df395db12785d73bbf1b9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,E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EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2dd10cf8f908f279d1ff1cf03ed45759850f4ffa --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ab79a6c19318fbe69fcc5080b9be319f60944d17 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,C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C,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..86618ad212c13e70cefe8411c98c26aadd38134b --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,W=L;var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||W.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(u,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(u,e,t,i):console.error(`[${t}] ${e}: ${u}`)},k=u=>!j.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),G=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class u{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];u.#o=!0;let i=new u(e,t);return u.#o=!1,i}constructor(e,t){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class u{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:c,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?G(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";k(x)&&(j.add(x),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,u))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let c=this.#n===0?void 0:this.#s.get(e);if(c===void 0)c=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[c]=e,this.#t[c]=t,this.#s.set(e,c),this.#l[this.#h]=c,this.#u[c]=this.#h,this.#h=c,this.#n++,this.#j(c,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(c);let g=this.#t[c];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(c),this.#j(c,_,o),this.#t[c]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(c,n,r),o&&this.#v(o,c)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=c,p=this.#t[t];return(p===c||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=c;if(this.#t[t]===c&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(_).then(o,d),g=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:c,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",v&&(l.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(m);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let z=this.#P(e,m,F,f),E=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",E&&A&&(l.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..4c76924e702d021eaa647b871a4dfdbe110f9fc1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAUD,EACVE,EAAUF,ECFhB,IAAMG,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,KAAK,IAAI,EAAG,CAAC,EAAI,WACxBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,OAAO,iBAAmBC,EACjC,KALe,KAQbA,EAAN,cAAwB,KAAa,CACnC,YAAYC,EAAY,CACtB,MAAMA,CAAI,EACV,KAAK,KAAK,CAAC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OD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3e239ce91c97e051e8812141758926d4261e31b7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..f21cd88c8692d78970007d798eda03956101323c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5dc822129e06dc353855f5b44d4cfcc5854c2cd8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map new file mode 100644 index 0000000000000000000000000000000000000000..180a381b963c941b2f9562269e296cc6af03b5c4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.d.mts","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAavC,eAAO,IAAI,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9C,eAAO,IAAI,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..97b4b3fdf2efe8fc50be373051257c495ef0f480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.mjs","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,uEAAuE;AACvE,4EAA4E;AAC5E,oBAAoB;AACpB,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,IAAI,OAAO,GAAG,KAAyB,CAAA;AAC9C,MAAM,CAAC,IAAI,OAAO,GAAG,KAAgC,CAAA;AACrD,MAAM,CAAC,0BAA0B,CAAC;KAC/B,IAAI,CAAC,EAAE,CAAC,EAAE;IACT,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAC;KACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA","sourcesContent":["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1580158ba9beff3cfb8b587d0d3682d74eafa084 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare let metrics: Channel; +export declare let tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-esm.d.mts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..76d86f8125aaa0333f94357af4dd665c08259591 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/diagnostics-channel.js @@ -0,0 +1,19 @@ +/** + * no-op polyfills for non-node environments. tries to load the actual + * diagnostics_channel module on platforms that support it, but fails + * gracefully if not found. This means that the first tick of metrics + * and tracing will be missed, but that probably doesn't matter much. + */ +// conditionally import from diagnostic_channel, fall back to dummyfill +// all we actually have to mock is the hasSubscribers, since we always check +/* v8 ignore next */ +const dummy = { hasSubscribers: false }; +export let metrics = dummy; +export let tracing = dummy; +import('node:diagnostics_channel') + .then(dc => { + metrics = dc.channel('lru-cache:metrics'); + tracing = dc.tracingChannel('lru-cache'); +}) + .catch(() => { }); +//# sourceMappingURL=diagnostics-channel-esm.mjs.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3ab3f75260aecd96eb9cf0ad81b384510ada0ca9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IAET,IAAI,EAAE,WAAW,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IAGd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FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2dd10cf8f908f279d1ff1cf03ed45759850f4ffa --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e0a2fa92d28acdd79d99b9ef74632d05c63264c7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB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AS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..5715ef55079b7177b1dae59622bc4c78a8f06f18 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,A=L;import("node:diagnostics_channel").then(c=>{S=c.channel("lru-cache:metrics"),A=c.tracingChannel("lru-cache")}).catch(()=>{});var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||A.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(c,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(c,e,t,i):console.error(`[${t}] ${e}: ${c}`)},k=c=>!j.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),G=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class c{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];c.#o=!0;let i=new c(e,t);return c.#o=!1,i}constructor(e,t){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class c{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:z,ignoreFetchAbort:E,backgroundFetchSize:C=1,perf:v}=e;if(this.backgroundFetchSize=C,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=v??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let W=t?G(t):Array;if(!W)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new W(t),this.#u=new W(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";k(x)&&(j.add(x),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,c))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(e);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[u]=e,this.#t[u]=t,this.#s.set(e,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#j(u,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(u);let g=this.#t[u];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(u),this.#j(u,_,o),this.#t[u]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#v(o,u)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=u,p=this.#t[t];return(p===u||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=u;if(this.#t[t]===u&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),g=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=A.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:u,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let W=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=!0)),W?p.__staleWhileFetching:p.__returned=p}let z=this.#p(m);if(!b&&!z)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let E=this.#P(e,m,F,f),v=E.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=z?"stale":"refresh",v&&z&&(l.returnedStale=!0)),v?E.__staleWhileFetching:E.__returned=E}}forceFetch(e,t={}){let i=A.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e8b4b9e95f3578d4aad4ceb7f3383e99cf74d5e5 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-esm.mts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAoBA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EAC1BC,EAAUD,EACVE,EAAUF,EACrB,OAAO,0BAA0B,EAC9B,KAAKG,GAAK,CACTF,EAAUE,EAAG,QAAQ,mBAAmB,EACxCD,EAAUC,EAAG,eAAe,WAAW,CACzC,CAAC,EACA,MAAM,IAAK,CAAE,CAAC,ECpBV,IAAMC,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,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,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "dc", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2c0f7d519967f7afc7d23504622c990af01b5f93 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map new file mode 100644 index 0000000000000000000000000000000000000000..83ee50aae061c09e1bbadfec07e81b313d409261 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAGlE,MAAM,CAAC,MAAM,OAAO,GAAqB,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACrE,MAAM,CAAC,MAAM,OAAO,GAA4B,cAAc,CAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e9e25d06eb481fc2584d6e6d9eec9a7f27a01d4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..f37e0baac5977d16ec32ad7f1a9ebe4322669ca3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js @@ -0,0 +1,6 @@ +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +import { tracingChannel, channel } from 'node:diagnostics_channel'; +export const metrics = channel('lru-cache:metrics'); +export const tracing = tracingChannel('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e4b964bde4c274eac0346d5d34f7437a901480 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fa98a0f5eb4361545b9df395db12785d73bbf1b9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAA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C;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2dd10cf8f908f279d1ff1cf03ed45759850f4ffa --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ab79a6c19318fbe69fcc5080b9be319f60944d17 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":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D,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js new file mode 100644 index 0000000000000000000000000000000000000000..84c4c3ec14ffa300199b52981868f0ca9a2a1009 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js @@ -0,0 +1,2 @@ +import{tracingChannel as G,channel as P}from"node:diagnostics_channel";var S=P("lru-cache:metrics"),W=G("lru-cache");var L=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||W.hasSubscribers,U=new Set,M=typeof process=="object"&&process?process:{},k=(u,e,t,i)=>{typeof M.emitWarning=="function"?M.emitWarning(u,e,t,i):console.error(`[${t}] ${e}: ${u}`)},H=u=>!U.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),j=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class u{heap;length;static#o=!1;static create(e){let t=j(e);if(!t)return[];u.#o=!0;let i=new u(e,t);return u.#o=!1,i}constructor(e,t){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},I=class u{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:c,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??L,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?j(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";H(x)&&(U.add(x),k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,u))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let c=this.#n===0?void 0:this.#s.get(e);if(c===void 0)c=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[c]=e,this.#t[c]=t,this.#s.set(e,c),this.#l[this.#h]=c,this.#u[c]=this.#h,this.#h=c,this.#n++,this.#j(c,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(c);let g=this.#t[c];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(c),this.#j(c,_,o),this.#t[c]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(c,n,r),o&&this.#v(o,c)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=c,p=this.#t[t];return(p===c||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=c;if(this.#t[t]===c&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(_).then(o,d),g=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:c,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",v&&(l.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(m);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let z=this.#P(e,m,F,f),E=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",E&&A&&(l.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{I as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..76a87846550fe9b4c086d2fc9df05b771ec0b0e7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAEA,OAAS,kBAAAA,EAAgB,WAAAC,MAAe,2BAGjC,IAAMC,EAA4BD,EAAQ,mBAAmB,EACvDE,EAAmCH,EAAe,WAAW,ECEnE,IAAMI,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,I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,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["tracingChannel", "channel", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3e239ce91c97e051e8812141758926d4261e31b7 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..f21cd88c8692d78970007d798eda03956101323c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5dc822129e06dc353855f5b44d4cfcc5854c2cd8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15a4a627599a2e314fd02babfedd9c25fe7b365c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fd6eeeedb126fb20c93f43ffa1f01f718832081c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js new file mode 100644 index 0000000000000000000000000000000000000000..f21cd88c8692d78970007d798eda03956101323c --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js.map b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..86425c7dad62a20fa24d392304b85a6277c2ca28 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/dist/esm/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/lru-cache/package.json b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6ada2c211f2d6cde1776f935f225026e17ea500f --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/lru-cache/package.json @@ -0,0 +1,154 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "11.5.1", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash scripts/build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "main": "./dist/commonjs/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "esmDialects": [ + "browser", + "node" + ], + "commonjsDialects": [ + "browser", + "node" + ], + "exports": { + "./raw": "./src/index.ts", + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "selfLink": false + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "benchmark": "^2.1.4", + "esbuild": "^0.28.0", + "marked": "^4.2.12", + "mkdirp": "^3.0.1", + "oxlint": "^1.65.0", + "oxlint-tsgolint": "^0.22.1", + "prettier": "^3.8.3", + "tap": "^21.7.4", + "tshy": "^4.1.2", + "typedoc": "^0.28.19" + }, + "license": "BlueOak-1.0.0", + "files": [ + "dist" + ], + "engines": { + "node": "20 || >=22" + }, + "exports": { + "./raw": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.min.js" +} diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/minimatch/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8cb5cc6e616c0d9259b4965f9d2ce8528e4d2828 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/README.md b/tools/ui/node_modules/workbox-build/node_modules/minimatch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1a068fab2a0fb246162b55c9aec983019282b37a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/README.md @@ -0,0 +1,528 @@ +# minimatch + +A minimal matching utility. + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Important Security Consideration! + +> [!WARNING] +> This library uses JavaScript regular expressions. Please read +> the following warning carefully, and be thoughtful about what +> you provide to this library in production systems. + +_Any_ library in JavaScript that deals with matching string +patterns using regular expressions will be subject to +[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) +if the pattern is generated using untrusted input. + +Efforts have been made to mitigate risk as much as is feasible in +such a library, providing maximum recursion depths and so forth, +but these measures can only ultimately protect against accidents, +not malice. A dedicated attacker can _always_ find patterns that +cannot be defended against by a bash-compatible glob pattern +matching system that uses JavaScript regular expressions. + +To be extremely clear: + +> [!WARNING] +> **If you create a system where you take user input, and use +> that input as the source of a Regular Expression pattern, in +> this or any extant glob matcher in JavaScript, you will be +> pwned.** + +A future version of this library _may_ use a different matching +algorithm which does not exhibit backtracking problems. If and +when that happens, it will likely be a sweeping change, and those +improvements will **not** be backported to legacy versions. + +In the near term, it is not reasonable to continue to play +whack-a-mole with security advisories, and so any future ReDoS +reports will be considered "working as intended", and resolved +entirely by this warning. + +## Usage + +```js +// hybrid module, load with require() or import +import { minimatch } from 'minimatch' +// or: +const { minimatch } = require('minimatch') + +minimatch('bar.foo', '*.foo') // true! +minimatch('bar.foo', '*.bar') // false! +minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +- Brace Expansion +- Extended glob matching +- "Globstar" `**` matching +- [Posix character + classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), + like `[[:alpha:]]`, supporting the full range of Unicode + characters. For example, `[[:alpha:]]` will match against + `'é'`, though `[a-zA-Z]` will not. Collating symbol and set + matching is not supported, so `[[=e=]]` will _not_ match `'é'` + and `[[.ch.]]` will not match `'ch'` in locales where `ch` is + considered a single character. + +See: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes in patterns +will always be interpreted as escape characters, not path separators. + +Note that `\` or `/` _will_ be interpreted as path separators in paths on +Windows, and will match against `/` in glob expressions. + +So just always use `/` in patterns. + +### UNC Paths + +On Windows, UNC paths like `//?/c:/...` or +`//ComputerName/Share/...` are handled specially. + +- Patterns starting with a double-slash followed by some + non-slash characters will preserve their double-slash. As a + result, a pattern like `//*` will match `//x`, but not `/x`. +- Patterns staring with `//?/:` will _not_ treat + the `?` as a wildcard character. Instead, it will be treated + as a normal string. +- Patterns starting with `//?/:/...` will match + file paths starting with `:/...`, and vice versa, + as if the `//?/` was not present. This behavior only is + present when the drive letters are a case-insensitive match to + one another. The remaining portions of the path/pattern are + compared case sensitively, unless `nocase:true` is set. + +Note that specifying a UNC path using `\` characters as path +separators is always allowed in the file path argument, but only +allowed in the pattern argument when `windowsPathsNoEscape: true` +is set in the options. + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require('minimatch').Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +- `pattern` The original pattern the minimatch object represents. +- `options` The options supplied to the constructor. +- `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +- `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +- `negate` True if the pattern is negated. +- `comment` True if the pattern is a comment. +- `empty` True if the pattern is `""`. + +### Methods + +- `makeRe()` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +- `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +- `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. +- `hasMagic()` Returns true if the parsed pattern contains any + magic characters. Returns false if all comparator parts are + string literals. If the `magicalBraces` option is set on the + constructor, then it will consider brace expansions which are + not otherwise magical to be magic. If not set, then a pattern + like `a{b,c}d` will return `false`, because neither `abd` nor + `acd` contain any special glob characters. + + This does **not** mean that the pattern string can be used as a + literal filename, as it may contain magic glob characters that + are escaped. For example, the pattern `\\*` or `[*]` would not + be considered to have magic, as the matching portion parses to + the literal string `'*'` and would match a path named `'*'`, + not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may + be used to remove escape characters. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, '*.js', { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter( + minimatch.filter('*.js', { matchBase: true }), +) +``` + +### minimatch.escape(pattern, options = {}) + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings. + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.unescape(pattern, options = {}) + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nocaseMagicOnly + +When used with `{nocase: true}`, create regular expressions that +are case-insensitive, but leave string match portions untouched. +Has no effect when used without `{nocase: true}`. + +Useful when some other form of case-insensitive matching is used, +or if the original string representation is useful in some other +way. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### magicalBraces + +This only affects the results of the `Minimatch.hasMagic` method. + +If the pattern contains brace expansions, such as `a{b,c}d`, but +no other magic characters, then the `Minimatch.hasMagic()` method +will return `false` by default. When this option set, it will +return `true` for brace expansion as well as other magic glob +characters. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### windowsPathsNoEscape + +Use `\\` as a path separator _only_, and _never_ as an escape +character. If set, all `\\` characters are replaced with `/` in +the pattern. Note that this makes it **impossible** to match +against paths containing literal glob pattern characters, but +allows matching with patterns constructed using `path.join()` and +`path.resolve()` on Windows platforms, mimicking the (buggy!) +behavior of earlier versions on Windows. Please use with +caution, and be mindful of [the caveat about Windows +paths](#windows). + +For legacy reasons, this is also set if +`options.allowWindowsEscape` is set to the exact value `false`. + +### windowsNoMagicRoot + +When a pattern starts with a UNC path or drive letter, and in +`nocase:true` mode, do not convert the root portions of the +pattern into a case-insensitive regular expression, and instead +leave them as strings. + +This is the default when the platform is `win32` and +`nocase:true` is set. + +### preserveMultipleSlashes + +By default, multiple `/` characters (other than the leading `//` +in a UNC path, see "UNC Paths" above) are treated as a single +`/`. + +That is, a pattern like `a///b` will match the file path `a/b`. + +Set `preserveMultipleSlashes: true` to suppress this behavior. + +### optimizationLevel + +A number indicating the level of optimization that should be done +to the pattern prior to parsing and using it for matches. + +Globstar parts `**` are always converted to `*` when `noglobstar` +is set, and multiple adjacent `**` parts are converted into a +single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this +is equivalent in all cases). + +- `0` - Make no further changes. In this mode, `.` and `..` are + maintained in the pattern, meaning that they must also appear + in the same position in the test path string. Eg, a pattern + like `a/*/../c` will match the string `a/b/../c` but not the + string `a/c`. +- `1` - (default) Remove cases where a double-dot `..` follows a + pattern portion that is not `**`, `.`, `..`, or empty `''`. For + example, the pattern `./a/b/../*` is converted to `./a/*`, and + so it will match the path string `./a/c`, but not the path + string `./a/b/../c`. Dots and empty path portions in the + pattern are preserved. +- `2` (or higher) - Much more aggressive optimizations, suitable + for use with file-walking cases: + - Remove cases where a double-dot `..` follows a pattern + portion that is not `**`, `.`, or empty `''`. Remove empty + and `.` portions of the pattern, where safe to do so (ie, + anywhere other than the last position, the first position, or + the second position in a pattern starting with `/`, as this + may indicate a UNC path on Windows). + - Convert patterns containing `
/**/../

/` into the + equivalent `

/{..,**}/

/`, where `

` is a + a pattern portion other than `.`, `..`, `**`, or empty + `''`. + - Dedupe patterns where a `**` portion is present in one and + omitted in another, and it is not the final path portion, and + they are otherwise equivalent. So `{a/**/b,a/b}` becomes + `a/**/b`, because `**` matches against an empty path portion. + - Dedupe patterns where a `*` portion is present in one, and a + non-dot pattern other than `**`, `.`, `..`, or `''` is in the + same position in the other. So `a/{*,x}/b` becomes `a/*/b`, + because `*` can match against `x`. + + While these optimizations improve the performance of + file-walking use cases such as [glob](http://npm.im/glob) (ie, + the reason this module exists), there are cases where it will + fail to match a literal string that would have been matched in + optimization level 1 or 0. + + Specifically, while the `Minimatch.match()` method will + optimize the file path string in the same ways, resulting in + the same matches, it will fail when tested with the regular + expression provided by `Minimatch.makeRe()`, unless the path + string is first processed with + `minimatch.levelTwoFileOptimize()` or similar. + +### platform + +When set to `win32`, this will trigger all windows-specific +behaviors (special handling for UNC paths, and treating `\` as +separators in file paths for comparison.) + +Defaults to the value of `process.platform`. + +### maxGlobstarRecursion + +Max number of non-adjacent `**` patterns to recursively walk +down. + +The default of `200` is almost certainly high enough for most +purposes, and can handle absurdly excessive patterns. + +If the limit is exceeded (which would require very excessively +long patterns and paths containing lots of `**` patterns!), then +it is treated as non-matching, even if the path would normally +match the pattern provided. + +That is, this is an intentional false negative, deemed an +acceptable break in correctness for security and performance. + +### maxExtglobRecursion + +Max depth to traverse for nested extglobs like `*(a|b|c)` + +Default is 2, which is quite low, but any higher value swiftly +results in punishing performance impacts. Note that this is _not_ +relevant when the globstar types can be safely coalesced into a +single set. + +For example, `*(a|@(b|c)|d)` would be flattened into +`*(a|b|c|d)`. Thus, many common extglobs will retain good +performance and never hit this limit, even if they are +excessively deep and complicated. + +If the limit is hit, then the extglob characters are simply not +parsed, and the pattern effectively switches into `noextglob: +true` mode for the contents of that nested sub-pattern. This will +typically _not_ result in a match, but is considered a valid +trade-off for security and performance. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between minimatch and +other implementations. Some are intentional, and some are +unavoidable. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +Negated extglob patterns are handled as closely as possible to +Bash semantics, but there are some cases with negative extglobs +which are exceedingly difficult to express in a JavaScript +regular expression. In particular the negated pattern +`!(*|)*` will in bash match anything that does +not start with ``. However, +`!(*)*` _will_ match paths starting with +``, because the empty string can match against +the negated portion. In this library, `!(*|)*` +will _not_ match any pattern starting with ``, due to a +difference in precisely which patterns are considered "greedy" in +Regular Expressions vs bash path expansion. This may be fixable, +but not without incurring some complexity and performance costs, +and the trade-off seems to not be worth pursuing. + +Note that `fnmatch(3)` in libc is an extremely naive string comparison +matcher, which does not do anything special for slashes. This library is +designed to be used in glob searching and file walkers, and so it does do +special things with `/`. Thus, `foo*` will not match `foo/bar` in this +library, even though it would in `fnmatch(3)`. diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..34d7a78a0c514479118614db25b5bb9c1b1706f2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts @@ -0,0 +1,2 @@ +export declare const assertValidPattern: (pattern: unknown) => void; +//# sourceMappingURL=assert-valid-pattern.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..30ddcd51f6eae80e97bc753145194c71fd1cbad2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..5fc86bbd0116c9b0e2579cb27de4ad53af938fc6 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9fc27a931c7e3feedf326df1a48a52b886f58cfb --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74f2cf9322b97504fa4d6eb29dbe74222a4449ba --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts @@ -0,0 +1,22 @@ +import type { MinimatchOptions, MMRegExp } from './index.js'; +export type ExtglobType = '!' | '?' | '+' | '*' | '@'; +export declare class AST { + #private; + type: ExtglobType | null; + id: number; + get depth(): number; + constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions); + get hasMagic(): boolean | undefined; + toString(): string; + push(...parts: (string | AST)[]): void; + toJSON(): unknown[]; + isStart(): boolean; + isEnd(): boolean; + copyIn(part: AST | string): void; + clone(parent: AST): AST; + static fromGlob(pattern: string, options?: MinimatchOptions): AST; + toMMPattern(): MMRegExp | string; + get options(): MinimatchOptions; + toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean]; +} +//# sourceMappingURL=ast.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8965fd6a99ff91e22cd5de1f2c41563a673b8dc0 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.js new file mode 100644 index 0000000000000000000000000000000000000000..33df3769f3ca063f574b30d862942ba36b956a58 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.js @@ -0,0 +1,845 @@ +"use strict"; +// parse a single path portion +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST = void 0; +const brace_expressions_js_1 = require("./brace-expressions.js"); +const unescape_js_1 = require("./unescape.js"); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +const isExtglobAST = (c) => isExtglobType(c.type); +// Map of which extglob types can adopt the children of a nested extglob +// +// anything but ! can adopt a matching type: +// +(a|+(b|c)|d) => +(a|b|c|d) +// *(a|*(b|c)|d) => *(a|b|c|d) +// @(a|@(b|c)|d) => @(a|b|c|d) +// ?(a|?(b|c)|d) => ?(a|b|c|d) +// +// * can adopt anything, because 0 or repetition is allowed +// *(a|?(b|c)|d) => *(a|b|c|d) +// *(a|+(b|c)|d) => *(a|b|c|d) +// *(a|@(b|c)|d) => *(a|b|c|d) +// +// + can adopt @, because 1 or repetition is allowed +// +(a|@(b|c)|d) => +(a|b|c|d) +// +// + and @ CANNOT adopt *, because 0 would be allowed +// +(a|*(b|c)|d) => would match "", on *(b|c) +// @(a|*(b|c)|d) => would match "", on *(b|c) +// +// + and @ CANNOT adopt ?, because 0 would be allowed +// +(a|?(b|c)|d) => would match "", on ?(b|c) +// @(a|?(b|c)|d) => would match "", on ?(b|c) +// +// ? can adopt @, because 0 or 1 is allowed +// ?(a|@(b|c)|d) => ?(a|b|c|d) +// +// ? and @ CANNOT adopt * or +, because >1 would be allowed +// ?(a|*(b|c)|d) => would match bbb on *(b|c) +// @(a|*(b|c)|d) => would match bbb on *(b|c) +// ?(a|+(b|c)|d) => would match bbb on +(b|c) +// @(a|+(b|c)|d) => would match bbb on +(b|c) +// +// ! CANNOT adopt ! (nothing else can either) +// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) +// +// ! can adopt @ +// !(a|@(b|c)|d) => !(a|b|c|d) +// +// ! CANNOT adopt * +// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt + +// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt ? +// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" +const adoptionMap = new Map([ + ['!', ['@']], + ['?', ['?', '@']], + ['@', ['@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@']], +]); +// nested extglobs that can be adopted in, but with the addition of +// a blank '' element. +const adoptionWithSpaceMap = new Map([ + ['!', ['?']], + ['@', ['?']], + ['+', ['?', '*']], +]); +// union of the previous two maps +const adoptionAnyMap = new Map([ + ['!', ['?', '@']], + ['?', ['?', '@']], + ['@', ['?', '@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@', '?', '*']], +]); +// Extglobs that can take over their parent if they are the only child +// the key is parent, value maps child to resulting extglob parent type +// '@' is omitted because it's a special case. An `@` extglob with a single +// member can always be usurped by that subpattern. +const usurpMap = new Map([ + ['!', new Map([['!', '@']])], + [ + '?', + new Map([ + ['*', '*'], + ['+', '*'], + ]), + ], + [ + '@', + new Map([ + ['!', '!'], + ['?', '?'], + ['@', '@'], + ['*', '*'], + ['+', '+'], + ]), + ], + [ + '+', + new Map([ + ['?', '*'], + ['*', '*'], + ]), + ], +]); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +let ID = 0; +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return { + '@@type': 'AST', + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts, + }; + } + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + return (this.#toString !== undefined ? this.#toString + : !this.type ? + (this.#toString = this.#parts.map(p => String(p)).join('')) + : (this.#toString = + this.type + + '(' + + this.#parts.map(p => String(p)).join('|') + + ')')); + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && + !(p instanceof _a && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null ? + this.#parts + .slice() + .map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof _a && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new _a(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + // we don't have to check for adoption here, because that's + // done at the other recursion point. + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + extDepth <= maxDepth; + if (doRecurse) { + ast.push(acc); + acc = ''; + const ext = new _a(c, ast); + i = _a.#parseAST(str, ext, i, opt, extDepth + 1); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new _a(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); + /* c8 ignore stop */ + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; + part.push(acc); + acc = ''; + const ext = new _a(c, part); + part.push(ext); + i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new _a(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map = adoptionMap) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map); + } + #canAdoptType(c, map = adoptionAnyMap) { + return !!map.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(''); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === 'object') + p.#parent = this; + } + this.#toString = undefined; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null || + this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + /* c8 ignore start - impossible */ + if (!nt) + return false; + /* c8 ignore stop */ + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#parent = this; + } + } + this.type = nt; + this.#toString = undefined; + this.#emptyExt = false; + } + static fromGlob(pattern, options = {}) { + const ast = new _a(null, undefined, options); + _a.#parseAST(pattern, ast, 0, options, 0); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) { + this.#flatten(); + this.#fillNegs(); + } + if (!isExtglobAST(this)) { + const noEmpty = this.isStart() && + this.isEnd() && + !this.#parts.some(s => typeof s !== 'string'); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' ? + _a.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = + needNoTrav ? startNoTraversal + : needNoDot ? startNoDot + : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? + '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' ? + // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' ? ')' + : this.type === '?' ? ')?' + : this.type === '+' && bodyDotAllowed ? ')' + : this.type === '*' && bodyDotAllowed ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#flatten(); + } + } + } + else { + // do up to 10 passes to flatten as much as possible + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === 'object') { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } + else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } + else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = undefined; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + // multiple stars that aren't globstars coalesce into one * + let inStar = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '*') { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star; + hasMagic = true; + continue; + } + else { + inStar = false; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +_a = AST; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/ast.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3498fb2631bc2968f6e8e7b04b5adbbe2f29e6ed --- /dev/null +++ b/tools/ui/node_modules/workbox-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,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AArxBD,kBAqxBC","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n ExtglobType,\n Map\n>([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n #parent?: AST\n #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n id = ++ID\n\n get depth(): number {\n return (this.#parent?.depth ?? -1) + 1\n }\n\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n }\n }\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {},\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n return (\n this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')')\n )\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (\n typeof p !== 'string' &&\n !(p instanceof AST && p.#parent === this)\n ) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: unknown[] =\n this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions,\n extDepth: number,\n ): number {\n const maxDepth = opt.maxExtglobRecursion ?? 2\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth\n if (doRecurse) {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n #canAdoptWithSpace(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n return this.#canAdopt(child, adoptionWithSpaceMap)\n }\n\n #canAdopt(\n child?: AST | string,\n map: Map = adoptionMap,\n ): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canAdoptType(\n gc.type,\n map,\n )\n }\n #canAdoptType(\n c: string,\n map: Map = adoptionAnyMap,\n ): c is ExtglobType {\n return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n }\n\n #adoptWithSpace(\n this: AST & { type: ExtglobType },\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const blank = new AST(null, gc, this.options)\n blank.#parts.push('')\n gc.push(blank)\n this.#adopt(child, index)\n }\n\n #adopt(\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n this.#parts.splice(index, 1, ...gc.#parts)\n for (const p of gc.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.#toString = undefined\n }\n\n #canUsurpType(c: string): boolean {\n const m = usurpMap.get(this.type as ExtglobType)\n return !!m?.has(c as ExtglobType)\n }\n\n #canUsurp(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n }\n\n #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n const m = usurpMap.get(this.type as ExtglobType)\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const nt = m?.get(gc.type)\n /* c8 ignore start - impossible */\n if (!nt) return false\n /* c8 ignore stop */\n this.#parts = gc.#parts\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this\n }\n }\n this.type = nt\n this.#toString = undefined\n this.#emptyExt = false\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options, 0)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) {\n this.#flatten()\n this.#fillNegs()\n }\n if (!isExtglobAST(this)) {\n const noEmpty =\n this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string')\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string' ?\n AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n const me = this as AST\n me.#parts = [s]\n me.type = null\n me.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten()\n }\n }\n } else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0\n let done = false\n do {\n done = true\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i]\n if (typeof c === 'object') {\n c.#flatten()\n if (this.#canAdopt(c)) {\n done = false\n this.#adopt(c, i)\n } else if (this.#canAdoptWithSpace(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n } else if (this.#canUsurp(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#usurp(c)\n }\n }\n }\n } while (!done && ++iterations < 10)\n }\n this.#toString = undefined\n }\n\n #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n continue\n }\n if (c === '*') {\n if (inStar) continue\n inStar = true\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n hasMagic = true\n continue\n } else {\n inStar = false\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n continue\n }\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1572deb95e2e376474f9fc1e56e4c38a055fbd1 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts @@ -0,0 +1,8 @@ +export type ParseClassResult = [ + src: string, + uFlag: boolean, + consumed: number, + hasMagic: boolean +]; +export declare const parseClass: (glob: string, position: number) => ParseClassResult; +//# sourceMappingURL=brace-expressions.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..09b4c11060de7850a23ad17948c7d5d674850576 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js new file mode 100644 index 0000000000000000000000000000000000000000..2b7b03712b874e29341dcb990f3b8b6163f145d4 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js @@ -0,0 +1,150 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' + : ranges.length ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3cc3b343b530fda9adc37982e4d80d6ac654d673 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/brace-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace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AC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AA9HY,QAAA,UAAU,cA8HtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number,\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..141024a06bdf747fe6d6ecc48a80675dff795800 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts @@ -0,0 +1,15 @@ +import type { MinimatchOptions } from './index.js'; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e167e30065a04e54a37b3f6e6b44275c42c3c602 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js new file mode 100644 index 0000000000000000000000000000000000000000..83a713a25507707b9071cc1a93be5a8fc20affd9 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + if (magicalBraces) { + return windowsPathsNoEscape ? + s.replace(/[?*()[\]{}]/g, '[$&]') + : s.replace(/[?*()[\]\\{}]/g, '\\$&'); + } + return windowsPathsNoEscape ? + s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f963f0a14ae877630cc9542b82ee1b5365621c33 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e1fc2edaadbe09033faefbd7363f0cba109bafc --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts @@ -0,0 +1,174 @@ +import { AST } from './ast.js'; +export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; +export interface MinimatchOptions { + /** do not expand `{x,y}` style braces */ + nobrace?: boolean; + /** do not treat patterns starting with `#` as a comment */ + nocomment?: boolean; + /** do not treat patterns starting with `!` as a negation */ + nonegate?: boolean; + /** print LOTS of debugging output */ + debug?: boolean; + /** treat `**` the same as `*` */ + noglobstar?: boolean; + /** do not expand extglobs like `+(a|b)` */ + noext?: boolean; + /** return the pattern if nothing matches */ + nonull?: boolean; + /** treat `\\` as a path separator, not an escape character */ + windowsPathsNoEscape?: boolean; + /** + * inverse of {@link MinimatchOptions.windowsPathsNoEscape} + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * Compare a partial path to a pattern. As long as the parts + * of the path that are present are not contradicted by the + * pattern, it will be treated as a match. This is useful in + * applications where you're walking through a folder structure, + * and don't yet have the full path, but want to ensure that you + * do not walk down paths that can never be a match. + */ + partial?: boolean; + /** allow matches that start with `.` even if the pattern does not */ + dot?: boolean; + /** ignore case */ + nocase?: boolean; + /** ignore case only in wildcard patterns */ + nocaseMagicOnly?: boolean; + /** consider braces to be "magic" for the purpose of `hasMagic` */ + magicalBraces?: boolean; + /** + * If set, then patterns without slashes will be matched + * against the basename of the path if it contains slashes. + * For example, `a?b` would match the path `/xyz/123/acb`, but + * not `/xyz/acb/123`. + */ + matchBase?: boolean; + /** invert the results of negated matches */ + flipNegate?: boolean; + /** do not collapse multiple `/` into a single `/` */ + preserveMultipleSlashes?: boolean; + /** + * A number indicating the level of optimization that should be done + * to the pattern prior to parsing and using it for matches. + */ + optimizationLevel?: number; + /** operating system platform */ + platform?: Platform; + /** + * When a pattern starts with a UNC path or drive letter, and in + * `nocase:true` mode, do not convert the root portions of the + * pattern into a case-insensitive regular expression, and instead + * leave them as strings. + * + * This is the default when the platform is `win32` and + * `nocase:true` is set. + */ + windowsNoMagicRoot?: boolean; + /** + * max number of `{...}` patterns to expand. Default 100_000. + */ + braceExpandMax?: number; + /** + * Max number of non-adjacent `**` patterns to recursively walk down. + * + * The default of 200 is almost certainly high enough for most purposes, + * and can handle absurdly excessive patterns. + */ + maxGlobstarRecursion?: number; + /** + * Max depth to traverse for nested extglobs like `*(a|b|c)` + * + * Default is 2, which is quite low, but any higher value + * swiftly results in punishing performance impacts. Note + * that this is *not* relevant when the globstar types can + * be safely coalesced into a single set. + * + * For example, `*(a|@(b|c)|d)` would be flattened into + * `*(a|b|c|d)`. Thus, many common extglobs will retain good + * performance and never hit this limit, even if they are + * excessively deep and complicated. + * + * If the limit is hit, then the extglob characters are simply + * not parsed, and the pattern effectively switches into + * `noextglob: true` mode for the contents of that nested + * sub-pattern. This will typically _not_ result in a match, + * but is considered a valid trade-off for security and + * performance. + */ + maxExtglobRecursion?: number; +} +export declare const minimatch: { + (p: string, pattern: string, options?: MinimatchOptions): boolean; + sep: Sep; + GLOBSTAR: typeof GLOBSTAR; + filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; + defaults: (def: MinimatchOptions) => typeof minimatch; + braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; + makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; + match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; + AST: typeof AST; + Minimatch: typeof Minimatch; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +export type Sep = '\\' | '/'; +export declare const sep: Sep; +export declare const GLOBSTAR: unique symbol; +export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; +export declare const defaults: (def: MinimatchOptions) => typeof minimatch; +export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; +export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; +export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; +export type MMRegExp = RegExp & { + _src?: string; + _glob?: string; +}; +export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR; +export type ParseReturn = ParseReturnFiltered | false; +export declare class Minimatch { + #private; + options: MinimatchOptions; + set: ParseReturnFiltered[][]; + pattern: string; + windowsPathsNoEscape: boolean; + nonegate: boolean; + negate: boolean; + comment: boolean; + empty: boolean; + preserveMultipleSlashes: boolean; + partial: boolean; + globSet: string[]; + globParts: string[][]; + nocase: boolean; + isWindows: boolean; + platform: Platform; + windowsNoMagicRoot: boolean; + maxGlobstarRecursion: number; + regexp: false | null | MMRegExp; + constructor(pattern: string, options?: MinimatchOptions); + hasMagic(): boolean; + debug(..._: unknown[]): void; + make(): void; + preprocess(globParts: string[][]): string[][]; + adjascentGlobstarOptimize(globParts: string[][]): string[][]; + levelOneOptimize(globParts: string[][]): string[][]; + levelTwoFileOptimize(parts: string | string[]): string[]; + firstPhasePreProcess(globParts: string[][]): string[][]; + secondPhasePreProcess(globParts: string[][]): string[][]; + partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[]; + parseNegate(): void; + matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean; + braceExpand(): string[]; + parse(pattern: string): ParseReturn; + makeRe(): false | MMRegExp; + slashSplit(p: string): string[]; + match(f: string, partial?: boolean): boolean; + static defaults(def: MinimatchOptions): typeof Minimatch; +} +export { AST } from './ast.js'; +export { escape } from './escape.js'; +export { unescape } from './unescape.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7620db91cc81855821dded14c51fdfe9b0cd1d6a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAA;IAC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AiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5a6983481b78583d75c89a17c5a8371b059171ff --- /dev/null +++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js @@ -0,0 +1,1127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = require("brace-expansion"); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const ast_js_1 = require("./ast.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?*[(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?*[(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process ? + (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + maxGlobstarRecursion; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + // avoid the annoying deprecation flag lol + const awe = ('allowWindow' + 'sEscape'); + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options[awe] === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined ? + options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + //oxlint-disable-next-line no-console + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [ + ...s.slice(0, 4), + ...s.slice(4).map(ss => this.parse(ss)), + ]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn ** into * + if (this.options.noglobstar) { + for (const partset of globParts) { + for (let j = 0; j < partset.length; j++) { + if (partset[j] === '**') { + partset[j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //

// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(exports.GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === exports.GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === exports.GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === exports.GLOBSTAR ? exports.GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== exports.GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
+}
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = require("./ast.js");
+Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
+var escape_js_2 = require("./escape.js");
+Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
+var unescape_js_2 = require("./unescape.js");
+Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f0b81f03f38174267674c53a3dcd4633518e300f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,uEAA8D;AAE9D,qCAA8B;AAC9B,2CAAoC;AACpC,+CAAwC;AAqHjC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAbY,QAAA,SAAS,aAarB;AAED,wDAAwD;AACxD,MAAM,YAAY,GAAG,oBAAoB,CAAA;AACzC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC,CAAC,CAAC,UAAU,CAA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C;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAhkCD,8BAgkCC;AACD,qBAAqB;AACrB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,6CAAwC;AAA/B,uGAAA,QAAQ,OAAA;AACjB,oBAAoB;AACpB,iBAAS,CAAC,GAAG,GAAG,YAAG,CAAA;AACnB,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,iBAAS,CAAC,MAAM,GAAG,kBAAM,CAAA;AACzB,iBAAS,CAAC,QAAQ,GAAG,sBAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c4a14473afc706260b914e947fbb636680ddf43f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09d6eab4e6502cde5495bf5ea51637d6db86999c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad648fba64d40d27684d091b66282f0bbeb27012
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..44387ec58d1bb4950d2869a3c65ff08738fd79ad
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/commonjs/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..34d7a78a0c514479118614db25b5bb9c1b1706f2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
@@ -0,0 +1,2 @@
+export declare const assertValidPattern: (pattern: unknown) => void;
+//# sourceMappingURL=assert-valid-pattern.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..30ddcd51f6eae80e97bc753145194c71fd1cbad2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js
new file mode 100644
index 0000000000000000000000000000000000000000..7b534fc30200bb8e36fc6f85aebb49a8738f711d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js
@@ -0,0 +1,10 @@
+const MAX_PATTERN_LENGTH = 1024 * 64;
+export const assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
+};
+//# sourceMappingURL=assert-valid-pattern.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..550f61df5a845c757c260140cd1a83156355d8f4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n  pattern: unknown,\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..74f2cf9322b97504fa4d6eb29dbe74222a4449ba
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions, MMRegExp } from './index.js';
+export type ExtglobType = '!' | '?' | '+' | '*' | '@';
+export declare class AST {
+    #private;
+    type: ExtglobType | null;
+    id: number;
+    get depth(): number;
+    constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
+    get hasMagic(): boolean | undefined;
+    toString(): string;
+    push(...parts: (string | AST)[]): void;
+    toJSON(): unknown[];
+    isStart(): boolean;
+    isEnd(): boolean;
+    copyIn(part: AST | string): void;
+    clone(parent: AST): AST;
+    static fromGlob(pattern: string, options?: MinimatchOptions): AST;
+    toMMPattern(): MMRegExp | string;
+    get options(): MinimatchOptions;
+    toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
+}
+//# sourceMappingURL=ast.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8965fd6a99ff91e22cd5de1f2c41563a673b8dc0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js
new file mode 100644
index 0000000000000000000000000000000000000000..f639546593db64ee620281cffd819f3c103fc09b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js
@@ -0,0 +1,841 @@
+// parse a single path portion
+var _a;
+import { parseClass } from './brace-expressions.js';
+import { unescape } from './unescape.js';
+const types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => types.has(c);
+const isExtglobAST = (c) => isExtglobType(c.type);
+// Map of which extglob types can adopt the children of a nested extglob
+//
+// anything but ! can adopt a matching type:
+// +(a|+(b|c)|d) => +(a|b|c|d)
+// *(a|*(b|c)|d) => *(a|b|c|d)
+// @(a|@(b|c)|d) => @(a|b|c|d)
+// ?(a|?(b|c)|d) => ?(a|b|c|d)
+//
+// * can adopt anything, because 0 or repetition is allowed
+// *(a|?(b|c)|d) => *(a|b|c|d)
+// *(a|+(b|c)|d) => *(a|b|c|d)
+// *(a|@(b|c)|d) => *(a|b|c|d)
+//
+// + can adopt @, because 1 or repetition is allowed
+// +(a|@(b|c)|d) => +(a|b|c|d)
+//
+// + and @ CANNOT adopt *, because 0 would be allowed
+// +(a|*(b|c)|d) => would match "", on *(b|c)
+// @(a|*(b|c)|d) => would match "", on *(b|c)
+//
+// + and @ CANNOT adopt ?, because 0 would be allowed
+// +(a|?(b|c)|d) => would match "", on ?(b|c)
+// @(a|?(b|c)|d) => would match "", on ?(b|c)
+//
+// ? can adopt @, because 0 or 1 is allowed
+// ?(a|@(b|c)|d) => ?(a|b|c|d)
+//
+// ? and @ CANNOT adopt * or +, because >1 would be allowed
+// ?(a|*(b|c)|d) => would match bbb on *(b|c)
+// @(a|*(b|c)|d) => would match bbb on *(b|c)
+// ?(a|+(b|c)|d) => would match bbb on +(b|c)
+// @(a|+(b|c)|d) => would match bbb on +(b|c)
+//
+// ! CANNOT adopt ! (nothing else can either)
+// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
+//
+// ! can adopt @
+// !(a|@(b|c)|d) => !(a|b|c|d)
+//
+// ! CANNOT adopt *
+// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt +
+// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt ?
+// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
+const adoptionMap = new Map([
+    ['!', ['@']],
+    ['?', ['?', '@']],
+    ['@', ['@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@']],
+]);
+// nested extglobs that can be adopted in, but with the addition of
+// a blank '' element.
+const adoptionWithSpaceMap = new Map([
+    ['!', ['?']],
+    ['@', ['?']],
+    ['+', ['?', '*']],
+]);
+// union of the previous two maps
+const adoptionAnyMap = new Map([
+    ['!', ['?', '@']],
+    ['?', ['?', '@']],
+    ['@', ['?', '@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@', '?', '*']],
+]);
+// Extglobs that can take over their parent if they are the only child
+// the key is parent, value maps child to resulting extglob parent type
+// '@' is omitted because it's a special case. An `@` extglob with a single
+// member can always be usurped by that subpattern.
+const usurpMap = new Map([
+    ['!', new Map([['!', '@']])],
+    [
+        '?',
+        new Map([
+            ['*', '*'],
+            ['+', '*'],
+        ]),
+    ],
+    [
+        '@',
+        new Map([
+            ['!', '!'],
+            ['?', '?'],
+            ['@', '@'],
+            ['*', '*'],
+            ['+', '+'],
+        ]),
+    ],
+    [
+        '+',
+        new Map([
+            ['?', '*'],
+            ['*', '*'],
+        ]),
+    ],
+]);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const starNoEmpty = qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+let ID = 0;
+export class AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    id = ++ID;
+    get depth() {
+        return (this.#parent?.depth ?? -1) + 1;
+    }
+    [Symbol.for('nodejs.util.inspect.custom')]() {
+        return {
+            '@@type': 'AST',
+            id: this.id,
+            type: this.type,
+            root: this.#root.id,
+            parent: this.#parent?.id,
+            depth: this.depth,
+            partsLength: this.#parts.length,
+            parts: this.#parts,
+        };
+    }
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
+    }
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
+        }
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
+    }
+    // reconstructs the pattern
+    toString() {
+        return (this.#toString !== undefined ? this.#toString
+            : !this.type ?
+                (this.#toString = this.#parts.map(p => String(p)).join(''))
+                : (this.#toString =
+                    this.type +
+                        '(' +
+                        this.#parts.map(p => String(p)).join('|') +
+                        ')'));
+    }
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
+        }
+        return this;
+    }
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' &&
+                !(p instanceof _a && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
+        }
+    }
+    toJSON() {
+        const ret = this.type === null ?
+            this.#parts
+                .slice()
+                .map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
+        }
+        return ret;
+    }
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof _a && pp.type === '!')) {
+                return false;
+            }
+        }
+        return true;
+    }
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
+    }
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
+    }
+    clone(parent) {
+        const c = new _a(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
+        }
+        return c;
+    }
+    static #parseAST(str, ast, pos, opt, extDepth) {
+        const maxDepth = opt.maxExtglobRecursion ?? 2;
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                // we don't have to check for adoption here, because that's
+                // done at the other recursion point.
+                const doRecurse = !opt.noext &&
+                    isExtglobType(c) &&
+                    str.charAt(i) === '(' &&
+                    extDepth <= maxDepth;
+                if (doRecurse) {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new _a(c, ast);
+                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
+        }
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new _a(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            const doRecurse = !opt.noext &&
+                isExtglobType(c) &&
+                str.charAt(i) === '(' &&
+                /* c8 ignore start - the maxDepth is sufficient here */
+                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
+            /* c8 ignore stop */
+            if (doRecurse) {
+                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
+                part.push(acc);
+                acc = '';
+                const ext = new _a(c, part);
+                part.push(ext);
+                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new _a(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
+    }
+    #canAdoptWithSpace(child) {
+        return this.#canAdopt(child, adoptionWithSpaceMap);
+    }
+    #canAdopt(child, map = adoptionMap) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canAdoptType(gc.type, map);
+    }
+    #canAdoptType(c, map = adoptionAnyMap) {
+        return !!map.get(this.type)?.includes(c);
+    }
+    #adoptWithSpace(child, index) {
+        const gc = child.#parts[0];
+        const blank = new _a(null, gc, this.options);
+        blank.#parts.push('');
+        gc.push(blank);
+        this.#adopt(child, index);
+    }
+    #adopt(child, index) {
+        const gc = child.#parts[0];
+        this.#parts.splice(index, 1, ...gc.#parts);
+        for (const p of gc.#parts) {
+            if (typeof p === 'object')
+                p.#parent = this;
+        }
+        this.#toString = undefined;
+    }
+    #canUsurpType(c) {
+        const m = usurpMap.get(this.type);
+        return !!m?.has(c);
+    }
+    #canUsurp(child) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null ||
+            this.#parts.length !== 1) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canUsurpType(gc.type);
+    }
+    #usurp(child) {
+        const m = usurpMap.get(this.type);
+        const gc = child.#parts[0];
+        const nt = m?.get(gc.type);
+        /* c8 ignore start - impossible */
+        if (!nt)
+            return false;
+        /* c8 ignore stop */
+        this.#parts = gc.#parts;
+        for (const p of this.#parts) {
+            if (typeof p === 'object') {
+                p.#parent = this;
+            }
+        }
+        this.type = nt;
+        this.#toString = undefined;
+        this.#emptyExt = false;
+    }
+    static fromGlob(pattern, options = {}) {
+        const ast = new _a(null, undefined, options);
+        _a.#parseAST(pattern, ast, 0, options, 0);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
+        });
+    }
+    get options() {
+        return this.#options;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this) {
+            this.#flatten();
+            this.#fillNegs();
+        }
+        if (!isExtglobAST(this)) {
+            const noEmpty = this.isStart() &&
+                this.isEnd() &&
+                !this.#parts.some(s => typeof s !== 'string');
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
+                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start =
+                            needNoTrav ? startNoTraversal
+                                : needNoDot ? startNoDot
+                                    : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            const me = this;
+            me.#parts = [s];
+            me.type = null;
+            me.#hasMagic = undefined;
+            return [s, unescape(this.toString()), false, false];
+        }
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
+            ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!' ?
+                // !() must match something,but !(x) can match ''
+                '))' +
+                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                    star +
+                    ')'
+                : this.type === '@' ? ')'
+                    : this.type === '?' ? ')?'
+                        : this.type === '+' && bodyDotAllowed ? ')'
+                            : this.type === '*' && bodyDotAllowed ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #flatten() {
+        if (!isExtglobAST(this)) {
+            for (const p of this.#parts) {
+                if (typeof p === 'object') {
+                    p.#flatten();
+                }
+            }
+        }
+        else {
+            // do up to 10 passes to flatten as much as possible
+            let iterations = 0;
+            let done = false;
+            do {
+                done = true;
+                for (let i = 0; i < this.#parts.length; i++) {
+                    const c = this.#parts[i];
+                    if (typeof c === 'object') {
+                        c.#flatten();
+                        if (this.#canAdopt(c)) {
+                            done = false;
+                            this.#adopt(c, i);
+                        }
+                        else if (this.#canAdoptWithSpace(c)) {
+                            done = false;
+                            this.#adoptWithSpace(c, i);
+                        }
+                        else if (this.#canUsurp(c)) {
+                            done = false;
+                            this.#usurp(c);
+                        }
+                    }
+                }
+            } while (!done && ++iterations < 10);
+        }
+        this.#toString = undefined;
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        // multiple stars that aren't globstars coalesce into one *
+        let inStar = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '*') {
+                if (inStar)
+                    continue;
+                inStar = true;
+                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
+                hasMagic = true;
+                continue;
+            }
+            else {
+                inStar = false;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape(glob), !!hasMagic, uflag];
+    }
+}
+_a = AST;
+//# sourceMappingURL=ast.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5cc3ee91a072b55b9ff2df2066afd50cf38a6ce
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/ast.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,8BAA8B;;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAEvB,wEAAwE;AACxE,EAAE;AACF,4CAA4C;AAC5C,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,oDAAoD;AACpD,8BAA8B;AAC9B,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,2CAA2C;AAC3C,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,6CAA6C;AAC7C,qEAAqE;AACrE,EAAE;A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AG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n  types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n  isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n  ['!', ['@']],\n  ['?', ['?', '@']],\n  ['@', ['@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n  ['!', ['?']],\n  ['@', ['?']],\n  ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n  ['!', ['?', '@']],\n  ['?', ['?', '@']],\n  ['@', ['?', '@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n  ExtglobType,\n  Map\n>([\n  ['!', new Map([['!', '@']])],\n  [\n    '?',\n    new Map([\n      ['*', '*'],\n      ['+', '*'],\n    ]),\n  ],\n  [\n    '@',\n    new Map([\n      ['!', '!'],\n      ['?', '?'],\n      ['@', '@'],\n      ['*', '*'],\n      ['+', '+'],\n    ]),\n  ],\n  [\n    '+',\n    new Map([\n      ['?', '*'],\n      ['*', '*'],\n    ]),\n  ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  #parent?: AST\n  #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n  id = ++ID\n\n  get depth(): number {\n    return (this.#parent?.depth ?? -1) + 1\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')]() {\n    return {\n      '@@type': 'AST',\n      id: this.id,\n      type: this.type,\n      root: this.#root.id,\n      parent: this.#parent?.id,\n      depth: this.depth,\n      partsLength: this.#parts.length,\n      parts: this.#parts,\n    }\n  }\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {},\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    return (\n      this.#toString !== undefined ? this.#toString\n      : !this.type ?\n        (this.#toString = this.#parts.map(p => String(p)).join(''))\n      : (this.#toString =\n          this.type +\n          '(' +\n          this.#parts.map(p => String(p)).join('|') +\n          ')')\n    )\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (\n        typeof p !== 'string' &&\n        !(p instanceof AST && p.#parent === this)\n      ) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: unknown[] =\n      this.type === null ?\n        this.#parts\n          .slice()\n          .map(p => (typeof p === 'string' ? p : p.toJSON()))\n      : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions,\n    extDepth: number,\n  ): number {\n    const maxDepth = opt.maxExtglobRecursion ?? 2\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        // we don't have to check for adoption here, because that's\n        // done at the other recursion point.\n        const doRecurse =\n          !opt.noext &&\n          isExtglobType(c) &&\n          str.charAt(i) === '(' &&\n          extDepth <= maxDepth\n        if (doRecurse) {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      const doRecurse =\n        !opt.noext &&\n        isExtglobType(c) &&\n        str.charAt(i) === '(' &&\n        /* c8 ignore start - the maxDepth is sufficient here */\n        (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n      /* c8 ignore stop */\n      if (doRecurse) {\n        const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  #canAdoptWithSpace(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    return this.#canAdopt(child, adoptionWithSpaceMap)\n  }\n\n  #canAdopt(\n    child?: AST | string,\n    map: Map = adoptionMap,\n  ): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canAdoptType(\n      gc.type,\n      map,\n    )\n  }\n  #canAdoptType(\n    c: string,\n    map: Map = adoptionAnyMap,\n  ): c is ExtglobType {\n    return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n  }\n\n  #adoptWithSpace(\n    this: AST & { type: ExtglobType },\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const blank = new AST(null, gc, this.options)\n    blank.#parts.push('')\n    gc.push(blank)\n    this.#adopt(child, index)\n  }\n\n  #adopt(\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    this.#parts.splice(index, 1, ...gc.#parts)\n    for (const p of gc.#parts) {\n      if (typeof p === 'object') p.#parent = this\n    }\n    this.#toString = undefined\n  }\n\n  #canUsurpType(c: string): boolean {\n    const m = usurpMap.get(this.type as ExtglobType)\n    return !!m?.has(c as ExtglobType)\n  }\n\n  #canUsurp(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null ||\n      this.#parts.length !== 1\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n  }\n\n  #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n    const m = usurpMap.get(this.type as ExtglobType)\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const nt = m?.get(gc.type)\n    /* c8 ignore start - impossible */\n    if (!nt) return false\n    /* c8 ignore stop */\n    this.#parts = gc.#parts\n    for (const p of this.#parts) {\n      if (typeof p === 'object') {\n        p.#parent = this\n      }\n    }\n    this.type = nt\n    this.#toString = undefined\n    this.#emptyExt = false\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options, 0)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) {\n      this.#flatten()\n      this.#fillNegs()\n    }\n    if (!isExtglobAST(this)) {\n      const noEmpty =\n        this.isStart() &&\n        this.isEnd() &&\n        !this.#parts.some(s => typeof s !== 'string')\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string' ?\n              AST.#parseGlob(p, this.#hasMagic, noEmpty)\n            : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start =\n              needNoTrav ? startNoTraversal\n              : needNoDot ? startNoDot\n              : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      const me = this as AST\n      me.#parts = [s]\n      me.type = null\n      me.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot ?\n        ''\n      : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!' ?\n          // !() must match something,but !(x) can match ''\n          '))' +\n          (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n          star +\n          ')'\n        : this.type === '@' ? ')'\n        : this.type === '?' ? ')?'\n        : this.type === '+' && bodyDotAllowed ? ')'\n        : this.type === '*' && bodyDotAllowed ? `)?`\n        : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #flatten() {\n    if (!isExtglobAST(this)) {\n      for (const p of this.#parts) {\n        if (typeof p === 'object') {\n          p.#flatten()\n        }\n      }\n    } else {\n      // do up to 10 passes to flatten as much as possible\n      let iterations = 0\n      let done = false\n      do {\n        done = true\n        for (let i = 0; i < this.#parts.length; i++) {\n          const c = this.#parts[i]\n          if (typeof c === 'object') {\n            c.#flatten()\n            if (this.#canAdopt(c)) {\n              done = false\n              this.#adopt(c, i)\n            } else if (this.#canAdoptWithSpace(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n            } else if (this.#canUsurp(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#usurp(c)\n            }\n          }\n        }\n      } while (!done && ++iterations < 10)\n    }\n    this.#toString = undefined\n  }\n\n  #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    // multiple stars that aren't globstars coalesce into one *\n    let inStar = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '*') {\n        if (inStar) continue\n        inStar = true\n        re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n        hasMagic = true\n        continue\n      } else {\n        inStar = false\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b1572deb95e2e376474f9fc1e56e4c38a055fbd1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts
@@ -0,0 +1,8 @@
+export type ParseClassResult = [
+    src: string,
+    uFlag: boolean,
+    consumed: number,
+    hasMagic: boolean
+];
+export declare const parseClass: (glob: string, position: number) => ParseClassResult;
+//# sourceMappingURL=brace-expressions.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09b4c11060de7850a23ad17948c7d5d674850576
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b49d40bd74210708c8afdee944010ca1023fb83
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js
@@ -0,0 +1,146 @@
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
+};
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+export const parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
+};
+//# sourceMappingURL=brace-expressions.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..184b5a89c11f4cc9705018a2b11a36cd7acacf02
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/brace-expressions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wCAAwC;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;CACnC,CAAA;AAEH,+DAA+D;AAC/D,mBAAmB;AACnB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACjE,qCAAqC;AACrC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC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C;QACjB,MAAM,CAAC,MAAM,KAAK,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,MAAM,EACP,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n  {\n    '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n    '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n    '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n    '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n    '[:cntrl:]': ['\\\\p{Cc}', true],\n    '[:digit:]': ['\\\\p{Nd}', true],\n    '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n    '[:lower:]': ['\\\\p{Ll}', true],\n    '[:print:]': ['\\\\p{C}', true],\n    '[:punct:]': ['\\\\p{P}', true],\n    '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n    '[:upper:]': ['\\\\p{Lu}', true],\n    '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n    '[:xdigit:]': ['A-Fa-f0-9', false],\n  }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number,\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n    : ranges.length ? sranges\n    : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..141024a06bdf747fe6d6ecc48a80675dff795800
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts
@@ -0,0 +1,15 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=escape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e167e30065a04e54a37b3f6e6b44275c42c3c602
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js
new file mode 100644
index 0000000000000000000000000000000000000000..46d0ec8858e5b3a2fdc692dfb6fbe69fb37c4068
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js
@@ -0,0 +1,26 @@
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/[?*()[\]{}]/g, '[$&]')
+            : s.replace(/[?*()[\]\\{}]/g, '\\$&');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..4740508f687a904a44be71d42e0e0bf1438ea215
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/escape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = false,\n  }: Pick = {},\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/[?*()[\\]{}]/g, '[$&]')\n      : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7e1fc2edaadbe09033faefbd7363f0cba109bafc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts
@@ -0,0 +1,174 @@
+import { AST } from './ast.js';
+export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
+export interface MinimatchOptions {
+    /** do not expand `{x,y}` style braces */
+    nobrace?: boolean;
+    /** do not treat patterns starting with `#` as a comment */
+    nocomment?: boolean;
+    /** do not treat patterns starting with `!` as a negation */
+    nonegate?: boolean;
+    /** print LOTS of debugging output */
+    debug?: boolean;
+    /** treat `**` the same as `*` */
+    noglobstar?: boolean;
+    /** do not expand extglobs like `+(a|b)` */
+    noext?: boolean;
+    /** return the pattern if nothing matches */
+    nonull?: boolean;
+    /** treat `\\` as a path separator, not an escape character */
+    windowsPathsNoEscape?: boolean;
+    /**
+     * inverse of {@link MinimatchOptions.windowsPathsNoEscape}
+     * @deprecated
+     */
+    allowWindowsEscape?: boolean;
+    /**
+     * Compare a partial path to a pattern. As long as the parts
+     * of the path that are present are not contradicted by the
+     * pattern, it will be treated as a match. This is useful in
+     * applications where you're walking through a folder structure,
+     * and don't yet have the full path, but want to ensure that you
+     * do not walk down paths that can never be a match.
+     */
+    partial?: boolean;
+    /** allow matches that start with `.` even if the pattern does not */
+    dot?: boolean;
+    /** ignore case */
+    nocase?: boolean;
+    /** ignore case only in wildcard patterns */
+    nocaseMagicOnly?: boolean;
+    /** consider braces to be "magic" for the purpose of `hasMagic` */
+    magicalBraces?: boolean;
+    /**
+     * If set, then patterns without slashes will be matched
+     * against the basename of the path if it contains slashes.
+     * For example, `a?b` would match the path `/xyz/123/acb`, but
+     * not `/xyz/acb/123`.
+     */
+    matchBase?: boolean;
+    /** invert the results of negated matches */
+    flipNegate?: boolean;
+    /** do not collapse multiple `/` into a single `/` */
+    preserveMultipleSlashes?: boolean;
+    /**
+     * A number indicating the level of optimization that should be done
+     * to the pattern prior to parsing and using it for matches.
+     */
+    optimizationLevel?: number;
+    /** operating system platform */
+    platform?: Platform;
+    /**
+     * When a pattern starts with a UNC path or drive letter, and in
+     * `nocase:true` mode, do not convert the root portions of the
+     * pattern into a case-insensitive regular expression, and instead
+     * leave them as strings.
+     *
+     * This is the default when the platform is `win32` and
+     * `nocase:true` is set.
+     */
+    windowsNoMagicRoot?: boolean;
+    /**
+     * max number of `{...}` patterns to expand. Default 100_000.
+     */
+    braceExpandMax?: number;
+    /**
+     * Max number of non-adjacent `**` patterns to recursively walk down.
+     *
+     * The default of 200 is almost certainly high enough for most purposes,
+     * and can handle absurdly excessive patterns.
+     */
+    maxGlobstarRecursion?: number;
+    /**
+     * Max depth to traverse for nested extglobs like `*(a|b|c)`
+     *
+     * Default is 2, which is quite low, but any higher value
+     * swiftly results in punishing performance impacts. Note
+     * that this is *not*  relevant when the globstar types can
+     * be safely coalesced into a single set.
+     *
+     * For example, `*(a|@(b|c)|d)` would be flattened into
+     * `*(a|b|c|d)`. Thus, many common extglobs will retain good
+     * performance and  never hit this limit, even if they are
+     * excessively deep and complicated.
+     *
+     * If the limit is hit, then the extglob characters are simply
+     * not parsed, and the pattern effectively switches into
+     * `noextglob: true` mode for the contents of that nested
+     * sub-pattern. This will typically _not_ result in a match,
+     * but is considered a valid trade-off for security and
+     * performance.
+     */
+    maxExtglobRecursion?: number;
+}
+export declare const minimatch: {
+    (p: string, pattern: string, options?: MinimatchOptions): boolean;
+    sep: Sep;
+    GLOBSTAR: typeof GLOBSTAR;
+    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+    defaults: (def: MinimatchOptions) => typeof minimatch;
+    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+    AST: typeof AST;
+    Minimatch: typeof Minimatch;
+    escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+    unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+};
+export type Sep = '\\' | '/';
+export declare const sep: Sep;
+export declare const GLOBSTAR: unique symbol;
+export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
+export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+export type MMRegExp = RegExp & {
+    _src?: string;
+    _glob?: string;
+};
+export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
+export type ParseReturn = ParseReturnFiltered | false;
+export declare class Minimatch {
+    #private;
+    options: MinimatchOptions;
+    set: ParseReturnFiltered[][];
+    pattern: string;
+    windowsPathsNoEscape: boolean;
+    nonegate: boolean;
+    negate: boolean;
+    comment: boolean;
+    empty: boolean;
+    preserveMultipleSlashes: boolean;
+    partial: boolean;
+    globSet: string[];
+    globParts: string[][];
+    nocase: boolean;
+    isWindows: boolean;
+    platform: Platform;
+    windowsNoMagicRoot: boolean;
+    maxGlobstarRecursion: number;
+    regexp: false | null | MMRegExp;
+    constructor(pattern: string, options?: MinimatchOptions);
+    hasMagic(): boolean;
+    debug(..._: unknown[]): void;
+    make(): void;
+    preprocess(globParts: string[][]): string[][];
+    adjascentGlobstarOptimize(globParts: string[][]): string[][];
+    levelOneOptimize(globParts: string[][]): string[][];
+    levelTwoFileOptimize(parts: string | string[]): string[];
+    firstPhasePreProcess(globParts: string[][]): string[][];
+    secondPhasePreProcess(globParts: string[][]): string[][];
+    partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
+    parseNegate(): void;
+    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
+    braceExpand(): string[];
+    parse(pattern: string): ParseReturn;
+    makeRe(): false | MMRegExp;
+    slashSplit(p: string): string[];
+    match(f: string, partial?: boolean): boolean;
+    static defaults(def: MinimatchOptions): typeof Minimatch;
+}
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7620db91cc81855821dded14c51fdfe9b0cd1d6a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB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AAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a5e6fa88fdc6d6ec05d26ab4975718824cbc8bdc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js
@@ -0,0 +1,1114 @@
+import { expand } from 'brace-expansion';
+import { assertValidPattern } from './assert-valid-pattern.js';
+import { AST } from './ast.js';
+import { escape } from './escape.js';
+import { unescape } from './unescape.js';
+export const minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process ?
+    (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
+minimatch.sep = sep;
+export const GLOBSTAR = Symbol('globstar **');
+minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
+minimatch.filter = filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+export const defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return minimatch;
+    }
+    const orig = minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+minimatch.defaults = defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+export const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return expand(pattern, { max: options.braceExpandMax });
+};
+minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+minimatch.makeRe = makeRe;
+export const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+export class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    maxGlobstarRecursion;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        // avoid the annoying deprecation flag lol
+        const awe = ('allowWindow' + 'sEscape');
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options[awe] === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined ?
+                options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            //oxlint-disable-next-line no-console
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [
+                        ...s.slice(0, 4),
+                        ...s.slice(4).map(ss => this.parse(ss)),
+                    ];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn ** into *
+        if (this.options.noglobstar) {
+            for (const partset of globParts) {
+                for (let j = 0; j < partset.length; j++) {
+                    if (partset[j] === '**') {
+                        partset[j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            // just collapse multiple ** portions into one
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === GLOBSTAR ? GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape;
+minimatch.unescape = unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..431b3a15a00c29459ae73326910924b895e61885
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3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AA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,oBAAoB;AACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AACnB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AACzB,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c4a14473afc706260b914e947fbb636680ddf43f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09d6eab4e6502cde5495bf5ea51637d6db86999c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js
new file mode 100644
index 0000000000000000000000000000000000000000..19ce86e7c86052265346584cd65e620cf2fcb377
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js
@@ -0,0 +1,34 @@
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js.map b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..6d507391171b5f7ccb04fd8da59e829d2715c260
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/dist/esm/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/minimatch/package.json b/tools/ui/node_modules/workbox-build/node_modules/minimatch/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..211875c62b724978194945224d6d845c48d44955
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/minimatch/package.json
@@ -0,0 +1,73 @@
+{
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "10.2.5",
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:isaacs/minimatch"
+  },
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write .",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
+    "lint": "oxlint --fix src test",
+    "postsnap": "npm run lint",
+    "postlint": "npm run format"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "devDependencies": {
+    "@types/node": "^25.5.0",
+    "mkdirp": "^3.0.1",
+    "oxlint": "^1.57.0",
+    "oxlint-tsgolint": "^0.18.1",
+    "prettier": "^3.8.1",
+    "tap": "^21.6.2",
+    "tshy": "^4.0.0",
+    "typedoc": "^0.28.18"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "license": "BlueOak-1.0.0",
+  "tshy": {
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    },
+    "selfLink": false
+  },
+  "type": "module",
+  "module": "./dist/esm/index.js",
+  "dependencies": {
+    "brace-expansion": "^5.0.5"
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/LICENSE.md b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..c5402b9577a8cdd966c0974e5b74cc7b85f536c5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/LICENSE.md
@@ -0,0 +1,55 @@
+# Blue Oak Model License
+
+Version 1.0.0
+
+## Purpose
+
+This license gives everyone as much permission to work with
+this software as possible, while protecting contributors
+from liability.
+
+## Acceptance
+
+In order to receive this license, you must agree to its
+rules.  The rules of this license are both obligations
+under that agreement and conditions to your license.
+You must not do anything with this software that triggers
+a rule that you cannot or will not follow.
+
+## Copyright
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe that contributor's
+copyright in it.
+
+## Notices
+
+You must ensure that everyone who gets a copy of
+any part of this software from you, with or without
+changes, also gets the text of this license or a link to
+.
+
+## Excuse
+
+If anyone notifies you in writing that you have not
+complied with [Notices](#notices), you can keep your
+license by taking all practical steps to comply within 30
+days after the notice.  If you do not do so, your license
+ends immediately.
+
+## Patent
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe any patent claims
+they can license or become able to license.
+
+## Reliability
+
+No contributor can revoke this license.
+
+## No Liability
+
+***As far as the law allows, this software comes as is,
+without any warranty or condition, and no contributor
+will be liable to anyone for any damages related to this
+software or this license, under any kind of legal claim.***
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/README.md b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..b5cb495c0bf3c8fca0063d58f2ec909356b2e470
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/README.md
@@ -0,0 +1,636 @@
+# path-scurry
+
+Extremely high performant utility for building tools that read
+the file system, minimizing filesystem and path string munging
+operations to the greatest degree possible.
+
+## Ugh, yet another file traversal thing on npm?
+
+Yes. None of the existing ones gave me exactly what I wanted.
+
+## Well what is it you wanted?
+
+While working on [glob](http://npm.im/glob), I found that I
+needed a module to very efficiently manage the traversal over a
+folder tree, such that:
+
+1. No `readdir()` or `stat()` would ever be called on the same
+   file or directory more than one time.
+2. No `readdir()` calls would be made if we can be reasonably
+   sure that the path is not a directory. (Ie, a previous
+   `readdir()` or `stat()` covered the path, and
+   `ent.isDirectory()` is false.)
+3. `path.resolve()`, `dirname()`, `basename()`, and other
+   string-parsing/munging operations are be minimized. This means
+   it has to track "provisional" child nodes that may not exist
+   (and if we find that they _don't_ exist, store that
+   information as well, so we don't have to ever check again).
+4. The API is not limited to use as a stream/iterator/etc. There
+   are many cases where an API like node's `fs` is preferrable.
+5. It's more important to prevent excess syscalls than to be up
+   to date, but it should be smart enough to know what it
+   _doesn't_ know, and go get it seamlessly when requested.
+6. Do not blow up the JS heap allocation if operating on a
+   directory with a huge number of entries.
+7. Handle all the weird aspects of Windows paths, like UNC paths
+   and drive letters and wrongway slashes, so that the consumer
+   can return canonical platform-specific paths without having to
+   parse or join or do any error-prone string munging.
+
+## PERFORMANCE
+
+JavaScript people throw around the word "blazing" a lot. I hope
+that this module doesn't blaze anyone. But it does go very fast,
+in the cases it's optimized for, if used properly.
+
+PathScurry provides ample opportunities to get extremely good
+performance, as well as several options to trade performance for
+convenience.
+
+Benchmarks can be run by executing `npm run bench`.
+
+As is always the case, doing more means going slower, doing less
+means going faster, and there are trade offs between speed and
+memory usage.
+
+PathScurry makes heavy use of [LRUCache](http://npm.im/lru-cache)
+to efficiently cache whatever it can, and `Path` objects remain
+in the graph for the lifetime of the walker, so repeated calls
+with a single PathScurry object will be extremely fast. However,
+adding items to a cold cache means "doing more", so in those
+cases, we pay a price. Nothing is free, but every effort has been
+made to reduce costs wherever possible.
+
+Also, note that a "cache as long as possible" approach means that
+changes to the filesystem may not be reflected in the results of
+repeated PathScurry operations.
+
+For resolving string paths, `PathScurry` ranges from 5-50 times
+faster than `path.resolve` on repeated resolutions, but around
+100 to 1000 times _slower_ on the first resolution. If your
+program is spending a lot of time resolving the _same_ paths
+repeatedly (like, thousands or millions of times), then this can
+be beneficial. But both implementations are pretty fast, and
+speeding up an infrequent operation from 4µs to 400ns is not
+going to move the needle on your app's performance.
+
+For walking file system directory trees, a lot depends on how
+often a given PathScurry object will be used, and also on the
+walk method used.
+
+With default settings on a folder tree of 100,000 items,
+consisting of around a 10-to-1 ratio of normal files to
+directories, PathScurry performs comparably to
+[@nodelib/fs.walk](http://npm.im/@nodelib/fs.walk), which is the
+fastest and most reliable file system walker I could find. As far
+as I can tell, it's almost impossible to go much faster in a
+Node.js program, just based on how fast you can push syscalls out
+to the fs thread pool.
+
+On my machine, that is about 1000-1200 completed walks per second
+for async or stream walks, and around 500-600 walks per second
+synchronously.
+
+In the warm cache state, PathScurry's performance increases
+around 4x for async `for await` iteration, 10-15x faster for
+streams and synchronous `for of` iteration, and anywhere from 30x
+to 80x faster for the rest.
+
+```
+# walk 100,000 fs entries, 10/1 file/dir ratio
+# operations / ms
+ New PathScurry object  |  Reuse PathScurry object
+     stream:  1112.589  |  13974.917
+sync stream:   492.718  |  15028.343
+ async walk:  1095.648  |  32706.395
+  sync walk:   527.632  |  46129.772
+ async iter:  1288.821  |   5045.510
+  sync iter:   498.496  |  17920.746
+```
+
+A hand-rolled walk calling `entry.readdir()` and recursing
+through the entries can benefit even more from caching, with
+greater flexibility and without the overhead of streams or
+generators.
+
+The cold cache state is still limited by the costs of file system
+operations, but with a warm cache, the only bottleneck is CPU
+speed and VM optimizations. Of course, in that case, some care
+must be taken to ensure that you don't lose performance as a
+result of silly mistakes, like calling `readdir()` on entries
+that you know are not directories.
+
+```
+# manual recursive iteration functions
+      cold cache  |  warm cache
+async:  1164.901  |  17923.320
+   cb:  1101.127  |  40999.344
+zalgo:  1082.240  |  66689.936
+ sync:   526.935  |  87097.591
+```
+
+In this case, the speed improves by around 10-20x in the async
+case, 40x in the case of using `entry.readdirCB` with protections
+against synchronous callbacks, and 50-100x with callback
+deferrals disabled, and _several hundred times faster_ for
+synchronous iteration.
+
+If you can think of a case that is not covered in these
+benchmarks, or an implementation that performs significantly
+better than PathScurry, please [let me
+know](https://github.com/isaacs/path-scurry/issues).
+
+## USAGE
+
+```ts
+// hybrid module, load with either method
+import { PathScurry, Path } from 'path-scurry'
+// or:
+const { PathScurry, Path } = require('path-scurry')
+
+// very simple example, say we want to find and
+// delete all the .DS_Store files in a given path
+// note that the API is very similar to just a
+// naive walk with fs.readdir()
+import { unlink } from 'fs/promises'
+
+// easy way, iterate over the directory and do the thing
+const pw = new PathScurry(process.cwd())
+for await (const entry of pw) {
+  if (entry.isFile() && entry.name === '.DS_Store') {
+    unlink(entry.fullpath())
+  }
+}
+
+// here it is as a manual recursive method
+const walk = async (entry: Path) => {
+  const promises: Promise = []
+  // readdir doesn't throw on non-directories, it just doesn't
+  // return any entries, to save stack trace costs.
+  // Items are returned in arbitrary unsorted order
+  for (const child of await pw.readdir(entry)) {
+    // each child is a Path object
+    if (child.name === '.DS_Store' && child.isFile()) {
+      // could also do pw.resolve(entry, child.name),
+      // just like fs.readdir walking, but .fullpath is
+      // a *slightly* more efficient shorthand.
+      promises.push(unlink(child.fullpath()))
+    } else if (child.isDirectory()) {
+      promises.push(walk(child))
+    }
+  }
+  return Promise.all(promises)
+}
+
+walk(pw.cwd).then(() => {
+  console.log('all .DS_Store files removed')
+})
+
+const pw2 = new PathScurry('/a/b/c') // pw2.cwd is the Path for /a/b/c
+const relativeDir = pw2.cwd.resolve('../x') // Path entry for '/a/b/x'
+const relative2 = pw2.cwd.resolve('/a/b/d/../x') // same path, same entry
+assert.equal(relativeDir, relative2)
+```
+
+## API
+
+[Full TypeDoc API](https://isaacs.github.io/path-scurry)
+
+There are platform-specific classes exported, but for the most
+part, the default `PathScurry` and `Path` exports are what you
+most likely need, unless you are testing behavior for other
+platforms.
+
+Intended public API is documented here, but the full
+documentation does include internal types, which should not be
+accessed directly.
+
+### Interface `PathScurryOpts`
+
+The type of the `options` argument passed to the `PathScurry`
+constructor.
+
+- `nocase`: Boolean indicating that file names should be compared
+  case-insensitively. Defaults to `true` on darwin and win32
+  implementations, `false` elsewhere.
+
+  **Warning** Performing case-insensitive matching on a
+  case-sensitive filesystem will result in occasionally very
+  bizarre behavior. Performing case-sensitive matching on a
+  case-insensitive filesystem may negatively impact performance.
+
+- `childrenCacheSize`: Number of child entries to cache, in order
+  to speed up `resolve()` and `readdir()` calls. Defaults to
+  `16 * 1024` (ie, `16384`).
+
+  Setting it to a higher value will run the risk of JS heap
+  allocation errors on large directory trees. Setting it to `256`
+  or smaller will significantly reduce the construction time and
+  data consumption overhead, but with the downside of operations
+  being slower on large directory trees. Setting it to `0` will
+  mean that effectively no operations are cached, and this module
+  will be roughly the same speed as `fs` for file system
+  operations, and _much_ slower than `path.resolve()` for
+  repeated path resolution.
+
+- `fs` An object that will be used to override the default `fs`
+  methods. Any methods that are not overridden will use Node's
+  built-in implementations.
+
+  - lstatSync
+  - readdir (callback `withFileTypes` Dirent variant, used for
+    readdirCB and most walks)
+  - readdirSync
+  - readlinkSync
+  - realpathSync
+  - promises: Object containing the following async methods:
+    - lstat
+    - readdir (Dirent variant only)
+    - readlink
+    - realpath
+
+### Interface `WalkOptions`
+
+The options object that may be passed to all walk methods.
+
+- `withFileTypes`: Boolean, default true. Indicates that `Path`
+  objects should be returned. Set to `false` to get string paths
+  instead.
+- `follow`: Boolean, default false. Attempt to read directory
+  entries from symbolic links. Otherwise, only actual directories
+  are traversed. Regardless of this setting, a given target path
+  will only ever be walked once, meaning that a symbolic link to
+  a previously traversed directory will never be followed.
+
+  Setting this imposes a slight performance penalty, because
+  `readlink` must be called on all symbolic links encountered, in
+  order to avoid infinite cycles.
+
+- `filter`: Function `(entry: Path) => boolean`. If provided,
+  will prevent the inclusion of any entry for which it returns a
+  falsey value. This will not prevent directories from being
+  traversed if they do not pass the filter, though it will
+  prevent the directories themselves from being included in the
+  results. By default, if no filter is provided, then all entries
+  are included in the results.
+- `walkFilter`: Function `(entry: Path) => boolean`. If provided,
+  will prevent the traversal of any directory (or in the case of
+  `follow:true` symbolic links to directories) for which the
+  function returns false. This will not prevent the directories
+  themselves from being included in the result set. Use `filter`
+  for that.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+### Class `PathScurry`
+
+The main interface. Defaults to an appropriate class based on the
+current platform.
+
+Use `PathScurryWin32`, `PathScurryDarwin`, or `PathScurryPosix`
+if implementation-specific behavior is desired.
+
+All walk methods may be called with a `WalkOptions` argument to
+walk over the object's current working directory with the
+supplied options.
+
+#### `async pw.walk(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Walk the directory tree according to the options provided,
+resolving to an array of all entries found.
+
+#### `pw.walkSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Walk the directory tree according to the options provided,
+returning an array of all entries found.
+
+#### `pw.iterate(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Iterate over the directory asynchronously, for use with `for
+await of`. This is also the default async iterator method.
+
+#### `pw.iterateSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Iterate over the directory synchronously, for use with `for of`.
+This is also the default sync iterator method.
+
+#### `pw.stream(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Return a [Minipass](http://npm.im/minipass) stream that emits
+each entry or path string in the walk. Results are made available
+asynchronously.
+
+#### `pw.streamSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Return a [Minipass](http://npm.im/minipass) stream that emits
+each entry or path string in the walk. Results are made available
+synchronously, meaning that the walk will complete in a single
+tick if the stream is fully consumed.
+
+#### `pw.cwd`
+
+Path object representing the current working directory for the
+PathScurry.
+
+#### `pw.chdir(path: string)`
+
+Set the new effective current working directory for the scurry
+object, so that `path.relative()` and `path.relativePosix()`
+return values relative to the new cwd path.
+
+#### `pw.depth(path?: Path | string): number`
+
+Return the depth of the specified path (or the PathScurry cwd)
+within the directory tree.
+
+Root entries have a depth of `0`.
+
+#### `pw.resolve(...paths: string[])`
+
+Caching `path.resolve()`.
+
+Significantly faster than `path.resolve()` if called repeatedly
+with the same paths. Significantly slower otherwise, as it builds
+out the cached Path entries.
+
+To get a `Path` object resolved from the `PathScurry`, use
+`pw.cwd.resolve(path)`. Note that `Path.resolve` only takes a
+single string argument, not multiple.
+
+#### `pw.resolvePosix(...paths: string[])`
+
+Caching `path.resolve()`, but always using posix style paths.
+
+This is identical to `pw.resolve(...paths)` on posix systems (ie,
+everywhere except Windows).
+
+On Windows, it returns the full absolute UNC path using `/`
+separators. Ie, instead of `'C:\\foo\\bar`, it would return
+`//?/C:/foo/bar`.
+
+#### `pw.relative(path: string | Path): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+#### `pw.relativePosix(path: string | Path): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry, using `/` path separators.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+On posix platforms (ie, all platforms except Windows), this is
+identical to `pw.relative(path)`.
+
+On Windows systems, it returns the resulting string as a
+`/`-delimited path. If an absolute path is returned (because the
+target does not share a common ancestor with `pw.cwd`), then a
+full absolute UNC path will be returned. Ie, instead of
+`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`.
+
+#### `pw.basename(path: string | Path): string`
+
+Return the basename of the provided string or Path.
+
+#### `pw.dirname(path: string | Path): string`
+
+Return the parent directory of the supplied string or Path.
+
+#### `async pw.readdir(dir = pw.cwd, opts = { withFileTypes: true })`
+
+Read the directory and resolve to an array of strings if
+`withFileTypes` is explicitly set to `false` or Path objects
+otherwise.
+
+Can be called as `pw.readdir({ withFileTypes: boolean })` as
+well.
+
+Returns `[]` if no entries are found, or if any error occurs.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+#### `pw.readdirSync(dir = pw.cwd, opts = { withFileTypes: true })`
+
+Synchronous `pw.readdir()`
+
+#### `async pw.readlink(link = pw.cwd, opts = { withFileTypes: false })`
+
+Call `fs.readlink` on the supplied string or Path object, and
+return the result.
+
+Can be called as `pw.readlink({ withFileTypes: boolean })` as
+well.
+
+Returns `undefined` if any error occurs (for example, if the
+argument is not a symbolic link), or a `Path` object if
+`withFileTypes` is explicitly set to `true`, or a string
+otherwise.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+#### `pw.readlinkSync(link = pw.cwd, opts = { withFileTypes: false })`
+
+Synchronous `pw.readlink()`
+
+#### `async pw.lstat(entry = pw.cwd)`
+
+Call `fs.lstat` on the supplied string or Path object, and fill
+in as much information as possible, returning the updated `Path`
+object.
+
+Returns `undefined` if the entry does not exist, or if any error
+is encountered.
+
+Note that some `Stats` data (such as `ino`, `dev`, and `mode`)
+will not be supplied. For those things, you'll need to call
+`fs.lstat` yourself.
+
+#### `pw.lstatSync(entry = pw.cwd)`
+
+Synchronous `pw.lstat()`
+
+#### `pw.realpath(entry = pw.cwd, opts = { withFileTypes: false })`
+
+Call `fs.realpath` on the supplied string or Path object, and
+return the realpath if available.
+
+Returns `undefined` if any error occurs.
+
+May be called as `pw.realpath({ withFileTypes: boolean })` to run
+on `pw.cwd`.
+
+#### `pw.realpathSync(entry = pw.cwd, opts = { withFileTypes: false })`
+
+Synchronous `pw.realpath()`
+
+### Class `Path` implements [fs.Dirent](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent)
+
+Object representing a given path on the filesystem, which may or
+may not exist.
+
+Note that the actual class in use will be either `PathWin32` or
+`PathPosix`, depending on the implementation of `PathScurry` in
+use. They differ in the separators used to split and join path
+strings, and the handling of root paths.
+
+In `PathPosix` implementations, paths are split and joined using
+the `'/'` character, and `'/'` is the only root path ever in use.
+
+In `PathWin32` implementations, paths are split using either
+`'/'` or `'\\'` and joined using `'\\'`, and multiple roots may
+be in use based on the drives and UNC paths encountered. UNC
+paths such as `//?/C:/` that identify a drive letter, will be
+treated as an alias for the same root entry as their associated
+drive letter (in this case `'C:\\'`).
+
+#### `path.name`
+
+Name of this file system entry.
+
+**Important**: _always_ test the path name against any test
+string using the `isNamed` method, and not by directly comparing
+this string. Otherwise, unicode path strings that the system sees
+as identical will not be properly treated as the same path,
+leading to incorrect behavior and possible security issues.
+
+#### `path.isNamed(name: string): boolean`
+
+Return true if the path is a match for the given path name. This
+handles case sensitivity and unicode normalization.
+
+Note: even on case-sensitive systems, it is **not** safe to test
+the equality of the `.name` property to determine whether a given
+pathname matches, due to unicode normalization mismatches.
+
+Always use this method instead of testing the `path.name`
+property directly.
+
+#### `path.isCWD`
+
+Set to true if this `Path` object is the current working
+directory of the `PathScurry` collection that contains it.
+
+#### `path.getType()`
+
+Returns the type of the Path object, `'File'`, `'Directory'`,
+etc.
+
+#### `path.isType(t: type)`
+
+Returns true if `is{t}()` returns true.
+
+For example, `path.isType('Directory')` is equivalent to
+`path.isDirectory()`.
+
+#### `path.depth()`
+
+Return the depth of the Path entry within the directory tree.
+Root paths have a depth of `0`.
+
+#### `path.fullpath()`
+
+The fully resolved path to the entry.
+
+#### `path.fullpathPosix()`
+
+The fully resolved path to the entry, using `/` separators.
+
+On posix systems, this is identical to `path.fullpath()`. On
+windows, this will return a fully resolved absolute UNC path
+using `/` separators. Eg, instead of `'C:\\foo\\bar'`, it will
+return `'//?/C:/foo/bar'`.
+
+#### `path.isFile()`, `path.isDirectory()`, etc.
+
+Same as the identical `fs.Dirent.isX()` methods.
+
+#### `path.isUnknown()`
+
+Returns true if the path's type is unknown. Always returns true
+when the path is known to not exist.
+
+#### `path.resolve(p: string)`
+
+Return a `Path` object associated with the provided path string
+as resolved from the current Path object.
+
+#### `path.relative(): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+#### `path.relativePosix(): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry, using `/` path separators.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+On posix platforms (ie, all platforms except Windows), this is
+identical to `pw.relative(path)`.
+
+On Windows systems, it returns the resulting string as a
+`/`-delimited path. If an absolute path is returned (because the
+target does not share a common ancestor with `pw.cwd`), then a
+full absolute UNC path will be returned. Ie, instead of
+`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`.
+
+#### `async path.readdir()`
+
+Return an array of `Path` objects found by reading the associated
+path entry.
+
+If path is not a directory, or if any error occurs, returns `[]`,
+and marks all children as provisional and non-existent.
+
+#### `path.readdirSync()`
+
+Synchronous `path.readdir()`
+
+#### `async path.readlink()`
+
+Return the `Path` object referenced by the `path` as a symbolic
+link.
+
+If the `path` is not a symbolic link, or any error occurs,
+returns `undefined`.
+
+#### `path.readlinkSync()`
+
+Synchronous `path.readlink()`
+
+#### `async path.lstat()`
+
+Call `lstat` on the path object, and fill it in with details
+determined.
+
+If path does not exist, or any other error occurs, returns
+`undefined`, and marks the path as "unknown" type.
+
+#### `path.lstatSync()`
+
+Synchronous `path.lstat()`
+
+#### `async path.realpath()`
+
+Call `realpath` on the path, and return a Path object
+corresponding to the result, or `undefined` if any error occurs.
+
+#### `path.realpathSync()`
+
+Synchornous `path.realpath()`
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ef31b1b7716f6c9ae8127045dfa5cd87f6a076e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts
@@ -0,0 +1,1115 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { Minipass } from 'minipass';
+import type { Dirent, Stats } from 'node:fs';
+/**
+ * An object that will be used to override the default `fs`
+ * methods.  Any methods that are not overridden will use Node's
+ * built-in implementations.
+ *
+ * - lstatSync
+ * - readdir (callback `withFileTypes` Dirent variant, used for
+ *   readdirCB and most walks)
+ * - readdirSync
+ * - readlinkSync
+ * - realpathSync
+ * - promises: Object containing the following async methods:
+ *   - lstat
+ *   - readdir (Dirent variant only)
+ *   - readlink
+ *   - realpath
+ */
+export interface FSOption {
+    lstatSync?: (path: string) => Stats;
+    readdir?: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync?: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync?: (path: string) => string;
+    realpathSync?: (path: string) => string;
+    promises?: {
+        lstat?: (path: string) => Promise;
+        readdir?: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink?: (path: string) => Promise;
+        realpath?: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+interface FSValue {
+    lstatSync: (path: string) => Stats;
+    readdir: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync: (path: string) => string;
+    realpathSync: (path: string) => string;
+    promises: {
+        lstat: (path: string) => Promise;
+        readdir: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink: (path: string) => Promise;
+        realpath: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket';
+/**
+ * Options that may be provided to the Path constructor
+ */
+export interface PathOpts {
+    fullpath?: string;
+    relative?: string;
+    relativePosix?: string;
+    parent?: PathBase;
+    /**
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export declare class ResolveCache extends LRUCache {
+    constructor();
+}
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export declare class ChildrenCache extends LRUCache {
+    constructor(maxSize?: number);
+}
+/**
+ * Array of Path objects, plus a marker indicating the first provisional entry
+ *
+ * @internal
+ */
+export type Children = PathBase[] & {
+    provisional: number;
+};
+declare const setAsCwd: unique symbol;
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export declare abstract class PathBase implements Dirent {
+    #private;
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name: string;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root: PathBase;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent?: PathBase;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase: boolean;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD: boolean;
+    /**
+     * the string or regexp used to split paths. On posix, it is `'/'`, and on
+     * windows it is a RegExp matching either `'/'` or `'\\'`
+     */
+    abstract splitSep: string | RegExp;
+    /**
+     * The path separator string to use when joining paths
+     */
+    abstract sep: string;
+    get dev(): number | undefined;
+    get mode(): number | undefined;
+    get nlink(): number | undefined;
+    get uid(): number | undefined;
+    get gid(): number | undefined;
+    get rdev(): number | undefined;
+    get blksize(): number | undefined;
+    get ino(): number | undefined;
+    get size(): number | undefined;
+    get blocks(): number | undefined;
+    get atimeMs(): number | undefined;
+    get mtimeMs(): number | undefined;
+    get ctimeMs(): number | undefined;
+    get birthtimeMs(): number | undefined;
+    get atime(): Date | undefined;
+    get mtime(): Date | undefined;
+    get ctime(): Date | undefined;
+    get birthtime(): Date | undefined;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath(): string;
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path(): string;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth(): number;
+    /**
+     * @internal
+     */
+    abstract getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    abstract getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase;
+    /**
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path?: string): PathBase;
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children(): Children;
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart: string, opts?: PathOpts): PathBase;
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative(): string;
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix(): string;
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath(): string;
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix(): string;
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown(): boolean;
+    isType(type: Type): boolean;
+    getType(): Type;
+    /**
+     * Is the Path a regular file?
+     */
+    isFile(): boolean;
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory(): boolean;
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice(): boolean;
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice(): boolean;
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO(): boolean;
+    /**
+     * Is the path a socket?
+     */
+    isSocket(): boolean;
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink(): boolean;
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached(): PathBase | undefined;
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached(): PathBase | undefined;
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached(): PathBase | undefined;
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached(): PathBase[];
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink(): boolean;
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir(): boolean;
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT(): boolean;
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n: string): boolean;
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    readlink(): Promise;
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync(): PathBase | undefined;
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(): Promise;
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync(): PathBase | undefined;
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    readdir(): Promise;
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    canReaddir(): boolean;
+    shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean;
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    realpath(): Promise;
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync(): PathBase | undefined;
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd: PathBase): void;
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export declare class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep: '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep: RegExp;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathWin32;
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    sameRoot(rootPath: string, compare?: string): boolean;
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export declare class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep: '/';
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(_rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathPosix;
+}
+/**
+ * Options that may be provided to the PathScurry constructor
+ */
+export interface PathScurryOpts {
+    /**
+     * perform case-insensitive path matching. Default based on platform
+     * subclass.
+     */
+    nocase?: boolean;
+    /**
+     * Number of Path entries to keep in the cache of Path child references.
+     *
+     * Setting this higher than 65536 will dramatically increase the data
+     * consumption and construction time overhead of each PathScurry.
+     *
+     * Setting this value to 256 or lower will significantly reduce the data
+     * consumption and construction time overhead, but may also reduce resolve()
+     * and readdir() performance on large filesystems.
+     *
+     * Default `16384`.
+     */
+    childrenCacheSize?: number;
+    /**
+     * An object that overrides the built-in functions from the fs and
+     * fs/promises modules.
+     *
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export declare abstract class PathScurryBase {
+    #private;
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root: PathBase;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath: string;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd: PathBase;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase: boolean;
+    /**
+     * The path separator used for parsing paths
+     *
+     * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows
+     */
+    abstract sep: string | RegExp;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd: (URL | string) | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts);
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path?: Path | string): number;
+    /**
+     * Parse the root portion of a path string
+     *
+     * @internal
+     */
+    abstract parseRootPath(dir: string): string;
+    /**
+     * create a new Path to use as root during construction.
+     *
+     * @internal
+     */
+    abstract newRoot(fs: FSValue): PathBase;
+    /**
+     * Determine whether a given path string is absolute
+     */
+    abstract isAbsolute(p: string): boolean;
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths: string[]): string;
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths: string[]): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry?: PathBase | string): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry?: PathBase | string): string;
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry?: PathBase | string): string;
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry?: PathBase | string): string;
+    /**
+     * Return an array of known child entries.
+     *
+     * First argument may be either a string, or a Path object.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set
+     * `{ withFileTypes: false }` to return strings.
+     */
+    readdir(): Promise;
+    readdir(opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    readdir(entry: PathBase | string): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    readdirSync(entry: PathBase | string): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(entry?: string | PathBase): Promise;
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry?: string | PathBase): PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to the target of a
+     * symbolic link.
+     *
+     * If the path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    readlink(): Promise;
+    readlink(opt: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    readlink(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readlink}
+     */
+    readlinkSync(): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    readlinkSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    realpath(): Promise;
+    realpath(opt: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpath(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpathSync(): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    realpathSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Asynchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walk(): Promise;
+    walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(opts: WalkOptions): Promise;
+    walk(entry: string | PathBase): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(entry: string | PathBase, opts: WalkOptions): Promise;
+    /**
+     * Synchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walkSync(): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(opts: WalkOptions): string[] | PathBase[];
+    walkSync(entry: string | PathBase): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[];
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Async generator form of {@link PathScurryBase.walk}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking, especially if most/all of the directory tree has been previously
+     * walked.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    iterate(): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(opts: WalkOptions): AsyncGenerator;
+    iterate(entry: string | PathBase): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator;
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator](): Generator;
+    iterateSync(): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(opts: WalkOptions): Generator;
+    iterateSync(entry: string | PathBase): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptions): Generator;
+    /**
+     * Stream form of {@link PathScurryBase.walk}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     */
+    stream(): Minipass;
+    stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    stream(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(opts: WalkOptions): Minipass;
+    stream(entry: string | PathBase): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    /**
+     * Synchronous form of {@link PathScurryBase.stream}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     *
+     * Will complete the walk in a single tick if the stream is consumed fully.
+     * Otherwise, will pause as needed for stream backpressure.
+     */
+    streamSync(): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(opts: WalkOptions): Minipass;
+    streamSync(entry: string | PathBase): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    chdir(path?: string | Path): void;
+}
+/**
+ * Options provided to all walk methods.
+ */
+export interface WalkOptions {
+    /**
+     * Return results as {@link PathBase} objects rather than strings.
+     * When set to false, results are fully resolved paths, as returned by
+     * {@link PathBase.fullpath}.
+     * @default true
+     */
+    withFileTypes?: boolean;
+    /**
+     *  Attempt to read directory entries from symbolic links. Otherwise, only
+     *  actual directories are traversed. Regardless of this setting, a given
+     *  target path will only ever be walked once, meaning that a symbolic link
+     *  to a previously traversed directory will never be followed.
+     *
+     *  Setting this imposes a slight performance penalty, because `readlink`
+     *  must be called on all symbolic links encountered, in order to avoid
+     *  infinite cycles.
+     * @default false
+     */
+    follow?: boolean;
+    /**
+     * Only return entries where the provided function returns true.
+     *
+     * This will not prevent directories from being traversed, even if they do
+     * not pass the filter, though it will prevent directories themselves from
+     * being included in the result set.  See {@link walkFilter}
+     *
+     * Asynchronous functions are not supported here.
+     *
+     * By default, if no filter is provided, all entries and traversed
+     * directories are included.
+     */
+    filter?: (entry: PathBase) => boolean;
+    /**
+     * Only traverse directories (and in the case of {@link follow} being set to
+     * true, symbolic links to directories) if the provided function returns
+     * true.
+     *
+     * This will not prevent directories from being included in the result set,
+     * even if they do not pass the supplied filter function.  See {@link filter}
+     * to do that.
+     *
+     * Asynchronous functions are not supported here.
+     */
+    walkFilter?: (entry: PathBase) => boolean;
+}
+export type WalkOptionsWithFileTypesUnset = WalkOptions & {
+    withFileTypes?: undefined;
+};
+export type WalkOptionsWithFileTypesTrue = WalkOptions & {
+    withFileTypes: true;
+};
+export type WalkOptionsWithFileTypesFalse = WalkOptions & {
+    withFileTypes: false;
+};
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export declare class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '\\';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathWin32;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(_dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathPosix;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export declare const Path: typeof PathWin32 | typeof PathPosix;
+export type Path = PathBase | InstanceType;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix;
+export type PathScurry = PathScurryBase | InstanceType;
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bf58a3a3ac71919dd09a2165ae355cef7cef57bc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EA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IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAGQ,CAAA;AACnB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..112f732d69a3f547755d47c441537f956bac3e71
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js
@@ -0,0 +1,2018 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0;
+const lru_cache_1 = require("lru-cache");
+const node_path_1 = require("node:path");
+const node_url_1 = require("node:url");
+const fs_1 = require("fs");
+const actualFS = __importStar(require("node:fs"));
+const realpathSync = fs_1.realpathSync.native;
+// TODO: test perf of fs/promises realpath vs realpathCB,
+// since the promises one uses realpath.native
+const promises_1 = require("node:fs/promises");
+const minipass_1 = require("minipass");
+const defaultFS = {
+    lstatSync: fs_1.lstatSync,
+    readdir: fs_1.readdir,
+    readdirSync: fs_1.readdirSync,
+    readlinkSync: fs_1.readlinkSync,
+    realpathSync,
+    promises: {
+        lstat: promises_1.lstat,
+        readdir: promises_1.readdir,
+        readlink: promises_1.readlink,
+        realpath: promises_1.realpath,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+class ResolveCache extends lru_cache_1.LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+exports.ResolveCache = ResolveCache;
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+class ChildrenCache extends lru_cache_1.LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+exports.ChildrenCache = ChildrenCache;
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /* c8 ignore start */
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /* c8 ignore stop */
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+exports.PathBase = PathBase;
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return node_path_1.win32.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+exports.PathWin32 = PathWin32;
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+exports.PathPosix = PathPosix;
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = (0, node_url_1.fileURLToPath)(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new minipass_1.Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new minipass_1.Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+exports.PathScurryBase = PathScurryBase;
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, node_path_1.win32, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return node_path_1.win32.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+exports.PathScurryWin32 = PathScurryWin32;
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, node_path_1.posix, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+exports.PathScurryPosix = PathScurryPosix;
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+exports.PathScurryDarwin = PathScurryDarwin;
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+exports.PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a20f78ada4d2a10d106003bc2d6dc4727f04899f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,yCAAwC;AAExC,uCAAwC;AAExC,2BAMW;AACX,kDAAmC;AAEnC,MAAM,YAAY,GAAG,iBAAG,CAAC,MAAM,CAAA;AAC/B,yDAAyD;AACzD,8CAA8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C;CACF;AARD,4CAQC;AAED;;;;GAIG;AACU,QAAA,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACU,QAAA,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe;IAC9C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n  lstatSync,\n  readdir as readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods.  Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n *   readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n *   - lstat\n *   - readdir (Dirent variant only)\n *   - readlink\n *   - realpath\n */\nexport interface FSOption {\n  lstatSync?: (path: string) => Stats\n  readdir?: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync?: (\n    path: string,\n    options: { withFileTypes: true },\n  ) => Dirent[]\n  readlinkSync?: (path: string) => string\n  realpathSync?: (path: string) => string\n  promises?: {\n    lstat?: (path: string) => Promise\n    readdir?: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink?: (path: string) => Promise\n    realpath?: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\ninterface FSValue {\n  lstatSync: (path: string) => Stats\n  readdir: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n  readlinkSync: (path: string) => string\n  realpathSync: (path: string) => string\n  promises: {\n    lstat: (path: string) => Promise\n    readdir: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink: (path: string) => Promise\n    realpath: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n  lstatSync,\n  readdir: readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync,\n  promises: {\n    lstat,\n    readdir,\n    readlink,\n    realpath,\n  },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n  !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n    defaultFS\n  : {\n      ...defaultFS,\n      ...fsOption,\n      promises: {\n        ...defaultFS.promises,\n        ...(fsOption.promises || {}),\n      },\n    }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n  rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n  | 'Unknown'\n  | 'FIFO'\n  | 'CharacterDevice'\n  | 'Directory'\n  | 'BlockDevice'\n  | 'File'\n  | 'SymbolicLink'\n  | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n  s.isFile() ? IFREG\n  : s.isDirectory() ? IFDIR\n  : s.isSymbolicLink() ? IFLNK\n  : s.isCharacterDevice() ? IFCHR\n  : s.isBlockDevice() ? IFBLK\n  : s.isSocket() ? IFSOCK\n  : s.isFIFO() ? IFIFO\n  : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new LRUCache({ max: 2 ** 12 })\nconst normalize = (s: string) => {\n  const c = normalizeCache.get(s)\n  if (c) return c\n  const n = s.normalize('NFKD')\n  normalizeCache.set(s, n)\n  return n\n}\n\nconst normalizeNocaseCache = new LRUCache({ max: 2 ** 12 })\nconst normalizeNocase = (s: string) => {\n  const c = normalizeNocaseCache.get(s)\n  if (c) return c\n  const n = normalize(s.toLowerCase())\n  normalizeNocaseCache.set(s, n)\n  return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n  fullpath?: string\n  relative?: string\n  relativePosix?: string\n  parent?: PathBase\n  /**\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n  constructor() {\n    super({ max: 256 })\n  }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent.  At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache.  This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n  constructor(maxSize: number = 16 * 1024) {\n    super({\n      maxSize,\n      // parent + children\n      sizeCalculation: a => a.length + 1,\n    })\n  }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n  /**\n   * the basename of this path\n   *\n   * **Important**: *always* test the path name against any test string\n   * usingthe {@link isNamed} method, and not by directly comparing this\n   * string. Otherwise, unicode path strings that the system sees as identical\n   * will not be properly treated as the same path, leading to incorrect\n   * behavior and possible security issues.\n   */\n  name: string\n  /**\n   * the Path entry corresponding to the path root.\n   *\n   * @internal\n   */\n  root: PathBase\n  /**\n   * All roots found within the current PathScurry family\n   *\n   * @internal\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * a reference to the parent path, or undefined in the case of root entries\n   *\n   * @internal\n   */\n  parent?: PathBase\n  /**\n   * boolean indicating whether paths are compared case-insensitively\n   * @internal\n   */\n  nocase: boolean\n\n  /**\n   * boolean indicating that this path is the current working directory\n   * of the PathScurry collection that contains it.\n   */\n  isCWD: boolean = false\n\n  /**\n   * the string or regexp used to split paths. On posix, it is `'/'`, and on\n   * windows it is a RegExp matching either `'/'` or `'\\\\'`\n   */\n  abstract splitSep: string | RegExp\n  /**\n   * The path separator string to use when joining paths\n   */\n  abstract sep: string\n\n  // potential default fs override\n  #fs: FSValue\n\n  // Stats fields\n  #dev?: number\n  get dev() {\n    return this.#dev\n  }\n  #mode?: number\n  get mode() {\n    return this.#mode\n  }\n  #nlink?: number\n  get nlink() {\n    return this.#nlink\n  }\n  #uid?: number\n  get uid() {\n    return this.#uid\n  }\n  #gid?: number\n  get gid() {\n    return this.#gid\n  }\n  #rdev?: number\n  get rdev() {\n    return this.#rdev\n  }\n  #blksize?: number\n  get blksize() {\n    return this.#blksize\n  }\n  #ino?: number\n  get ino() {\n    return this.#ino\n  }\n  #size?: number\n  get size() {\n    return this.#size\n  }\n  #blocks?: number\n  get blocks() {\n    return this.#blocks\n  }\n  #atimeMs?: number\n  get atimeMs() {\n    return this.#atimeMs\n  }\n  #mtimeMs?: number\n  get mtimeMs() {\n    return this.#mtimeMs\n  }\n  #ctimeMs?: number\n  get ctimeMs() {\n    return this.#ctimeMs\n  }\n  #birthtimeMs?: number\n  get birthtimeMs() {\n    return this.#birthtimeMs\n  }\n  #atime?: Date\n  get atime() {\n    return this.#atime\n  }\n  #mtime?: Date\n  get mtime() {\n    return this.#mtime\n  }\n  #ctime?: Date\n  get ctime() {\n    return this.#ctime\n  }\n  #birthtime?: Date\n  get birthtime() {\n    return this.#birthtime\n  }\n\n  #matchName: string\n  #depth?: number\n  #fullpath?: string\n  #fullpathPosix?: string\n  #relative?: string\n  #relativePosix?: string\n  #type: number\n  #children: ChildrenCache\n  #linkTarget?: PathBase\n  #realpath?: PathBase\n\n  /**\n   * This property is for compatibility with the Dirent class as of\n   * Node v20, where Dirent['parentPath'] refers to the path of the\n   * directory that was passed to readdir. For root entries, it's the path\n   * to the entry itself.\n   */\n  get parentPath(): string {\n    return (this.parent || this).fullpath()\n  }\n\n  /* c8 ignore start */\n  /**\n   * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n   * this property refers to the *parent* path, not the path object itself.\n   *\n   * @deprecated\n   */\n  get path(): string {\n    return this.parentPath\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    this.name = name\n    this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n    this.#type = type & TYPEMASK\n    this.nocase = nocase\n    this.roots = roots\n    this.root = root || this\n    this.#children = children\n    this.#fullpath = opts.fullpath\n    this.#relative = opts.relative\n    this.#relativePosix = opts.relativePosix\n    this.parent = opts.parent\n    if (this.parent) {\n      this.#fs = this.parent.#fs\n    } else {\n      this.#fs = fsFromOption(opts.fs)\n    }\n  }\n\n  /**\n   * Returns the depth of the Path object from its root.\n   *\n   * For example, a path at `/foo/bar` would have a depth of 2.\n   */\n  depth(): number {\n    if (this.#depth !== undefined) return this.#depth\n    if (!this.parent) return (this.#depth = 0)\n    return (this.#depth = this.parent.depth() + 1)\n  }\n\n  /**\n   * @internal\n   */\n  abstract getRootString(path: string): string\n  /**\n   * @internal\n   */\n  abstract getRoot(rootPath: string): PathBase\n  /**\n   * @internal\n   */\n  abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n  /**\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Get the Path object referenced by the string path, resolved from this Path\n   */\n  resolve(path?: string): PathBase {\n    if (!path) {\n      return this\n    }\n    const rootPath = this.getRootString(path)\n    const dir = path.substring(rootPath.length)\n    const dirParts = dir.split(this.splitSep)\n    const result: PathBase =\n      rootPath ?\n        this.getRoot(rootPath).#resolveParts(dirParts)\n      : this.#resolveParts(dirParts)\n    return result\n  }\n\n  #resolveParts(dirParts: string[]) {\n    let p: PathBase = this\n    for (const part of dirParts) {\n      p = p.child(part)\n    }\n    return p\n  }\n\n  /**\n   * Returns the cached children Path objects, if still available.  If they\n   * have fallen out of the cache, then returns an empty array, and resets the\n   * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n   * lookup.\n   *\n   * @internal\n   */\n  children(): Children {\n    const cached = this.#children.get(this)\n    if (cached) {\n      return cached\n    }\n    const children: Children = Object.assign([], { provisional: 0 })\n    this.#children.set(this, children)\n    this.#type &= ~READDIR_CALLED\n    return children\n  }\n\n  /**\n   * Resolves a path portion and returns or creates the child Path.\n   *\n   * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n   * `'..'`.\n   *\n   * This should not be called directly.  If `pathPart` contains any path\n   * separators, it will lead to unsafe undefined behavior.\n   *\n   * Use `Path.resolve()` instead.\n   *\n   * @internal\n   */\n  child(pathPart: string, opts?: PathOpts): PathBase {\n    if (pathPart === '' || pathPart === '.') {\n      return this\n    }\n    if (pathPart === '..') {\n      return this.parent || this\n    }\n\n    // find the child\n    const children = this.children()\n    const name =\n      this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n    for (const p of children) {\n      if (p.#matchName === name) {\n        return p\n      }\n    }\n\n    // didn't find it, create provisional child, since it might not\n    // actually exist.  If we know the parent isn't a dir, then\n    // in fact it CAN'T exist.\n    const s = this.parent ? this.sep : ''\n    const fullpath =\n      this.#fullpath ? this.#fullpath + s + pathPart : undefined\n    const pchild = this.newChild(pathPart, UNKNOWN, {\n      ...opts,\n      parent: this,\n      fullpath,\n    })\n\n    if (!this.canReaddir()) {\n      pchild.#type |= ENOENT\n    }\n\n    // don't have to update provisional, because if we have real children,\n    // then provisional is set to children.length, otherwise a lower number\n    children.push(pchild)\n    return pchild\n  }\n\n  /**\n   * The relative path from the cwd. If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpath()\n   */\n  relative(): string {\n    if (this.isCWD) return ''\n    if (this.#relative !== undefined) {\n      return this.#relative\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relative = this.name)\n    }\n    const pv = p.relative()\n    return pv + (!pv || !p.parent ? '' : this.sep) + name\n  }\n\n  /**\n   * The relative path from the cwd, using / as the path separator.\n   * If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpathPosix()\n   * On posix systems, this is identical to relative().\n   */\n  relativePosix(): string {\n    if (this.sep === '/') return this.relative()\n    if (this.isCWD) return ''\n    if (this.#relativePosix !== undefined) return this.#relativePosix\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relativePosix = this.fullpathPosix())\n    }\n    const pv = p.relativePosix()\n    return pv + (!pv || !p.parent ? '' : '/') + name\n  }\n\n  /**\n   * The fully resolved path string for this Path entry\n   */\n  fullpath(): string {\n    if (this.#fullpath !== undefined) {\n      return this.#fullpath\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#fullpath = this.name)\n    }\n    const pv = p.fullpath()\n    const fp = pv + (!p.parent ? '' : this.sep) + name\n    return (this.#fullpath = fp)\n  }\n\n  /**\n   * On platforms other than windows, this is identical to fullpath.\n   *\n   * On windows, this is overridden to return the forward-slash form of the\n   * full UNC path.\n   */\n  fullpathPosix(): string {\n    if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n    if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n    if (!this.parent) {\n      const p = this.fullpath().replace(/\\\\/g, '/')\n      if (/^[a-z]:\\//i.test(p)) {\n        return (this.#fullpathPosix = `//?/${p}`)\n      } else {\n        return (this.#fullpathPosix = p)\n      }\n    }\n    const p = this.parent\n    const pfpp = p.fullpathPosix()\n    const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n    return (this.#fullpathPosix = fpp)\n  }\n\n  /**\n   * Is the Path of an unknown type?\n   *\n   * Note that we might know *something* about it if there has been a previous\n   * filesystem operation, for example that it does not exist, or is not a\n   * link, or whether it has child entries.\n   */\n  isUnknown(): boolean {\n    return (this.#type & IFMT) === UNKNOWN\n  }\n\n  isType(type: Type): boolean {\n    return this[`is${type}`]()\n  }\n\n  getType(): Type {\n    return (\n      this.isUnknown() ? 'Unknown'\n      : this.isDirectory() ? 'Directory'\n      : this.isFile() ? 'File'\n      : this.isSymbolicLink() ? 'SymbolicLink'\n      : this.isFIFO() ? 'FIFO'\n      : this.isCharacterDevice() ? 'CharacterDevice'\n      : this.isBlockDevice() ? 'BlockDevice'\n      : /* c8 ignore start */ this.isSocket() ? 'Socket'\n      : 'Unknown'\n    )\n    /* c8 ignore stop */\n  }\n\n  /**\n   * Is the Path a regular file?\n   */\n  isFile(): boolean {\n    return (this.#type & IFMT) === IFREG\n  }\n\n  /**\n   * Is the Path a directory?\n   */\n  isDirectory(): boolean {\n    return (this.#type & IFMT) === IFDIR\n  }\n\n  /**\n   * Is the path a character device?\n   */\n  isCharacterDevice(): boolean {\n    return (this.#type & IFMT) === IFCHR\n  }\n\n  /**\n   * Is the path a block device?\n   */\n  isBlockDevice(): boolean {\n    return (this.#type & IFMT) === IFBLK\n  }\n\n  /**\n   * Is the path a FIFO pipe?\n   */\n  isFIFO(): boolean {\n    return (this.#type & IFMT) === IFIFO\n  }\n\n  /**\n   * Is the path a socket?\n   */\n  isSocket(): boolean {\n    return (this.#type & IFMT) === IFSOCK\n  }\n\n  /**\n   * Is the path a symbolic link?\n   */\n  isSymbolicLink(): boolean {\n    return (this.#type & IFLNK) === IFLNK\n  }\n\n  /**\n   * Return the entry if it has been subject of a successful lstat, or\n   * undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* simply\n   * mean that we haven't called lstat on it.\n   */\n  lstatCached(): PathBase | undefined {\n    return this.#type & LSTAT_CALLED ? this : undefined\n  }\n\n  /**\n   * Return the cached link target if the entry has been the subject of a\n   * successful readlink, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readlink() has been called at some point.\n   */\n  readlinkCached(): PathBase | undefined {\n    return this.#linkTarget\n  }\n\n  /**\n   * Returns the cached realpath target if the entry has been the subject\n   * of a successful realpath, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * realpath() has been called at some point.\n   */\n  realpathCached(): PathBase | undefined {\n    return this.#realpath\n  }\n\n  /**\n   * Returns the cached child Path entries array if the entry has been the\n   * subject of a successful readdir(), or [] otherwise.\n   *\n   * Does not read the filesystem, so an empty array *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readdir() has been called recently enough to still be valid.\n   */\n  readdirCached(): PathBase[] {\n    const children = this.children()\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * Return true if it's worth trying to readlink.  Ie, we don't (yet) have\n   * any indication that readlink will definitely fail.\n   *\n   * Returns false if the path is known to not be a symlink, if a previous\n   * readlink failed, or if the entry does not exist.\n   */\n  canReadlink(): boolean {\n    if (this.#linkTarget) return true\n    if (!this.parent) return false\n    // cases where it cannot possibly succeed\n    const ifmt = this.#type & IFMT\n    return !(\n      (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n      this.#type & ENOREADLINK ||\n      this.#type & ENOENT\n    )\n  }\n\n  /**\n   * Return true if readdir has previously been successfully called on this\n   * path, indicating that cachedReaddir() is likely valid.\n   */\n  calledReaddir(): boolean {\n    return !!(this.#type & READDIR_CALLED)\n  }\n\n  /**\n   * Returns true if the path is known to not exist. That is, a previous lstat\n   * or readdir failed to verify its existence when that would have been\n   * expected, or a parent entry was marked either enoent or enotdir.\n   */\n  isENOENT(): boolean {\n    return !!(this.#type & ENOENT)\n  }\n\n  /**\n   * Return true if the path is a match for the given path name.  This handles\n   * case sensitivity and unicode normalization.\n   *\n   * Note: even on case-sensitive systems, it is **not** safe to test the\n   * equality of the `.name` property to determine whether a given pathname\n   * matches, due to unicode normalization mismatches.\n   *\n   * Always use this method instead of testing the `path.name` property\n   * directly.\n   */\n  isNamed(n: string): boolean {\n    return !this.nocase ?\n        this.#matchName === normalize(n)\n      : this.#matchName === normalizeNocase(n)\n  }\n\n  /**\n   * Return the Path object corresponding to the target of a symbolic link.\n   *\n   * If the Path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   */\n  async readlink(): Promise {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = await this.#fs.promises.readlink(this.fullpath())\n      const linkTarget = (await this.parent.realpath())?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  /**\n   * Synchronous {@link PathBase.readlink}\n   */\n  readlinkSync(): PathBase | undefined {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = this.#fs.readlinkSync(this.fullpath())\n      const linkTarget = this.parent.realpathSync()?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  #readdirSuccess(children: Children) {\n    // succeeded, mark readdir called bit\n    this.#type |= READDIR_CALLED\n    // mark all remaining provisional children as ENOENT\n    for (let p = children.provisional; p < children.length; p++) {\n      const c = children[p]\n      if (c) c.#markENOENT()\n    }\n  }\n\n  #markENOENT() {\n    // mark as UNKNOWN and ENOENT\n    if (this.#type & ENOENT) return\n    this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n    this.#markChildrenENOENT()\n  }\n\n  #markChildrenENOENT() {\n    // all children are provisional and do not exist\n    const children = this.children()\n    children.provisional = 0\n    for (const p of children) {\n      p.#markENOENT()\n    }\n  }\n\n  #markENOREALPATH() {\n    this.#type |= ENOREALPATH\n    this.#markENOTDIR()\n  }\n\n  // save the information when we know the entry is not a dir\n  #markENOTDIR() {\n    // entry is not a directory, so any children can't exist.\n    // this *should* be impossible, since any children created\n    // after it's been marked ENOTDIR should be marked ENOENT,\n    // so it won't even get to this point.\n    /* c8 ignore start */\n    if (this.#type & ENOTDIR) return\n    /* c8 ignore stop */\n    let t = this.#type\n    // this could happen if we stat a dir, then delete it,\n    // then try to read it or one of its children.\n    if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n    this.#type = t | ENOTDIR\n    this.#markChildrenENOENT()\n  }\n\n  #readdirFail(code: string = '') {\n    // markENOTDIR and markENOENT also set provisional=0\n    if (code === 'ENOTDIR' || code === 'EPERM') {\n      this.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      this.#markENOENT()\n    } else {\n      this.children().provisional = 0\n    }\n  }\n\n  #lstatFail(code: string = '') {\n    // Windows just raises ENOENT in this case, disable for win CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR') {\n      // already know it has a parent by this point\n      const p = this.parent as PathBase\n      p.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      /* c8 ignore stop */\n      this.#markENOENT()\n    }\n  }\n\n  #readlinkFail(code: string = '') {\n    let ter = this.#type\n    ter |= ENOREADLINK\n    if (code === 'ENOENT') ter |= ENOENT\n    // windows gets a weird error when you try to readlink a file\n    if (code === 'EINVAL' || code === 'UNKNOWN') {\n      // exists, but not a symlink, we don't know WHAT it is, so remove\n      // all IFMT bits.\n      ter &= IFMT_UNKNOWN\n    }\n    this.#type = ter\n    // windows just gets ENOENT in this case.  We do cover the case,\n    // just disabled because it's impossible on Windows CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR' && this.parent) {\n      this.parent.#markENOTDIR()\n    }\n    /* c8 ignore stop */\n  }\n\n  #readdirAddChild(e: Dirent, c: Children) {\n    return (\n      this.#readdirMaybePromoteChild(e, c) ||\n      this.#readdirAddNewChild(e, c)\n    )\n  }\n\n  #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n    // alloc new entry at head, so it's never provisional\n    const type = entToType(e)\n    const child = this.newChild(e.name, type, { parent: this })\n    const ifmt = child.#type & IFMT\n    if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n      child.#type |= ENOTDIR\n    }\n    c.unshift(child)\n    c.provisional++\n    return child\n  }\n\n  #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n    for (let p = c.provisional; p < c.length; p++) {\n      const pchild = c[p]\n      const name =\n        this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n      if (name !== pchild!.#matchName) {\n        continue\n      }\n\n      return this.#readdirPromoteChild(e, pchild!, p, c)\n    }\n  }\n\n  #readdirPromoteChild(\n    e: Dirent,\n    p: PathBase,\n    index: number,\n    c: Children,\n  ): PathBase {\n    const v = p.name\n    // retain any other flags, but set ifmt from dirent\n    p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n    // case sensitivity fixing when we learn the true name.\n    if (v !== e.name) p.name = e.name\n\n    // just advance provisional index (potentially off the list),\n    // otherwise we have to splice/pop it out and re-insert at head\n    if (index !== c.provisional) {\n      if (index === c.length - 1) c.pop()\n      else c.splice(index, 1)\n      c.unshift(p)\n    }\n    c.provisional++\n    return p\n  }\n\n  /**\n   * Call lstat() on this Path, and update all known information that can be\n   * determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(): Promise {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  /**\n   * synchronous {@link PathBase.lstat}\n   */\n  lstatSync(): PathBase | undefined {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  #applyStat(st: Stats) {\n    const {\n      atime,\n      atimeMs,\n      birthtime,\n      birthtimeMs,\n      blksize,\n      blocks,\n      ctime,\n      ctimeMs,\n      dev,\n      gid,\n      ino,\n      mode,\n      mtime,\n      mtimeMs,\n      nlink,\n      rdev,\n      size,\n      uid,\n    } = st\n    this.#atime = atime\n    this.#atimeMs = atimeMs\n    this.#birthtime = birthtime\n    this.#birthtimeMs = birthtimeMs\n    this.#blksize = blksize\n    this.#blocks = blocks\n    this.#ctime = ctime\n    this.#ctimeMs = ctimeMs\n    this.#dev = dev\n    this.#gid = gid\n    this.#ino = ino\n    this.#mode = mode\n    this.#mtime = mtime\n    this.#mtimeMs = mtimeMs\n    this.#nlink = nlink\n    this.#rdev = rdev\n    this.#size = size\n    this.#uid = uid\n    const ifmt = entToType(st)\n    // retain any other flags, but set the ifmt\n    this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n    if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n      this.#type |= ENOTDIR\n    }\n  }\n\n  #onReaddirCB: ((\n    er: NodeJS.ErrnoException | null,\n    entries: Path[],\n  ) => any)[] = []\n  #readdirCBInFlight: boolean = false\n  #callOnReaddirCB(children: Path[]) {\n    this.#readdirCBInFlight = false\n    const cbs = this.#onReaddirCB.slice()\n    this.#onReaddirCB.length = 0\n    cbs.forEach(cb => cb(null, children))\n  }\n\n  /**\n   * Standard node-style callback interface to get list of directory entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * @param cb The callback called with (er, entries).  Note that the `er`\n   * param is somewhat extraneous, as all readdir() errors are handled and\n   * simply result in an empty set of entries being returned.\n   * @param allowZalgo Boolean indicating that immediately known results should\n   * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n   * zalgo at your peril, the dark pony lord is devious and unforgiving.\n   */\n  readdirCB(\n    cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n    allowZalgo: boolean = false,\n  ): void {\n    if (!this.canReaddir()) {\n      if (allowZalgo) cb(null, [])\n      else queueMicrotask(() => cb(null, []))\n      return\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      const c = children.slice(0, children.provisional)\n      if (allowZalgo) cb(null, c)\n      else queueMicrotask(() => cb(null, c))\n      return\n    }\n\n    // don't have to worry about zalgo at this point.\n    this.#onReaddirCB.push(cb)\n    if (this.#readdirCBInFlight) {\n      return\n    }\n    this.#readdirCBInFlight = true\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n      if (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      } else {\n        // if we didn't get an error, we always get entries.\n        //@ts-ignore\n        for (const e of entries) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      }\n      this.#callOnReaddirCB(children.slice(0, children.provisional))\n      return\n    })\n  }\n\n  #asyncReaddirInFlight?: Promise\n\n  /**\n   * Return an array of known child entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async readdir(): Promise {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    if (this.#asyncReaddirInFlight) {\n      await this.#asyncReaddirInFlight\n    } else {\n      /* c8 ignore start */\n      let resolve: () => void = () => {}\n      /* c8 ignore stop */\n      this.#asyncReaddirInFlight = new Promise(\n        res => (resolve = res),\n      )\n      try {\n        for (const e of await this.#fs.promises.readdir(fullpath, {\n          withFileTypes: true,\n        })) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      } catch (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      }\n      this.#asyncReaddirInFlight = undefined\n      resolve()\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * synchronous {@link PathBase.readdir}\n   */\n  readdirSync(): PathBase[] {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    try {\n      for (const e of this.#fs.readdirSync(fullpath, {\n        withFileTypes: true,\n      })) {\n        this.#readdirAddChild(e, children)\n      }\n      this.#readdirSuccess(children)\n    } catch (er) {\n      this.#readdirFail((er as NodeJS.ErrnoException).code)\n      children.provisional = 0\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  canReaddir() {\n    if (this.#type & ENOCHILD) return false\n    const ifmt = IFMT & this.#type\n    // we always set ENOTDIR when setting IFMT, so should be impossible\n    /* c8 ignore start */\n    if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n      return false\n    }\n    /* c8 ignore stop */\n    return true\n  }\n\n  shouldWalk(\n    dirs: Set,\n    walkFilter?: (e: PathBase) => boolean,\n  ): boolean {\n    return (\n      (this.#type & IFDIR) === IFDIR &&\n      !(this.#type & ENOCHILD) &&\n      !dirs.has(this) &&\n      (!walkFilter || walkFilter(this))\n    )\n  }\n\n  /**\n   * Return the Path object corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   * On success, returns a Path object.\n   */\n  async realpath(): Promise {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = await this.#fs.promises.realpath(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Synchronous {@link realpath}\n   */\n  realpathSync(): PathBase | undefined {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = this.#fs.realpathSync(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Internal method to mark this Path object as the scurry cwd,\n   * called by {@link PathScurry#chdir}\n   *\n   * @internal\n   */\n  [setAsCwd](oldCwd: PathBase): void {\n    if (oldCwd === this) return\n    oldCwd.isCWD = false\n    this.isCWD = true\n\n    const changed = new Set([])\n    let rp = []\n    let p: PathBase = this\n    while (p && p.parent) {\n      changed.add(p)\n      p.#relative = rp.join(this.sep)\n      p.#relativePosix = rp.join('/')\n      p = p.parent\n      rp.push('..')\n    }\n    // now un-memoize parents of old cwd\n    p = oldCwd\n    while (p && p.parent && !changed.has(p)) {\n      p.#relative = undefined\n      p.#relativePosix = undefined\n      p = p.parent\n    }\n  }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n  /**\n   * Separator for generating path strings.\n   */\n  sep: '\\\\' = '\\\\'\n  /**\n   * Separator for parsing path strings.\n   */\n  splitSep: RegExp = eitherSep\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathWin32(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return win32.parse(path).root\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(rootPath: string): PathBase {\n    rootPath = uncToDrive(rootPath.toUpperCase())\n    if (rootPath === this.root.name) {\n      return this.root\n    }\n    // ok, not that one, check if it matches another we know about\n    for (const [compare, root] of Object.entries(this.roots)) {\n      if (this.sameRoot(rootPath, compare)) {\n        return (this.roots[rootPath] = root)\n      }\n    }\n    // otherwise, have to create a new one.\n    return (this.roots[rootPath] = new PathScurryWin32(\n      rootPath,\n      this,\n    ).root)\n  }\n\n  /**\n   * @internal\n   */\n  sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n    // windows can (rarely) have case-sensitive filesystem, but\n    // UNC and drive letters are always case-insensitive, and canonically\n    // represented uppercase.\n    rootPath = rootPath\n      .toUpperCase()\n      .replace(/\\//g, '\\\\')\n      .replace(uncDriveRegexp, '$1\\\\')\n    return rootPath === compare\n  }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n  /**\n   * separator for parsing path strings\n   */\n  splitSep: '/' = '/'\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return path.startsWith('/') ? '/' : ''\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(_rootPath: string): PathBase {\n    return this.root\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathPosix(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n  /**\n   * perform case-insensitive path matching. Default based on platform\n   * subclass.\n   */\n  nocase?: boolean\n  /**\n   * Number of Path entries to keep in the cache of Path child references.\n   *\n   * Setting this higher than 65536 will dramatically increase the data\n   * consumption and construction time overhead of each PathScurry.\n   *\n   * Setting this value to 256 or lower will significantly reduce the data\n   * consumption and construction time overhead, but may also reduce resolve()\n   * and readdir() performance on large filesystems.\n   *\n   * Default `16384`.\n   */\n  childrenCacheSize?: number\n  /**\n   * An object that overrides the built-in functions from the fs and\n   * fs/promises modules.\n   *\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n  /**\n   * The root Path entry for the current working directory of this Scurry\n   */\n  root: PathBase\n  /**\n   * The string path for the root of this Scurry's current working directory\n   */\n  rootPath: string\n  /**\n   * A collection of all roots encountered, referenced by rootPath\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * The Path entry corresponding to this PathScurry's current working directory.\n   */\n  cwd: PathBase\n  #resolveCache: ResolveCache\n  #resolvePosixCache: ResolveCache\n  #children: ChildrenCache\n  /**\n   * Perform path comparisons case-insensitively.\n   *\n   * Defaults true on Darwin and Windows systems, false elsewhere.\n   */\n  nocase: boolean\n\n  /**\n   * The path separator used for parsing paths\n   *\n   * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n   */\n  abstract sep: string | RegExp\n\n  #fs: FSValue\n\n  /**\n   * This class should not be instantiated directly.\n   *\n   * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n   *\n   * @internal\n   */\n  constructor(\n    cwd: URL | string = process.cwd(),\n    pathImpl: typeof win32 | typeof posix,\n    sep: string | RegExp,\n    {\n      nocase,\n      childrenCacheSize = 16 * 1024,\n      fs = defaultFS,\n    }: PathScurryOpts = {},\n  ) {\n    this.#fs = fsFromOption(fs)\n    if (cwd instanceof URL || cwd.startsWith('file://')) {\n      cwd = fileURLToPath(cwd)\n    }\n    // resolve and split root, and then add to the store.\n    // this is the only time we call path.resolve()\n    const cwdPath = pathImpl.resolve(cwd)\n    this.roots = Object.create(null)\n    this.rootPath = this.parseRootPath(cwdPath)\n    this.#resolveCache = new ResolveCache()\n    this.#resolvePosixCache = new ResolveCache()\n    this.#children = new ChildrenCache(childrenCacheSize)\n\n    const split = cwdPath.substring(this.rootPath.length).split(sep)\n    // resolve('/') leaves '', splits to [''], we don't want that.\n    if (split.length === 1 && !split[0]) {\n      split.pop()\n    }\n    /* c8 ignore start */\n    if (nocase === undefined) {\n      throw new TypeError(\n        'must provide nocase setting to PathScurryBase ctor',\n      )\n    }\n    /* c8 ignore stop */\n    this.nocase = nocase\n    this.root = this.newRoot(this.#fs)\n    this.roots[this.rootPath] = this.root\n    let prev: PathBase = this.root\n    let len = split.length - 1\n    const joinSep = pathImpl.sep\n    let abs = this.rootPath\n    let sawFirst = false\n    for (const part of split) {\n      const l = len--\n      prev = prev.child(part, {\n        relative: new Array(l).fill('..').join(joinSep),\n        relativePosix: new Array(l).fill('..').join('/'),\n        fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n      })\n      sawFirst = true\n    }\n    this.cwd = prev\n  }\n\n  /**\n   * Get the depth of a provided path, string, or the cwd\n   */\n  depth(path: Path | string = this.cwd): number {\n    if (typeof path === 'string') {\n      path = this.cwd.resolve(path)\n    }\n    return path.depth()\n  }\n\n  /**\n   * Parse the root portion of a path string\n   *\n   * @internal\n   */\n  abstract parseRootPath(dir: string): string\n  /**\n   * create a new Path to use as root during construction.\n   *\n   * @internal\n   */\n  abstract newRoot(fs: FSValue): PathBase\n  /**\n   * Determine whether a given path string is absolute\n   */\n  abstract isAbsolute(p: string): boolean\n\n  /**\n   * Return the cache of child entries.  Exposed so subclasses can create\n   * child Path objects in a platform-specific way.\n   *\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolve(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolveCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpath()\n    this.#resolveCache.set(r, result)\n    return result\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string, returning\n   * the posix path.  Identical to .resolve() on posix systems, but on\n   * windows will return a forward-slash separated UNC path.\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolvePosix(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolvePosixCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpathPosix()\n    this.#resolvePosixCache.set(r, result)\n    return result\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or entry\n   */\n  relative(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relative()\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or\n   * entry, using / as the path delimiter, even on Windows.\n   */\n  relativePosix(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relativePosix()\n  }\n\n  /**\n   * Return the basename for the provided string or Path object\n   */\n  basename(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.name\n  }\n\n  /**\n   * Return the dirname for the provided string or Path object\n   */\n  dirname(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return (entry.parent || entry).fullpath()\n  }\n\n  /**\n   * Return an array of known child entries.\n   *\n   * First argument may be either a string, or a Path object.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n   * `{ withFileTypes: false }` to return strings.\n   */\n\n  readdir(): Promise\n  readdir(opts: { withFileTypes: true }): Promise\n  readdir(opts: { withFileTypes: false }): Promise\n  readdir(opts: { withFileTypes: boolean }): Promise\n  readdir(entry: PathBase | string): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): Promise\n  async readdir(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else {\n      const p = await entry.readdir()\n      return withFileTypes ? p : p.map(e => e.name)\n    }\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readdir}\n   */\n  readdirSync(): PathBase[]\n  readdirSync(opts: { withFileTypes: true }): PathBase[]\n  readdirSync(opts: { withFileTypes: false }): string[]\n  readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n  readdirSync(entry: PathBase | string): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): string[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): PathBase[] | string[]\n  readdirSync(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes = true } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else if (withFileTypes) {\n      return entry.readdirSync()\n    } else {\n      return entry.readdirSync().map(e => e.name)\n    }\n  }\n\n  /**\n   * Call lstat() on the string or Path object, and update all known\n   * information that can be determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(\n    entry: string | PathBase = this.cwd,\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstat()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.lstat}\n   */\n  lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstatSync()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to the target of a\n   * symbolic link.\n   *\n   * If the path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  readlink(): Promise\n  readlink(opt: { withFileTypes: false }): Promise\n  readlink(opt: { withFileTypes: true }): Promise\n  readlink(opt: {\n    withFileTypes: boolean\n  }): Promise\n  readlink(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async readlink(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.readlink()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readlink}\n   */\n  readlinkSync(): string | undefined\n  readlinkSync(opt: { withFileTypes: false }): string | undefined\n  readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n  readlinkSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.readlinkSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  realpath(): Promise\n  realpath(opt: { withFileTypes: false }): Promise\n  realpath(opt: { withFileTypes: true }): Promise\n  realpath(opt: {\n    withFileTypes: boolean\n  }): Promise\n  realpath(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async realpath(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.realpath()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  realpathSync(): string | undefined\n  realpathSync(opt: { withFileTypes: false }): string | undefined\n  realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n  realpathSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  realpathSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.realpathSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Asynchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walk(): Promise\n  walk(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(opts: WalkOptionsWithFileTypesFalse): Promise\n  walk(opts: WalkOptions): Promise\n  walk(entry: string | PathBase): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Promise\n  async walk(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const walk = (\n      dir: PathBase,\n      cb: (er?: NodeJS.ErrnoException) => void,\n    ) => {\n      dirs.add(dir)\n      dir.readdirCB((er, entries) => {\n        /* c8 ignore start */\n        if (er) {\n          return cb(er)\n        }\n        /* c8 ignore stop */\n        let len = entries.length\n        if (!len) return cb()\n        const next = () => {\n          if (--len === 0) {\n            cb()\n          }\n        }\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            results.push(withFileTypes ? e : e.fullpath())\n          }\n          if (follow && e.isSymbolicLink()) {\n            e.realpath()\n              .then(r => (r?.isUnknown() ? r.lstat() : r))\n              .then(r =>\n                r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n              )\n          } else {\n            if (e.shouldWalk(dirs, walkFilter)) {\n              walk(e, next)\n            } else {\n              next()\n            }\n          }\n        }\n      }, true) // zalgooooooo\n    }\n\n    const start = entry\n    return new Promise((res, rej) => {\n      walk(start, er => {\n        /* c8 ignore start */\n        if (er) return rej(er)\n        /* c8 ignore stop */\n        res(results as PathBase[] | string[])\n      })\n    })\n  }\n\n  /**\n   * Synchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walkSync(): PathBase[]\n  walkSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): PathBase[]\n  walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n  walkSync(opts: WalkOptions): string[] | PathBase[]\n  walkSync(entry: string | PathBase): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): string[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): PathBase[] | string[]\n  walkSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          results.push(withFileTypes ? e : e.fullpath())\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n    return results as string[] | PathBase[]\n  }\n\n  /**\n   * Support for `for await`\n   *\n   * Alias for {@link PathScurryBase.iterate}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n\n  /**\n   * Async generator form of {@link PathScurryBase.walk}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking, especially if most/all of the directory tree has been previously\n   * walked.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  iterate(): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(opts: WalkOptions): AsyncGenerator\n  iterate(entry: string | PathBase): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    options: WalkOptions = {},\n  ): AsyncGenerator {\n    // iterating async over the stream is significantly more performant,\n    // especially in the warm-cache scenario, because it buffers up directory\n    // entries in the background instead of waiting for a yield for each one.\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      options = entry\n      entry = this.cwd\n    }\n    return this.stream(entry, options)[Symbol.asyncIterator]()\n  }\n\n  /**\n   * Iterating over a PathScurry performs a synchronous walk.\n   *\n   * Alias for {@link PathScurryBase.iterateSync}\n   */\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  iterateSync(): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(opts: WalkOptions): Generator\n  iterateSync(entry: string | PathBase): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Generator\n  *iterateSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Generator {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    if (!filter || filter(entry)) {\n      yield withFileTypes ? entry : entry.fullpath()\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          yield withFileTypes ? e : e.fullpath()\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n  }\n\n  /**\n   * Stream form of {@link PathScurryBase.walk}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   */\n  stream(): Minipass\n  stream(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n  stream(opts: WalkOptions): Minipass\n  stream(entry: string | PathBase): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  stream(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n\n        processing++\n        dirs.add(dir)\n\n        const onReaddir = (\n          er: null | NodeJS.ErrnoException,\n          entries: PathBase[],\n          didRealpaths: boolean = false,\n        ) => {\n          /* c8 ignore start */\n          if (er) return results.emit('error', er)\n          /* c8 ignore stop */\n          if (follow && !didRealpaths) {\n            const promises: Promise[] = []\n            for (const e of entries) {\n              if (e.isSymbolicLink()) {\n                promises.push(\n                  e\n                    .realpath()\n                    .then((r: PathBase | undefined) =>\n                      r?.isUnknown() ? r.lstat() : r,\n                    ),\n                )\n              }\n            }\n            if (promises.length) {\n              Promise.all(promises).then(() =>\n                onReaddir(null, entries, true),\n              )\n              return\n            }\n          }\n\n          for (const e of entries) {\n            if (e && (!filter || filter(e))) {\n              if (!results.write(withFileTypes ? e : e.fullpath())) {\n                paused = true\n              }\n            }\n          }\n\n          processing--\n          for (const e of entries) {\n            const r = e.realpathCached() || e\n            if (r.shouldWalk(dirs, walkFilter)) {\n              queue.push(r)\n            }\n          }\n          if (paused && !results.flowing) {\n            results.once('drain', process)\n          } else if (!sync) {\n            process()\n          }\n        }\n\n        // zalgo containment\n        let sync = true\n        dir.readdirCB(onReaddir, true)\n        sync = false\n      }\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  /**\n   * Synchronous form of {@link PathScurryBase.stream}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   *\n   * Will complete the walk in a single tick if the stream is consumed fully.\n   * Otherwise, will pause as needed for stream backpressure.\n   */\n  streamSync(): Minipass\n  streamSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n  streamSync(opts: WalkOptions): Minipass\n  streamSync(entry: string | PathBase): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  streamSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    const dirs = new Set()\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n        processing++\n        dirs.add(dir)\n\n        const entries = dir.readdirSync()\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            if (!results.write(withFileTypes ? e : e.fullpath())) {\n              paused = true\n            }\n          }\n        }\n        processing--\n        for (const e of entries) {\n          let r: PathBase | undefined = e\n          if (e.isSymbolicLink()) {\n            if (!(follow && (r = e.realpathSync()))) continue\n            if (r.isUnknown()) r.lstatSync()\n          }\n          if (r.shouldWalk(dirs, walkFilter)) {\n            queue.push(r)\n          }\n        }\n      }\n      if (paused && !results.flowing) results.once('drain', process)\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  chdir(path: string | Path = this.cwd) {\n    const oldCwd = this.cwd\n    this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n    this.cwd[setAsCwd](oldCwd)\n  }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n  /**\n   * Return results as {@link PathBase} objects rather than strings.\n   * When set to false, results are fully resolved paths, as returned by\n   * {@link PathBase.fullpath}.\n   * @default true\n   */\n  withFileTypes?: boolean\n\n  /**\n   *  Attempt to read directory entries from symbolic links. Otherwise, only\n   *  actual directories are traversed. Regardless of this setting, a given\n   *  target path will only ever be walked once, meaning that a symbolic link\n   *  to a previously traversed directory will never be followed.\n   *\n   *  Setting this imposes a slight performance penalty, because `readlink`\n   *  must be called on all symbolic links encountered, in order to avoid\n   *  infinite cycles.\n   * @default false\n   */\n  follow?: boolean\n\n  /**\n   * Only return entries where the provided function returns true.\n   *\n   * This will not prevent directories from being traversed, even if they do\n   * not pass the filter, though it will prevent directories themselves from\n   * being included in the result set.  See {@link walkFilter}\n   *\n   * Asynchronous functions are not supported here.\n   *\n   * By default, if no filter is provided, all entries and traversed\n   * directories are included.\n   */\n  filter?: (entry: PathBase) => boolean\n\n  /**\n   * Only traverse directories (and in the case of {@link follow} being set to\n   * true, symbolic links to directories) if the provided function returns\n   * true.\n   *\n   * This will not prevent directories from being included in the result set,\n   * even if they do not pass the supplied filter function.  See {@link filter}\n   * to do that.\n   *\n   * Asynchronous functions are not supported here.\n   */\n  walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n  withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n  withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n  withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings.  Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '\\\\' = '\\\\'\n\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, win32, '\\\\', { ...opts, nocase })\n    this.nocase = nocase\n    for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n      p.nocase = this.nocase\n    }\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(dir: string): string {\n    // if the path starts with a single separator, it's not a UNC, and we'll\n    // just get separator as the root, and driveFromUNC will return \\\n    // In that case, mount \\ on the root from the cwd.\n    return win32.parse(dir).root.toUpperCase()\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathWin32(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return (\n      p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n    )\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = false } = opts\n    super(cwd, posix, '/', { ...opts, nocase })\n    this.nocase = nocase\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(_dir: string): string {\n    return '/'\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathPosix(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return p.startsWith('/')\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, { ...opts, nocase })\n  }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n  | typeof PathScurryWin32\n  | typeof PathScurryDarwin\n  | typeof PathScurryPosix =\n  process.platform === 'win32' ? PathScurryWin32\n  : process.platform === 'darwin' ? PathScurryDarwin\n  : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/package.json b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ef31b1b7716f6c9ae8127045dfa5cd87f6a076e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts
@@ -0,0 +1,1115 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { Minipass } from 'minipass';
+import type { Dirent, Stats } from 'node:fs';
+/**
+ * An object that will be used to override the default `fs`
+ * methods.  Any methods that are not overridden will use Node's
+ * built-in implementations.
+ *
+ * - lstatSync
+ * - readdir (callback `withFileTypes` Dirent variant, used for
+ *   readdirCB and most walks)
+ * - readdirSync
+ * - readlinkSync
+ * - realpathSync
+ * - promises: Object containing the following async methods:
+ *   - lstat
+ *   - readdir (Dirent variant only)
+ *   - readlink
+ *   - realpath
+ */
+export interface FSOption {
+    lstatSync?: (path: string) => Stats;
+    readdir?: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync?: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync?: (path: string) => string;
+    realpathSync?: (path: string) => string;
+    promises?: {
+        lstat?: (path: string) => Promise;
+        readdir?: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink?: (path: string) => Promise;
+        realpath?: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+interface FSValue {
+    lstatSync: (path: string) => Stats;
+    readdir: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync: (path: string) => string;
+    realpathSync: (path: string) => string;
+    promises: {
+        lstat: (path: string) => Promise;
+        readdir: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink: (path: string) => Promise;
+        realpath: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket';
+/**
+ * Options that may be provided to the Path constructor
+ */
+export interface PathOpts {
+    fullpath?: string;
+    relative?: string;
+    relativePosix?: string;
+    parent?: PathBase;
+    /**
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export declare class ResolveCache extends LRUCache {
+    constructor();
+}
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export declare class ChildrenCache extends LRUCache {
+    constructor(maxSize?: number);
+}
+/**
+ * Array of Path objects, plus a marker indicating the first provisional entry
+ *
+ * @internal
+ */
+export type Children = PathBase[] & {
+    provisional: number;
+};
+declare const setAsCwd: unique symbol;
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export declare abstract class PathBase implements Dirent {
+    #private;
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name: string;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root: PathBase;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent?: PathBase;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase: boolean;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD: boolean;
+    /**
+     * the string or regexp used to split paths. On posix, it is `'/'`, and on
+     * windows it is a RegExp matching either `'/'` or `'\\'`
+     */
+    abstract splitSep: string | RegExp;
+    /**
+     * The path separator string to use when joining paths
+     */
+    abstract sep: string;
+    get dev(): number | undefined;
+    get mode(): number | undefined;
+    get nlink(): number | undefined;
+    get uid(): number | undefined;
+    get gid(): number | undefined;
+    get rdev(): number | undefined;
+    get blksize(): number | undefined;
+    get ino(): number | undefined;
+    get size(): number | undefined;
+    get blocks(): number | undefined;
+    get atimeMs(): number | undefined;
+    get mtimeMs(): number | undefined;
+    get ctimeMs(): number | undefined;
+    get birthtimeMs(): number | undefined;
+    get atime(): Date | undefined;
+    get mtime(): Date | undefined;
+    get ctime(): Date | undefined;
+    get birthtime(): Date | undefined;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath(): string;
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path(): string;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth(): number;
+    /**
+     * @internal
+     */
+    abstract getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    abstract getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase;
+    /**
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path?: string): PathBase;
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children(): Children;
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart: string, opts?: PathOpts): PathBase;
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative(): string;
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix(): string;
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath(): string;
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix(): string;
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown(): boolean;
+    isType(type: Type): boolean;
+    getType(): Type;
+    /**
+     * Is the Path a regular file?
+     */
+    isFile(): boolean;
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory(): boolean;
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice(): boolean;
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice(): boolean;
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO(): boolean;
+    /**
+     * Is the path a socket?
+     */
+    isSocket(): boolean;
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink(): boolean;
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached(): PathBase | undefined;
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached(): PathBase | undefined;
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached(): PathBase | undefined;
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached(): PathBase[];
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink(): boolean;
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir(): boolean;
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT(): boolean;
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n: string): boolean;
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    readlink(): Promise;
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync(): PathBase | undefined;
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(): Promise;
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync(): PathBase | undefined;
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    readdir(): Promise;
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    canReaddir(): boolean;
+    shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean;
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    realpath(): Promise;
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync(): PathBase | undefined;
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd: PathBase): void;
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export declare class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep: '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep: RegExp;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathWin32;
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    sameRoot(rootPath: string, compare?: string): boolean;
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export declare class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep: '/';
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(_rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathPosix;
+}
+/**
+ * Options that may be provided to the PathScurry constructor
+ */
+export interface PathScurryOpts {
+    /**
+     * perform case-insensitive path matching. Default based on platform
+     * subclass.
+     */
+    nocase?: boolean;
+    /**
+     * Number of Path entries to keep in the cache of Path child references.
+     *
+     * Setting this higher than 65536 will dramatically increase the data
+     * consumption and construction time overhead of each PathScurry.
+     *
+     * Setting this value to 256 or lower will significantly reduce the data
+     * consumption and construction time overhead, but may also reduce resolve()
+     * and readdir() performance on large filesystems.
+     *
+     * Default `16384`.
+     */
+    childrenCacheSize?: number;
+    /**
+     * An object that overrides the built-in functions from the fs and
+     * fs/promises modules.
+     *
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export declare abstract class PathScurryBase {
+    #private;
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root: PathBase;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath: string;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd: PathBase;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase: boolean;
+    /**
+     * The path separator used for parsing paths
+     *
+     * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows
+     */
+    abstract sep: string | RegExp;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd: (URL | string) | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts);
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path?: Path | string): number;
+    /**
+     * Parse the root portion of a path string
+     *
+     * @internal
+     */
+    abstract parseRootPath(dir: string): string;
+    /**
+     * create a new Path to use as root during construction.
+     *
+     * @internal
+     */
+    abstract newRoot(fs: FSValue): PathBase;
+    /**
+     * Determine whether a given path string is absolute
+     */
+    abstract isAbsolute(p: string): boolean;
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths: string[]): string;
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths: string[]): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry?: PathBase | string): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry?: PathBase | string): string;
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry?: PathBase | string): string;
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry?: PathBase | string): string;
+    /**
+     * Return an array of known child entries.
+     *
+     * First argument may be either a string, or a Path object.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set
+     * `{ withFileTypes: false }` to return strings.
+     */
+    readdir(): Promise;
+    readdir(opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    readdir(entry: PathBase | string): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    readdirSync(entry: PathBase | string): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(entry?: string | PathBase): Promise;
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry?: string | PathBase): PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to the target of a
+     * symbolic link.
+     *
+     * If the path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    readlink(): Promise;
+    readlink(opt: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    readlink(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readlink}
+     */
+    readlinkSync(): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    readlinkSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    realpath(): Promise;
+    realpath(opt: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpath(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpathSync(): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    realpathSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Asynchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walk(): Promise;
+    walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(opts: WalkOptions): Promise;
+    walk(entry: string | PathBase): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(entry: string | PathBase, opts: WalkOptions): Promise;
+    /**
+     * Synchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walkSync(): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(opts: WalkOptions): string[] | PathBase[];
+    walkSync(entry: string | PathBase): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[];
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Async generator form of {@link PathScurryBase.walk}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking, especially if most/all of the directory tree has been previously
+     * walked.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    iterate(): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(opts: WalkOptions): AsyncGenerator;
+    iterate(entry: string | PathBase): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator;
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator](): Generator;
+    iterateSync(): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(opts: WalkOptions): Generator;
+    iterateSync(entry: string | PathBase): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptions): Generator;
+    /**
+     * Stream form of {@link PathScurryBase.walk}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     */
+    stream(): Minipass;
+    stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    stream(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(opts: WalkOptions): Minipass;
+    stream(entry: string | PathBase): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    /**
+     * Synchronous form of {@link PathScurryBase.stream}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     *
+     * Will complete the walk in a single tick if the stream is consumed fully.
+     * Otherwise, will pause as needed for stream backpressure.
+     */
+    streamSync(): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(opts: WalkOptions): Minipass;
+    streamSync(entry: string | PathBase): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    chdir(path?: string | Path): void;
+}
+/**
+ * Options provided to all walk methods.
+ */
+export interface WalkOptions {
+    /**
+     * Return results as {@link PathBase} objects rather than strings.
+     * When set to false, results are fully resolved paths, as returned by
+     * {@link PathBase.fullpath}.
+     * @default true
+     */
+    withFileTypes?: boolean;
+    /**
+     *  Attempt to read directory entries from symbolic links. Otherwise, only
+     *  actual directories are traversed. Regardless of this setting, a given
+     *  target path will only ever be walked once, meaning that a symbolic link
+     *  to a previously traversed directory will never be followed.
+     *
+     *  Setting this imposes a slight performance penalty, because `readlink`
+     *  must be called on all symbolic links encountered, in order to avoid
+     *  infinite cycles.
+     * @default false
+     */
+    follow?: boolean;
+    /**
+     * Only return entries where the provided function returns true.
+     *
+     * This will not prevent directories from being traversed, even if they do
+     * not pass the filter, though it will prevent directories themselves from
+     * being included in the result set.  See {@link walkFilter}
+     *
+     * Asynchronous functions are not supported here.
+     *
+     * By default, if no filter is provided, all entries and traversed
+     * directories are included.
+     */
+    filter?: (entry: PathBase) => boolean;
+    /**
+     * Only traverse directories (and in the case of {@link follow} being set to
+     * true, symbolic links to directories) if the provided function returns
+     * true.
+     *
+     * This will not prevent directories from being included in the result set,
+     * even if they do not pass the supplied filter function.  See {@link filter}
+     * to do that.
+     *
+     * Asynchronous functions are not supported here.
+     */
+    walkFilter?: (entry: PathBase) => boolean;
+}
+export type WalkOptionsWithFileTypesUnset = WalkOptions & {
+    withFileTypes?: undefined;
+};
+export type WalkOptionsWithFileTypesTrue = WalkOptions & {
+    withFileTypes: true;
+};
+export type WalkOptionsWithFileTypesFalse = WalkOptions & {
+    withFileTypes: false;
+};
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export declare class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '\\';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathWin32;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(_dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathPosix;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export declare const Path: typeof PathWin32 | typeof PathPosix;
+export type Path = PathBase | InstanceType;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix;
+export type PathScurry = PathScurryBase | InstanceType;
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts.map b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bf58a3a3ac71919dd09a2165ae355cef7cef57bc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"m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AAmB;IAO3B;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAGQ,CAAA;AACnB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc7cae493aa50fbad6c60904329e97c1f279ddd6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js
@@ -0,0 +1,1983 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps, } from 'fs';
+import * as actualFS from 'node:fs';
+const realpathSync = rps.native;
+// TODO: test perf of fs/promises realpath vs realpathCB,
+// since the promises one uses realpath.native
+import { lstat, readdir, readlink, realpath } from 'node:fs/promises';
+import { Minipass } from 'minipass';
+const defaultFS = {
+    lstatSync,
+    readdir: readdirCB,
+    readdirSync,
+    readlinkSync,
+    realpathSync,
+    promises: {
+        lstat,
+        readdir,
+        readlink,
+        realpath,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new LRUCache({ max: 2 ** 12 });
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export class ResolveCache extends LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export class ChildrenCache extends LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /* c8 ignore start */
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /* c8 ignore stop */
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return win32.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = fileURLToPath(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, win32, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return win32.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, posix, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export const Path = process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export const PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js.map b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..51e56ee11f6287f5f5c183589ab4b4f2826ada70
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","s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C,CAAS;QAClB,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IACnD,YACE,MAAoB,OAAO,CAAC,GAAG,EAAE,EACjC,OAAuB,EAAE;QAEzB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAC9B,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACjC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe;IAC9C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n  lstatSync,\n  readdir as readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods.  Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n *   readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n *   - lstat\n *   - readdir (Dirent variant only)\n *   - readlink\n *   - realpath\n */\nexport interface FSOption {\n  lstatSync?: (path: string) => Stats\n  readdir?: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync?: (\n    path: string,\n    options: { withFileTypes: true },\n  ) => Dirent[]\n  readlinkSync?: (path: string) => string\n  realpathSync?: (path: string) => string\n  promises?: {\n    lstat?: (path: string) => Promise\n    readdir?: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink?: (path: string) => Promise\n    realpath?: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\ninterface FSValue {\n  lstatSync: (path: string) => Stats\n  readdir: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n  readlinkSync: (path: string) => string\n  realpathSync: (path: string) => string\n  promises: {\n    lstat: (path: string) => Promise\n    readdir: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink: (path: string) => Promise\n    realpath: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n  lstatSync,\n  readdir: readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync,\n  promises: {\n    lstat,\n    readdir,\n    readlink,\n    realpath,\n  },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n  !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n    defaultFS\n  : {\n      ...defaultFS,\n      ...fsOption,\n      promises: {\n        ...defaultFS.promises,\n        ...(fsOption.promises || {}),\n      },\n    }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n  rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n  | 'Unknown'\n  | 'FIFO'\n  | 'CharacterDevice'\n  | 'Directory'\n  | 'BlockDevice'\n  | 'File'\n  | 'SymbolicLink'\n  | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n  s.isFile() ? IFREG\n  : s.isDirectory() ? IFDIR\n  : s.isSymbolicLink() ? IFLNK\n  : s.isCharacterDevice() ? IFCHR\n  : s.isBlockDevice() ? IFBLK\n  : s.isSocket() ? IFSOCK\n  : s.isFIFO() ? IFIFO\n  : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new LRUCache({ max: 2 ** 12 })\nconst normalize = (s: string) => {\n  const c = normalizeCache.get(s)\n  if (c) return c\n  const n = s.normalize('NFKD')\n  normalizeCache.set(s, n)\n  return n\n}\n\nconst normalizeNocaseCache = new LRUCache({ max: 2 ** 12 })\nconst normalizeNocase = (s: string) => {\n  const c = normalizeNocaseCache.get(s)\n  if (c) return c\n  const n = normalize(s.toLowerCase())\n  normalizeNocaseCache.set(s, n)\n  return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n  fullpath?: string\n  relative?: string\n  relativePosix?: string\n  parent?: PathBase\n  /**\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n  constructor() {\n    super({ max: 256 })\n  }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent.  At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache.  This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n  constructor(maxSize: number = 16 * 1024) {\n    super({\n      maxSize,\n      // parent + children\n      sizeCalculation: a => a.length + 1,\n    })\n  }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n  /**\n   * the basename of this path\n   *\n   * **Important**: *always* test the path name against any test string\n   * usingthe {@link isNamed} method, and not by directly comparing this\n   * string. Otherwise, unicode path strings that the system sees as identical\n   * will not be properly treated as the same path, leading to incorrect\n   * behavior and possible security issues.\n   */\n  name: string\n  /**\n   * the Path entry corresponding to the path root.\n   *\n   * @internal\n   */\n  root: PathBase\n  /**\n   * All roots found within the current PathScurry family\n   *\n   * @internal\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * a reference to the parent path, or undefined in the case of root entries\n   *\n   * @internal\n   */\n  parent?: PathBase\n  /**\n   * boolean indicating whether paths are compared case-insensitively\n   * @internal\n   */\n  nocase: boolean\n\n  /**\n   * boolean indicating that this path is the current working directory\n   * of the PathScurry collection that contains it.\n   */\n  isCWD: boolean = false\n\n  /**\n   * the string or regexp used to split paths. On posix, it is `'/'`, and on\n   * windows it is a RegExp matching either `'/'` or `'\\\\'`\n   */\n  abstract splitSep: string | RegExp\n  /**\n   * The path separator string to use when joining paths\n   */\n  abstract sep: string\n\n  // potential default fs override\n  #fs: FSValue\n\n  // Stats fields\n  #dev?: number\n  get dev() {\n    return this.#dev\n  }\n  #mode?: number\n  get mode() {\n    return this.#mode\n  }\n  #nlink?: number\n  get nlink() {\n    return this.#nlink\n  }\n  #uid?: number\n  get uid() {\n    return this.#uid\n  }\n  #gid?: number\n  get gid() {\n    return this.#gid\n  }\n  #rdev?: number\n  get rdev() {\n    return this.#rdev\n  }\n  #blksize?: number\n  get blksize() {\n    return this.#blksize\n  }\n  #ino?: number\n  get ino() {\n    return this.#ino\n  }\n  #size?: number\n  get size() {\n    return this.#size\n  }\n  #blocks?: number\n  get blocks() {\n    return this.#blocks\n  }\n  #atimeMs?: number\n  get atimeMs() {\n    return this.#atimeMs\n  }\n  #mtimeMs?: number\n  get mtimeMs() {\n    return this.#mtimeMs\n  }\n  #ctimeMs?: number\n  get ctimeMs() {\n    return this.#ctimeMs\n  }\n  #birthtimeMs?: number\n  get birthtimeMs() {\n    return this.#birthtimeMs\n  }\n  #atime?: Date\n  get atime() {\n    return this.#atime\n  }\n  #mtime?: Date\n  get mtime() {\n    return this.#mtime\n  }\n  #ctime?: Date\n  get ctime() {\n    return this.#ctime\n  }\n  #birthtime?: Date\n  get birthtime() {\n    return this.#birthtime\n  }\n\n  #matchName: string\n  #depth?: number\n  #fullpath?: string\n  #fullpathPosix?: string\n  #relative?: string\n  #relativePosix?: string\n  #type: number\n  #children: ChildrenCache\n  #linkTarget?: PathBase\n  #realpath?: PathBase\n\n  /**\n   * This property is for compatibility with the Dirent class as of\n   * Node v20, where Dirent['parentPath'] refers to the path of the\n   * directory that was passed to readdir. For root entries, it's the path\n   * to the entry itself.\n   */\n  get parentPath(): string {\n    return (this.parent || this).fullpath()\n  }\n\n  /* c8 ignore start */\n  /**\n   * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n   * this property refers to the *parent* path, not the path object itself.\n   *\n   * @deprecated\n   */\n  get path(): string {\n    return this.parentPath\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    this.name = name\n    this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n    this.#type = type & TYPEMASK\n    this.nocase = nocase\n    this.roots = roots\n    this.root = root || this\n    this.#children = children\n    this.#fullpath = opts.fullpath\n    this.#relative = opts.relative\n    this.#relativePosix = opts.relativePosix\n    this.parent = opts.parent\n    if (this.parent) {\n      this.#fs = this.parent.#fs\n    } else {\n      this.#fs = fsFromOption(opts.fs)\n    }\n  }\n\n  /**\n   * Returns the depth of the Path object from its root.\n   *\n   * For example, a path at `/foo/bar` would have a depth of 2.\n   */\n  depth(): number {\n    if (this.#depth !== undefined) return this.#depth\n    if (!this.parent) return (this.#depth = 0)\n    return (this.#depth = this.parent.depth() + 1)\n  }\n\n  /**\n   * @internal\n   */\n  abstract getRootString(path: string): string\n  /**\n   * @internal\n   */\n  abstract getRoot(rootPath: string): PathBase\n  /**\n   * @internal\n   */\n  abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n  /**\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Get the Path object referenced by the string path, resolved from this Path\n   */\n  resolve(path?: string): PathBase {\n    if (!path) {\n      return this\n    }\n    const rootPath = this.getRootString(path)\n    const dir = path.substring(rootPath.length)\n    const dirParts = dir.split(this.splitSep)\n    const result: PathBase =\n      rootPath ?\n        this.getRoot(rootPath).#resolveParts(dirParts)\n      : this.#resolveParts(dirParts)\n    return result\n  }\n\n  #resolveParts(dirParts: string[]) {\n    let p: PathBase = this\n    for (const part of dirParts) {\n      p = p.child(part)\n    }\n    return p\n  }\n\n  /**\n   * Returns the cached children Path objects, if still available.  If they\n   * have fallen out of the cache, then returns an empty array, and resets the\n   * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n   * lookup.\n   *\n   * @internal\n   */\n  children(): Children {\n    const cached = this.#children.get(this)\n    if (cached) {\n      return cached\n    }\n    const children: Children = Object.assign([], { provisional: 0 })\n    this.#children.set(this, children)\n    this.#type &= ~READDIR_CALLED\n    return children\n  }\n\n  /**\n   * Resolves a path portion and returns or creates the child Path.\n   *\n   * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n   * `'..'`.\n   *\n   * This should not be called directly.  If `pathPart` contains any path\n   * separators, it will lead to unsafe undefined behavior.\n   *\n   * Use `Path.resolve()` instead.\n   *\n   * @internal\n   */\n  child(pathPart: string, opts?: PathOpts): PathBase {\n    if (pathPart === '' || pathPart === '.') {\n      return this\n    }\n    if (pathPart === '..') {\n      return this.parent || this\n    }\n\n    // find the child\n    const children = this.children()\n    const name =\n      this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n    for (const p of children) {\n      if (p.#matchName === name) {\n        return p\n      }\n    }\n\n    // didn't find it, create provisional child, since it might not\n    // actually exist.  If we know the parent isn't a dir, then\n    // in fact it CAN'T exist.\n    const s = this.parent ? this.sep : ''\n    const fullpath =\n      this.#fullpath ? this.#fullpath + s + pathPart : undefined\n    const pchild = this.newChild(pathPart, UNKNOWN, {\n      ...opts,\n      parent: this,\n      fullpath,\n    })\n\n    if (!this.canReaddir()) {\n      pchild.#type |= ENOENT\n    }\n\n    // don't have to update provisional, because if we have real children,\n    // then provisional is set to children.length, otherwise a lower number\n    children.push(pchild)\n    return pchild\n  }\n\n  /**\n   * The relative path from the cwd. If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpath()\n   */\n  relative(): string {\n    if (this.isCWD) return ''\n    if (this.#relative !== undefined) {\n      return this.#relative\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relative = this.name)\n    }\n    const pv = p.relative()\n    return pv + (!pv || !p.parent ? '' : this.sep) + name\n  }\n\n  /**\n   * The relative path from the cwd, using / as the path separator.\n   * If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpathPosix()\n   * On posix systems, this is identical to relative().\n   */\n  relativePosix(): string {\n    if (this.sep === '/') return this.relative()\n    if (this.isCWD) return ''\n    if (this.#relativePosix !== undefined) return this.#relativePosix\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relativePosix = this.fullpathPosix())\n    }\n    const pv = p.relativePosix()\n    return pv + (!pv || !p.parent ? '' : '/') + name\n  }\n\n  /**\n   * The fully resolved path string for this Path entry\n   */\n  fullpath(): string {\n    if (this.#fullpath !== undefined) {\n      return this.#fullpath\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#fullpath = this.name)\n    }\n    const pv = p.fullpath()\n    const fp = pv + (!p.parent ? '' : this.sep) + name\n    return (this.#fullpath = fp)\n  }\n\n  /**\n   * On platforms other than windows, this is identical to fullpath.\n   *\n   * On windows, this is overridden to return the forward-slash form of the\n   * full UNC path.\n   */\n  fullpathPosix(): string {\n    if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n    if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n    if (!this.parent) {\n      const p = this.fullpath().replace(/\\\\/g, '/')\n      if (/^[a-z]:\\//i.test(p)) {\n        return (this.#fullpathPosix = `//?/${p}`)\n      } else {\n        return (this.#fullpathPosix = p)\n      }\n    }\n    const p = this.parent\n    const pfpp = p.fullpathPosix()\n    const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n    return (this.#fullpathPosix = fpp)\n  }\n\n  /**\n   * Is the Path of an unknown type?\n   *\n   * Note that we might know *something* about it if there has been a previous\n   * filesystem operation, for example that it does not exist, or is not a\n   * link, or whether it has child entries.\n   */\n  isUnknown(): boolean {\n    return (this.#type & IFMT) === UNKNOWN\n  }\n\n  isType(type: Type): boolean {\n    return this[`is${type}`]()\n  }\n\n  getType(): Type {\n    return (\n      this.isUnknown() ? 'Unknown'\n      : this.isDirectory() ? 'Directory'\n      : this.isFile() ? 'File'\n      : this.isSymbolicLink() ? 'SymbolicLink'\n      : this.isFIFO() ? 'FIFO'\n      : this.isCharacterDevice() ? 'CharacterDevice'\n      : this.isBlockDevice() ? 'BlockDevice'\n      : /* c8 ignore start */ this.isSocket() ? 'Socket'\n      : 'Unknown'\n    )\n    /* c8 ignore stop */\n  }\n\n  /**\n   * Is the Path a regular file?\n   */\n  isFile(): boolean {\n    return (this.#type & IFMT) === IFREG\n  }\n\n  /**\n   * Is the Path a directory?\n   */\n  isDirectory(): boolean {\n    return (this.#type & IFMT) === IFDIR\n  }\n\n  /**\n   * Is the path a character device?\n   */\n  isCharacterDevice(): boolean {\n    return (this.#type & IFMT) === IFCHR\n  }\n\n  /**\n   * Is the path a block device?\n   */\n  isBlockDevice(): boolean {\n    return (this.#type & IFMT) === IFBLK\n  }\n\n  /**\n   * Is the path a FIFO pipe?\n   */\n  isFIFO(): boolean {\n    return (this.#type & IFMT) === IFIFO\n  }\n\n  /**\n   * Is the path a socket?\n   */\n  isSocket(): boolean {\n    return (this.#type & IFMT) === IFSOCK\n  }\n\n  /**\n   * Is the path a symbolic link?\n   */\n  isSymbolicLink(): boolean {\n    return (this.#type & IFLNK) === IFLNK\n  }\n\n  /**\n   * Return the entry if it has been subject of a successful lstat, or\n   * undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* simply\n   * mean that we haven't called lstat on it.\n   */\n  lstatCached(): PathBase | undefined {\n    return this.#type & LSTAT_CALLED ? this : undefined\n  }\n\n  /**\n   * Return the cached link target if the entry has been the subject of a\n   * successful readlink, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readlink() has been called at some point.\n   */\n  readlinkCached(): PathBase | undefined {\n    return this.#linkTarget\n  }\n\n  /**\n   * Returns the cached realpath target if the entry has been the subject\n   * of a successful realpath, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * realpath() has been called at some point.\n   */\n  realpathCached(): PathBase | undefined {\n    return this.#realpath\n  }\n\n  /**\n   * Returns the cached child Path entries array if the entry has been the\n   * subject of a successful readdir(), or [] otherwise.\n   *\n   * Does not read the filesystem, so an empty array *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readdir() has been called recently enough to still be valid.\n   */\n  readdirCached(): PathBase[] {\n    const children = this.children()\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * Return true if it's worth trying to readlink.  Ie, we don't (yet) have\n   * any indication that readlink will definitely fail.\n   *\n   * Returns false if the path is known to not be a symlink, if a previous\n   * readlink failed, or if the entry does not exist.\n   */\n  canReadlink(): boolean {\n    if (this.#linkTarget) return true\n    if (!this.parent) return false\n    // cases where it cannot possibly succeed\n    const ifmt = this.#type & IFMT\n    return !(\n      (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n      this.#type & ENOREADLINK ||\n      this.#type & ENOENT\n    )\n  }\n\n  /**\n   * Return true if readdir has previously been successfully called on this\n   * path, indicating that cachedReaddir() is likely valid.\n   */\n  calledReaddir(): boolean {\n    return !!(this.#type & READDIR_CALLED)\n  }\n\n  /**\n   * Returns true if the path is known to not exist. That is, a previous lstat\n   * or readdir failed to verify its existence when that would have been\n   * expected, or a parent entry was marked either enoent or enotdir.\n   */\n  isENOENT(): boolean {\n    return !!(this.#type & ENOENT)\n  }\n\n  /**\n   * Return true if the path is a match for the given path name.  This handles\n   * case sensitivity and unicode normalization.\n   *\n   * Note: even on case-sensitive systems, it is **not** safe to test the\n   * equality of the `.name` property to determine whether a given pathname\n   * matches, due to unicode normalization mismatches.\n   *\n   * Always use this method instead of testing the `path.name` property\n   * directly.\n   */\n  isNamed(n: string): boolean {\n    return !this.nocase ?\n        this.#matchName === normalize(n)\n      : this.#matchName === normalizeNocase(n)\n  }\n\n  /**\n   * Return the Path object corresponding to the target of a symbolic link.\n   *\n   * If the Path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   */\n  async readlink(): Promise {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = await this.#fs.promises.readlink(this.fullpath())\n      const linkTarget = (await this.parent.realpath())?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  /**\n   * Synchronous {@link PathBase.readlink}\n   */\n  readlinkSync(): PathBase | undefined {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = this.#fs.readlinkSync(this.fullpath())\n      const linkTarget = this.parent.realpathSync()?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  #readdirSuccess(children: Children) {\n    // succeeded, mark readdir called bit\n    this.#type |= READDIR_CALLED\n    // mark all remaining provisional children as ENOENT\n    for (let p = children.provisional; p < children.length; p++) {\n      const c = children[p]\n      if (c) c.#markENOENT()\n    }\n  }\n\n  #markENOENT() {\n    // mark as UNKNOWN and ENOENT\n    if (this.#type & ENOENT) return\n    this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n    this.#markChildrenENOENT()\n  }\n\n  #markChildrenENOENT() {\n    // all children are provisional and do not exist\n    const children = this.children()\n    children.provisional = 0\n    for (const p of children) {\n      p.#markENOENT()\n    }\n  }\n\n  #markENOREALPATH() {\n    this.#type |= ENOREALPATH\n    this.#markENOTDIR()\n  }\n\n  // save the information when we know the entry is not a dir\n  #markENOTDIR() {\n    // entry is not a directory, so any children can't exist.\n    // this *should* be impossible, since any children created\n    // after it's been marked ENOTDIR should be marked ENOENT,\n    // so it won't even get to this point.\n    /* c8 ignore start */\n    if (this.#type & ENOTDIR) return\n    /* c8 ignore stop */\n    let t = this.#type\n    // this could happen if we stat a dir, then delete it,\n    // then try to read it or one of its children.\n    if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n    this.#type = t | ENOTDIR\n    this.#markChildrenENOENT()\n  }\n\n  #readdirFail(code: string = '') {\n    // markENOTDIR and markENOENT also set provisional=0\n    if (code === 'ENOTDIR' || code === 'EPERM') {\n      this.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      this.#markENOENT()\n    } else {\n      this.children().provisional = 0\n    }\n  }\n\n  #lstatFail(code: string = '') {\n    // Windows just raises ENOENT in this case, disable for win CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR') {\n      // already know it has a parent by this point\n      const p = this.parent as PathBase\n      p.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      /* c8 ignore stop */\n      this.#markENOENT()\n    }\n  }\n\n  #readlinkFail(code: string = '') {\n    let ter = this.#type\n    ter |= ENOREADLINK\n    if (code === 'ENOENT') ter |= ENOENT\n    // windows gets a weird error when you try to readlink a file\n    if (code === 'EINVAL' || code === 'UNKNOWN') {\n      // exists, but not a symlink, we don't know WHAT it is, so remove\n      // all IFMT bits.\n      ter &= IFMT_UNKNOWN\n    }\n    this.#type = ter\n    // windows just gets ENOENT in this case.  We do cover the case,\n    // just disabled because it's impossible on Windows CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR' && this.parent) {\n      this.parent.#markENOTDIR()\n    }\n    /* c8 ignore stop */\n  }\n\n  #readdirAddChild(e: Dirent, c: Children) {\n    return (\n      this.#readdirMaybePromoteChild(e, c) ||\n      this.#readdirAddNewChild(e, c)\n    )\n  }\n\n  #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n    // alloc new entry at head, so it's never provisional\n    const type = entToType(e)\n    const child = this.newChild(e.name, type, { parent: this })\n    const ifmt = child.#type & IFMT\n    if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n      child.#type |= ENOTDIR\n    }\n    c.unshift(child)\n    c.provisional++\n    return child\n  }\n\n  #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n    for (let p = c.provisional; p < c.length; p++) {\n      const pchild = c[p]\n      const name =\n        this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n      if (name !== pchild!.#matchName) {\n        continue\n      }\n\n      return this.#readdirPromoteChild(e, pchild!, p, c)\n    }\n  }\n\n  #readdirPromoteChild(\n    e: Dirent,\n    p: PathBase,\n    index: number,\n    c: Children,\n  ): PathBase {\n    const v = p.name\n    // retain any other flags, but set ifmt from dirent\n    p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n    // case sensitivity fixing when we learn the true name.\n    if (v !== e.name) p.name = e.name\n\n    // just advance provisional index (potentially off the list),\n    // otherwise we have to splice/pop it out and re-insert at head\n    if (index !== c.provisional) {\n      if (index === c.length - 1) c.pop()\n      else c.splice(index, 1)\n      c.unshift(p)\n    }\n    c.provisional++\n    return p\n  }\n\n  /**\n   * Call lstat() on this Path, and update all known information that can be\n   * determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(): Promise {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  /**\n   * synchronous {@link PathBase.lstat}\n   */\n  lstatSync(): PathBase | undefined {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  #applyStat(st: Stats) {\n    const {\n      atime,\n      atimeMs,\n      birthtime,\n      birthtimeMs,\n      blksize,\n      blocks,\n      ctime,\n      ctimeMs,\n      dev,\n      gid,\n      ino,\n      mode,\n      mtime,\n      mtimeMs,\n      nlink,\n      rdev,\n      size,\n      uid,\n    } = st\n    this.#atime = atime\n    this.#atimeMs = atimeMs\n    this.#birthtime = birthtime\n    this.#birthtimeMs = birthtimeMs\n    this.#blksize = blksize\n    this.#blocks = blocks\n    this.#ctime = ctime\n    this.#ctimeMs = ctimeMs\n    this.#dev = dev\n    this.#gid = gid\n    this.#ino = ino\n    this.#mode = mode\n    this.#mtime = mtime\n    this.#mtimeMs = mtimeMs\n    this.#nlink = nlink\n    this.#rdev = rdev\n    this.#size = size\n    this.#uid = uid\n    const ifmt = entToType(st)\n    // retain any other flags, but set the ifmt\n    this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n    if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n      this.#type |= ENOTDIR\n    }\n  }\n\n  #onReaddirCB: ((\n    er: NodeJS.ErrnoException | null,\n    entries: Path[],\n  ) => any)[] = []\n  #readdirCBInFlight: boolean = false\n  #callOnReaddirCB(children: Path[]) {\n    this.#readdirCBInFlight = false\n    const cbs = this.#onReaddirCB.slice()\n    this.#onReaddirCB.length = 0\n    cbs.forEach(cb => cb(null, children))\n  }\n\n  /**\n   * Standard node-style callback interface to get list of directory entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * @param cb The callback called with (er, entries).  Note that the `er`\n   * param is somewhat extraneous, as all readdir() errors are handled and\n   * simply result in an empty set of entries being returned.\n   * @param allowZalgo Boolean indicating that immediately known results should\n   * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n   * zalgo at your peril, the dark pony lord is devious and unforgiving.\n   */\n  readdirCB(\n    cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n    allowZalgo: boolean = false,\n  ): void {\n    if (!this.canReaddir()) {\n      if (allowZalgo) cb(null, [])\n      else queueMicrotask(() => cb(null, []))\n      return\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      const c = children.slice(0, children.provisional)\n      if (allowZalgo) cb(null, c)\n      else queueMicrotask(() => cb(null, c))\n      return\n    }\n\n    // don't have to worry about zalgo at this point.\n    this.#onReaddirCB.push(cb)\n    if (this.#readdirCBInFlight) {\n      return\n    }\n    this.#readdirCBInFlight = true\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n      if (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      } else {\n        // if we didn't get an error, we always get entries.\n        //@ts-ignore\n        for (const e of entries) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      }\n      this.#callOnReaddirCB(children.slice(0, children.provisional))\n      return\n    })\n  }\n\n  #asyncReaddirInFlight?: Promise\n\n  /**\n   * Return an array of known child entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async readdir(): Promise {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    if (this.#asyncReaddirInFlight) {\n      await this.#asyncReaddirInFlight\n    } else {\n      /* c8 ignore start */\n      let resolve: () => void = () => {}\n      /* c8 ignore stop */\n      this.#asyncReaddirInFlight = new Promise(\n        res => (resolve = res),\n      )\n      try {\n        for (const e of await this.#fs.promises.readdir(fullpath, {\n          withFileTypes: true,\n        })) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      } catch (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      }\n      this.#asyncReaddirInFlight = undefined\n      resolve()\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * synchronous {@link PathBase.readdir}\n   */\n  readdirSync(): PathBase[] {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    try {\n      for (const e of this.#fs.readdirSync(fullpath, {\n        withFileTypes: true,\n      })) {\n        this.#readdirAddChild(e, children)\n      }\n      this.#readdirSuccess(children)\n    } catch (er) {\n      this.#readdirFail((er as NodeJS.ErrnoException).code)\n      children.provisional = 0\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  canReaddir() {\n    if (this.#type & ENOCHILD) return false\n    const ifmt = IFMT & this.#type\n    // we always set ENOTDIR when setting IFMT, so should be impossible\n    /* c8 ignore start */\n    if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n      return false\n    }\n    /* c8 ignore stop */\n    return true\n  }\n\n  shouldWalk(\n    dirs: Set,\n    walkFilter?: (e: PathBase) => boolean,\n  ): boolean {\n    return (\n      (this.#type & IFDIR) === IFDIR &&\n      !(this.#type & ENOCHILD) &&\n      !dirs.has(this) &&\n      (!walkFilter || walkFilter(this))\n    )\n  }\n\n  /**\n   * Return the Path object corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   * On success, returns a Path object.\n   */\n  async realpath(): Promise {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = await this.#fs.promises.realpath(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Synchronous {@link realpath}\n   */\n  realpathSync(): PathBase | undefined {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = this.#fs.realpathSync(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Internal method to mark this Path object as the scurry cwd,\n   * called by {@link PathScurry#chdir}\n   *\n   * @internal\n   */\n  [setAsCwd](oldCwd: PathBase): void {\n    if (oldCwd === this) return\n    oldCwd.isCWD = false\n    this.isCWD = true\n\n    const changed = new Set([])\n    let rp = []\n    let p: PathBase = this\n    while (p && p.parent) {\n      changed.add(p)\n      p.#relative = rp.join(this.sep)\n      p.#relativePosix = rp.join('/')\n      p = p.parent\n      rp.push('..')\n    }\n    // now un-memoize parents of old cwd\n    p = oldCwd\n    while (p && p.parent && !changed.has(p)) {\n      p.#relative = undefined\n      p.#relativePosix = undefined\n      p = p.parent\n    }\n  }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n  /**\n   * Separator for generating path strings.\n   */\n  sep: '\\\\' = '\\\\'\n  /**\n   * Separator for parsing path strings.\n   */\n  splitSep: RegExp = eitherSep\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathWin32(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return win32.parse(path).root\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(rootPath: string): PathBase {\n    rootPath = uncToDrive(rootPath.toUpperCase())\n    if (rootPath === this.root.name) {\n      return this.root\n    }\n    // ok, not that one, check if it matches another we know about\n    for (const [compare, root] of Object.entries(this.roots)) {\n      if (this.sameRoot(rootPath, compare)) {\n        return (this.roots[rootPath] = root)\n      }\n    }\n    // otherwise, have to create a new one.\n    return (this.roots[rootPath] = new PathScurryWin32(\n      rootPath,\n      this,\n    ).root)\n  }\n\n  /**\n   * @internal\n   */\n  sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n    // windows can (rarely) have case-sensitive filesystem, but\n    // UNC and drive letters are always case-insensitive, and canonically\n    // represented uppercase.\n    rootPath = rootPath\n      .toUpperCase()\n      .replace(/\\//g, '\\\\')\n      .replace(uncDriveRegexp, '$1\\\\')\n    return rootPath === compare\n  }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n  /**\n   * separator for parsing path strings\n   */\n  splitSep: '/' = '/'\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return path.startsWith('/') ? '/' : ''\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(_rootPath: string): PathBase {\n    return this.root\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathPosix(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n  /**\n   * perform case-insensitive path matching. Default based on platform\n   * subclass.\n   */\n  nocase?: boolean\n  /**\n   * Number of Path entries to keep in the cache of Path child references.\n   *\n   * Setting this higher than 65536 will dramatically increase the data\n   * consumption and construction time overhead of each PathScurry.\n   *\n   * Setting this value to 256 or lower will significantly reduce the data\n   * consumption and construction time overhead, but may also reduce resolve()\n   * and readdir() performance on large filesystems.\n   *\n   * Default `16384`.\n   */\n  childrenCacheSize?: number\n  /**\n   * An object that overrides the built-in functions from the fs and\n   * fs/promises modules.\n   *\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n  /**\n   * The root Path entry for the current working directory of this Scurry\n   */\n  root: PathBase\n  /**\n   * The string path for the root of this Scurry's current working directory\n   */\n  rootPath: string\n  /**\n   * A collection of all roots encountered, referenced by rootPath\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * The Path entry corresponding to this PathScurry's current working directory.\n   */\n  cwd: PathBase\n  #resolveCache: ResolveCache\n  #resolvePosixCache: ResolveCache\n  #children: ChildrenCache\n  /**\n   * Perform path comparisons case-insensitively.\n   *\n   * Defaults true on Darwin and Windows systems, false elsewhere.\n   */\n  nocase: boolean\n\n  /**\n   * The path separator used for parsing paths\n   *\n   * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n   */\n  abstract sep: string | RegExp\n\n  #fs: FSValue\n\n  /**\n   * This class should not be instantiated directly.\n   *\n   * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n   *\n   * @internal\n   */\n  constructor(\n    cwd: URL | string = process.cwd(),\n    pathImpl: typeof win32 | typeof posix,\n    sep: string | RegExp,\n    {\n      nocase,\n      childrenCacheSize = 16 * 1024,\n      fs = defaultFS,\n    }: PathScurryOpts = {},\n  ) {\n    this.#fs = fsFromOption(fs)\n    if (cwd instanceof URL || cwd.startsWith('file://')) {\n      cwd = fileURLToPath(cwd)\n    }\n    // resolve and split root, and then add to the store.\n    // this is the only time we call path.resolve()\n    const cwdPath = pathImpl.resolve(cwd)\n    this.roots = Object.create(null)\n    this.rootPath = this.parseRootPath(cwdPath)\n    this.#resolveCache = new ResolveCache()\n    this.#resolvePosixCache = new ResolveCache()\n    this.#children = new ChildrenCache(childrenCacheSize)\n\n    const split = cwdPath.substring(this.rootPath.length).split(sep)\n    // resolve('/') leaves '', splits to [''], we don't want that.\n    if (split.length === 1 && !split[0]) {\n      split.pop()\n    }\n    /* c8 ignore start */\n    if (nocase === undefined) {\n      throw new TypeError(\n        'must provide nocase setting to PathScurryBase ctor',\n      )\n    }\n    /* c8 ignore stop */\n    this.nocase = nocase\n    this.root = this.newRoot(this.#fs)\n    this.roots[this.rootPath] = this.root\n    let prev: PathBase = this.root\n    let len = split.length - 1\n    const joinSep = pathImpl.sep\n    let abs = this.rootPath\n    let sawFirst = false\n    for (const part of split) {\n      const l = len--\n      prev = prev.child(part, {\n        relative: new Array(l).fill('..').join(joinSep),\n        relativePosix: new Array(l).fill('..').join('/'),\n        fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n      })\n      sawFirst = true\n    }\n    this.cwd = prev\n  }\n\n  /**\n   * Get the depth of a provided path, string, or the cwd\n   */\n  depth(path: Path | string = this.cwd): number {\n    if (typeof path === 'string') {\n      path = this.cwd.resolve(path)\n    }\n    return path.depth()\n  }\n\n  /**\n   * Parse the root portion of a path string\n   *\n   * @internal\n   */\n  abstract parseRootPath(dir: string): string\n  /**\n   * create a new Path to use as root during construction.\n   *\n   * @internal\n   */\n  abstract newRoot(fs: FSValue): PathBase\n  /**\n   * Determine whether a given path string is absolute\n   */\n  abstract isAbsolute(p: string): boolean\n\n  /**\n   * Return the cache of child entries.  Exposed so subclasses can create\n   * child Path objects in a platform-specific way.\n   *\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolve(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolveCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpath()\n    this.#resolveCache.set(r, result)\n    return result\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string, returning\n   * the posix path.  Identical to .resolve() on posix systems, but on\n   * windows will return a forward-slash separated UNC path.\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolvePosix(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolvePosixCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpathPosix()\n    this.#resolvePosixCache.set(r, result)\n    return result\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or entry\n   */\n  relative(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relative()\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or\n   * entry, using / as the path delimiter, even on Windows.\n   */\n  relativePosix(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relativePosix()\n  }\n\n  /**\n   * Return the basename for the provided string or Path object\n   */\n  basename(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.name\n  }\n\n  /**\n   * Return the dirname for the provided string or Path object\n   */\n  dirname(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return (entry.parent || entry).fullpath()\n  }\n\n  /**\n   * Return an array of known child entries.\n   *\n   * First argument may be either a string, or a Path object.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n   * `{ withFileTypes: false }` to return strings.\n   */\n\n  readdir(): Promise\n  readdir(opts: { withFileTypes: true }): Promise\n  readdir(opts: { withFileTypes: false }): Promise\n  readdir(opts: { withFileTypes: boolean }): Promise\n  readdir(entry: PathBase | string): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): Promise\n  async readdir(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else {\n      const p = await entry.readdir()\n      return withFileTypes ? p : p.map(e => e.name)\n    }\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readdir}\n   */\n  readdirSync(): PathBase[]\n  readdirSync(opts: { withFileTypes: true }): PathBase[]\n  readdirSync(opts: { withFileTypes: false }): string[]\n  readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n  readdirSync(entry: PathBase | string): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): string[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): PathBase[] | string[]\n  readdirSync(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes = true } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else if (withFileTypes) {\n      return entry.readdirSync()\n    } else {\n      return entry.readdirSync().map(e => e.name)\n    }\n  }\n\n  /**\n   * Call lstat() on the string or Path object, and update all known\n   * information that can be determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(\n    entry: string | PathBase = this.cwd,\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstat()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.lstat}\n   */\n  lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstatSync()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to the target of a\n   * symbolic link.\n   *\n   * If the path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  readlink(): Promise\n  readlink(opt: { withFileTypes: false }): Promise\n  readlink(opt: { withFileTypes: true }): Promise\n  readlink(opt: {\n    withFileTypes: boolean\n  }): Promise\n  readlink(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async readlink(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.readlink()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readlink}\n   */\n  readlinkSync(): string | undefined\n  readlinkSync(opt: { withFileTypes: false }): string | undefined\n  readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n  readlinkSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.readlinkSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  realpath(): Promise\n  realpath(opt: { withFileTypes: false }): Promise\n  realpath(opt: { withFileTypes: true }): Promise\n  realpath(opt: {\n    withFileTypes: boolean\n  }): Promise\n  realpath(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async realpath(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.realpath()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  realpathSync(): string | undefined\n  realpathSync(opt: { withFileTypes: false }): string | undefined\n  realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n  realpathSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  realpathSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.realpathSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Asynchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walk(): Promise\n  walk(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(opts: WalkOptionsWithFileTypesFalse): Promise\n  walk(opts: WalkOptions): Promise\n  walk(entry: string | PathBase): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Promise\n  async walk(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const walk = (\n      dir: PathBase,\n      cb: (er?: NodeJS.ErrnoException) => void,\n    ) => {\n      dirs.add(dir)\n      dir.readdirCB((er, entries) => {\n        /* c8 ignore start */\n        if (er) {\n          return cb(er)\n        }\n        /* c8 ignore stop */\n        let len = entries.length\n        if (!len) return cb()\n        const next = () => {\n          if (--len === 0) {\n            cb()\n          }\n        }\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            results.push(withFileTypes ? e : e.fullpath())\n          }\n          if (follow && e.isSymbolicLink()) {\n            e.realpath()\n              .then(r => (r?.isUnknown() ? r.lstat() : r))\n              .then(r =>\n                r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n              )\n          } else {\n            if (e.shouldWalk(dirs, walkFilter)) {\n              walk(e, next)\n            } else {\n              next()\n            }\n          }\n        }\n      }, true) // zalgooooooo\n    }\n\n    const start = entry\n    return new Promise((res, rej) => {\n      walk(start, er => {\n        /* c8 ignore start */\n        if (er) return rej(er)\n        /* c8 ignore stop */\n        res(results as PathBase[] | string[])\n      })\n    })\n  }\n\n  /**\n   * Synchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walkSync(): PathBase[]\n  walkSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): PathBase[]\n  walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n  walkSync(opts: WalkOptions): string[] | PathBase[]\n  walkSync(entry: string | PathBase): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): string[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): PathBase[] | string[]\n  walkSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          results.push(withFileTypes ? e : e.fullpath())\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n    return results as string[] | PathBase[]\n  }\n\n  /**\n   * Support for `for await`\n   *\n   * Alias for {@link PathScurryBase.iterate}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n\n  /**\n   * Async generator form of {@link PathScurryBase.walk}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking, especially if most/all of the directory tree has been previously\n   * walked.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  iterate(): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(opts: WalkOptions): AsyncGenerator\n  iterate(entry: string | PathBase): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    options: WalkOptions = {},\n  ): AsyncGenerator {\n    // iterating async over the stream is significantly more performant,\n    // especially in the warm-cache scenario, because it buffers up directory\n    // entries in the background instead of waiting for a yield for each one.\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      options = entry\n      entry = this.cwd\n    }\n    return this.stream(entry, options)[Symbol.asyncIterator]()\n  }\n\n  /**\n   * Iterating over a PathScurry performs a synchronous walk.\n   *\n   * Alias for {@link PathScurryBase.iterateSync}\n   */\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  iterateSync(): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(opts: WalkOptions): Generator\n  iterateSync(entry: string | PathBase): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Generator\n  *iterateSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Generator {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    if (!filter || filter(entry)) {\n      yield withFileTypes ? entry : entry.fullpath()\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          yield withFileTypes ? e : e.fullpath()\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n  }\n\n  /**\n   * Stream form of {@link PathScurryBase.walk}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   */\n  stream(): Minipass\n  stream(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n  stream(opts: WalkOptions): Minipass\n  stream(entry: string | PathBase): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  stream(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n\n        processing++\n        dirs.add(dir)\n\n        const onReaddir = (\n          er: null | NodeJS.ErrnoException,\n          entries: PathBase[],\n          didRealpaths: boolean = false,\n        ) => {\n          /* c8 ignore start */\n          if (er) return results.emit('error', er)\n          /* c8 ignore stop */\n          if (follow && !didRealpaths) {\n            const promises: Promise[] = []\n            for (const e of entries) {\n              if (e.isSymbolicLink()) {\n                promises.push(\n                  e\n                    .realpath()\n                    .then((r: PathBase | undefined) =>\n                      r?.isUnknown() ? r.lstat() : r,\n                    ),\n                )\n              }\n            }\n            if (promises.length) {\n              Promise.all(promises).then(() =>\n                onReaddir(null, entries, true),\n              )\n              return\n            }\n          }\n\n          for (const e of entries) {\n            if (e && (!filter || filter(e))) {\n              if (!results.write(withFileTypes ? e : e.fullpath())) {\n                paused = true\n              }\n            }\n          }\n\n          processing--\n          for (const e of entries) {\n            const r = e.realpathCached() || e\n            if (r.shouldWalk(dirs, walkFilter)) {\n              queue.push(r)\n            }\n          }\n          if (paused && !results.flowing) {\n            results.once('drain', process)\n          } else if (!sync) {\n            process()\n          }\n        }\n\n        // zalgo containment\n        let sync = true\n        dir.readdirCB(onReaddir, true)\n        sync = false\n      }\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  /**\n   * Synchronous form of {@link PathScurryBase.stream}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   *\n   * Will complete the walk in a single tick if the stream is consumed fully.\n   * Otherwise, will pause as needed for stream backpressure.\n   */\n  streamSync(): Minipass\n  streamSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n  streamSync(opts: WalkOptions): Minipass\n  streamSync(entry: string | PathBase): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  streamSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    const dirs = new Set()\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n        processing++\n        dirs.add(dir)\n\n        const entries = dir.readdirSync()\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            if (!results.write(withFileTypes ? e : e.fullpath())) {\n              paused = true\n            }\n          }\n        }\n        processing--\n        for (const e of entries) {\n          let r: PathBase | undefined = e\n          if (e.isSymbolicLink()) {\n            if (!(follow && (r = e.realpathSync()))) continue\n            if (r.isUnknown()) r.lstatSync()\n          }\n          if (r.shouldWalk(dirs, walkFilter)) {\n            queue.push(r)\n          }\n        }\n      }\n      if (paused && !results.flowing) results.once('drain', process)\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  chdir(path: string | Path = this.cwd) {\n    const oldCwd = this.cwd\n    this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n    this.cwd[setAsCwd](oldCwd)\n  }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n  /**\n   * Return results as {@link PathBase} objects rather than strings.\n   * When set to false, results are fully resolved paths, as returned by\n   * {@link PathBase.fullpath}.\n   * @default true\n   */\n  withFileTypes?: boolean\n\n  /**\n   *  Attempt to read directory entries from symbolic links. Otherwise, only\n   *  actual directories are traversed. Regardless of this setting, a given\n   *  target path will only ever be walked once, meaning that a symbolic link\n   *  to a previously traversed directory will never be followed.\n   *\n   *  Setting this imposes a slight performance penalty, because `readlink`\n   *  must be called on all symbolic links encountered, in order to avoid\n   *  infinite cycles.\n   * @default false\n   */\n  follow?: boolean\n\n  /**\n   * Only return entries where the provided function returns true.\n   *\n   * This will not prevent directories from being traversed, even if they do\n   * not pass the filter, though it will prevent directories themselves from\n   * being included in the result set.  See {@link walkFilter}\n   *\n   * Asynchronous functions are not supported here.\n   *\n   * By default, if no filter is provided, all entries and traversed\n   * directories are included.\n   */\n  filter?: (entry: PathBase) => boolean\n\n  /**\n   * Only traverse directories (and in the case of {@link follow} being set to\n   * true, symbolic links to directories) if the provided function returns\n   * true.\n   *\n   * This will not prevent directories from being included in the result set,\n   * even if they do not pass the supplied filter function.  See {@link filter}\n   * to do that.\n   *\n   * Asynchronous functions are not supported here.\n   */\n  walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n  withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n  withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n  withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings.  Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '\\\\' = '\\\\'\n\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, win32, '\\\\', { ...opts, nocase })\n    this.nocase = nocase\n    for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n      p.nocase = this.nocase\n    }\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(dir: string): string {\n    // if the path starts with a single separator, it's not a UNC, and we'll\n    // just get separator as the root, and driveFromUNC will return \\\n    // In that case, mount \\ on the root from the cwd.\n    return win32.parse(dir).root.toUpperCase()\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathWin32(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return (\n      p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n    )\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = false } = opts\n    super(cwd, posix, '/', { ...opts, nocase })\n    this.nocase = nocase\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(_dir: string): string {\n    return '/'\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathPosix(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return p.startsWith('/')\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, { ...opts, nocase })\n  }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n  | typeof PathScurryWin32\n  | typeof PathScurryDarwin\n  | typeof PathScurryPosix =\n  process.platform === 'win32' ? PathScurryWin32\n  : process.platform === 'darwin' ? PathScurryDarwin\n  : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/package.json b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/path-scurry/package.json b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..68123fb70f16be142f3478bb81d5928a3035b99c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/path-scurry/package.json
@@ -0,0 +1,72 @@
+{
+  "name": "path-scurry",
+  "version": "2.0.2",
+  "description": "walk paths fast and efficiently",
+  "author": "Isaac Z. Schlueter  (https://blog.izs.me)",
+  "main": "./dist/commonjs/index.js",
+  "type": "module",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "license": "BlueOak-1.0.0",
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write . --log-level warn",
+    "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
+    "bench": "bash ./scripts/bench.sh"
+  },
+  "devDependencies": {
+    "@nodelib/fs.walk": "^3.0.1",
+    "@types/node": "^25.3.0",
+    "mkdirp": "^3.0.0",
+    "prettier": "^3.3.2",
+    "rimraf": "^6.1.3",
+    "tap": "^21.6.1",
+    "ts-node": "^10.9.2",
+    "tshy": "^3.3.2",
+    "typedoc": "^0.28.17"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/path-scurry"
+  },
+  "dependencies": {
+    "lru-cache": "^11.0.0",
+    "minipass": "^7.1.2"
+  },
+  "tshy": {
+    "selfLink": false,
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    }
+  },
+  "types": "./dist/commonjs/index.d.ts",
+  "module": "./dist/esm/index.js"
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.d.ts b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c617e9fd45e28cafb81b4446abce6cbfdfc98692
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.d.ts
@@ -0,0 +1,127 @@
+declare namespace prettyBytes {
+	interface Options {
+		/**
+		Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
+
+		@default false
+		*/
+		readonly signed?: boolean;
+
+		/**
+		- If `false`: Output won't be localized.
+		- If `true`: Localize the output using the system/browser locale.
+		- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
+		- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
+
+		__Note:__ Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime.
+
+		@default false
+		*/
+		readonly locale?: boolean | string | readonly string[];
+
+		/**
+		Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
+
+		@default false
+
+		@example
+		```
+		import prettyBytes = require('pretty-bytes');
+
+		prettyBytes(1337, {bits: true});
+		//=> '1.34 kbit'
+		```
+		*/
+		readonly bits?: boolean;
+
+		/**
+		Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
+
+		@default false
+
+		@example
+		```
+		import prettyBytes = require('pretty-bytes');
+
+		prettyBytes(1000, {binary: true});
+		//=> '1000 bit'
+
+		prettyBytes(1024, {binary: true});
+		//=> '1 kiB'
+		```
+		*/
+		readonly binary?: boolean;
+
+		/**
+		The minimum number of fraction digits to display.
+
+		If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
+
+		@default undefined
+
+		```
+		import prettyBytes = require('pretty-bytes');
+
+		// Show the number with at least 3 fractional digits
+		prettyBytes(1900, {minimumFractionDigits: 3});
+		//=> '1.900 kB'
+
+		prettyBytes(1900);
+		//=> '1.9 kB'
+		```
+		*/
+		readonly minimumFractionDigits?: number;
+
+
+		/**
+		The maximum number of fraction digits to display.
+
+		If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
+
+		@default undefined
+
+		```
+		import prettyBytes = require('pretty-bytes');
+
+		// Show the number with at most 1 fractional digit
+		prettyBytes(1920, {maximumFractionDigits: 1});
+		//=> '1.9 kB'
+
+		prettyBytes(1920);
+		//=> '1.92 kB'
+		```
+		*/
+		readonly maximumFractionDigits?: number;
+	}
+}
+
+/**
+Convert bytes to a human readable string: `1337` → `1.34 kB`.
+
+@param number - The number to format.
+
+@example
+```
+import prettyBytes = require('pretty-bytes');
+
+prettyBytes(1337);
+//=> '1.34 kB'
+
+prettyBytes(100);
+//=> '100 B'
+
+// Display file size differences
+prettyBytes(42, {signed: true});
+//=> '+42 B'
+
+// Localized output using German locale
+prettyBytes(1337, {locale: 'de'});
+//=> '1,34 kB'
+```
+*/
+declare function prettyBytes(
+	number: number,
+	options?: prettyBytes.Options
+): string;
+
+export = prettyBytes;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.js b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..661c4650a661a0e446666cb22ca740584ac04c6d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/index.js
@@ -0,0 +1,118 @@
+'use strict';
+
+const BYTE_UNITS = [
+	'B',
+	'kB',
+	'MB',
+	'GB',
+	'TB',
+	'PB',
+	'EB',
+	'ZB',
+	'YB'
+];
+
+const BIBYTE_UNITS = [
+	'B',
+	'kiB',
+	'MiB',
+	'GiB',
+	'TiB',
+	'PiB',
+	'EiB',
+	'ZiB',
+	'YiB'
+];
+
+const BIT_UNITS = [
+	'b',
+	'kbit',
+	'Mbit',
+	'Gbit',
+	'Tbit',
+	'Pbit',
+	'Ebit',
+	'Zbit',
+	'Ybit'
+];
+
+const BIBIT_UNITS = [
+	'b',
+	'kibit',
+	'Mibit',
+	'Gibit',
+	'Tibit',
+	'Pibit',
+	'Eibit',
+	'Zibit',
+	'Yibit'
+];
+
+/*
+Formats the given number using `Number#toLocaleString`.
+- If locale is a string, the value is expected to be a locale-key (for example: `de`).
+- If locale is true, the system default locale is used for translation.
+- If no value for locale is specified, the number is returned unmodified.
+*/
+const toLocaleString = (number, locale, options) => {
+	let result = number;
+	if (typeof locale === 'string' || Array.isArray(locale)) {
+		result = number.toLocaleString(locale, options);
+	} else if (locale === true || options !== undefined) {
+		result = number.toLocaleString(undefined, options);
+	}
+
+	return result;
+};
+
+module.exports = (number, options) => {
+	if (!Number.isFinite(number)) {
+		throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
+	}
+
+	options = Object.assign({bits: false, binary: false}, options);
+
+	const UNITS = options.bits ?
+		(options.binary ? BIBIT_UNITS : BIT_UNITS) :
+		(options.binary ? BIBYTE_UNITS : BYTE_UNITS);
+
+	if (options.signed && number === 0) {
+		return ` 0 ${UNITS[0]}`;
+	}
+
+	const isNegative = number < 0;
+	const prefix = isNegative ? '-' : (options.signed ? '+' : '');
+
+	if (isNegative) {
+		number = -number;
+	}
+
+	let localeOptions;
+
+	if (options.minimumFractionDigits !== undefined) {
+		localeOptions = {minimumFractionDigits: options.minimumFractionDigits};
+	}
+
+	if (options.maximumFractionDigits !== undefined) {
+		localeOptions = Object.assign({maximumFractionDigits: options.maximumFractionDigits}, localeOptions);
+	}
+
+	if (number < 1) {
+		const numberString = toLocaleString(number, options.locale, localeOptions);
+		return prefix + numberString + ' ' + UNITS[0];
+	}
+
+	const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
+	// eslint-disable-next-line unicorn/prefer-exponentiation-operator
+	number /= Math.pow(options.binary ? 1024 : 1000, exponent);
+
+	if (!localeOptions) {
+		number = number.toPrecision(3);
+	}
+
+	const numberString = toLocaleString(Number(number), options.locale, localeOptions);
+
+	const unit = UNITS[exponent];
+
+	return prefix + numberString + ' ' + unit;
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/license b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/license
new file mode 100644
index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus  (https://sindresorhus.com)
+
+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/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/package.json b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb090d430f01dd49ec02061ac6cbb51862b563eb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/package.json
@@ -0,0 +1,44 @@
+{
+	"name": "pretty-bytes",
+	"version": "5.6.0",
+	"description": "Convert bytes to a human readable string: 1337 → 1.34 kB",
+	"license": "MIT",
+	"repository": "sindresorhus/pretty-bytes",
+	"funding": "https://github.com/sponsors/sindresorhus",
+	"author": {
+		"name": "Sindre Sorhus",
+		"email": "sindresorhus@gmail.com",
+		"url": "https://sindresorhus.com"
+	},
+	"engines": {
+		"node": ">=6"
+	},
+	"scripts": {
+		"test": "xo && ava && tsd"
+	},
+	"files": [
+		"index.js",
+		"index.d.ts"
+	],
+	"keywords": [
+		"pretty",
+		"bytes",
+		"byte",
+		"filesize",
+		"size",
+		"file",
+		"human",
+		"humanized",
+		"readable",
+		"si",
+		"data",
+		"locale",
+		"localization",
+		"localized"
+	],
+	"devDependencies": {
+		"ava": "^1.4.1",
+		"tsd": "^0.7.2",
+		"xo": "^0.24.0"
+	}
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/readme.md b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..e33610c5f719f2e60bb03cdc91fcf274667a5be6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/pretty-bytes/readme.md
@@ -0,0 +1,131 @@
+# pretty-bytes
+
+> Convert bytes to a human readable string: `1337` → `1.34 kB`
+
+Useful for displaying file sizes for humans.
+
+*Note that it uses base-10 (e.g. kilobyte).
+[Read about the difference between kilobyte and kibibyte.](https://web.archive.org/web/20150324153922/https://pacoup.com/2009/05/26/kb-kb-kib-whats-up-with-that/)*
+
+## Install
+
+```
+$ npm install pretty-bytes
+```
+
+## Usage
+
+```js
+const prettyBytes = require('pretty-bytes');
+
+prettyBytes(1337);
+//=> '1.34 kB'
+
+prettyBytes(100);
+//=> '100 B'
+
+// Display with units of bits
+prettyBytes(1337, {bits: true});
+//=> '1.34 kbit'
+
+// Display file size differences
+prettyBytes(42, {signed: true});
+//=> '+42 B'
+
+// Localized output using German locale
+prettyBytes(1337, {locale: 'de'});
+//=> '1,34 kB'
+```
+
+## API
+
+### prettyBytes(number, options?)
+
+#### number
+
+Type: `number`
+
+The number to format.
+
+#### options
+
+Type: `object`
+
+##### signed
+
+Type: `boolean`\
+Default: `false`
+
+Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
+
+##### bits
+
+Type: `boolean`\
+Default: `false`
+
+Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
+
+##### binary
+
+Type: `boolean`\
+Default: `false`
+
+Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
+
+##### locale
+
+Type: `boolean | string`\
+Default: `false` *(No localization)*
+
+**Important:** Only the number and decimal separator are localized. The unit title is not and will not be localized.
+
+- If `true`: Localize the output using the system/browser locale.
+- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
+- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
+
+**Note:** Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime. [Node.js 13](https://nodejs.org/en/blog/release/v13.0.0/) and later ships with ICU by default.
+
+##### minimumFractionDigits
+
+Type: `number`\
+Default: `undefined`
+
+The minimum number of fraction digits to display.
+
+If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
+
+```js
+const prettyBytes = require('pretty-bytes');
+
+// Show the number with at least 3 fractional digits
+prettyBytes(1900, {minimumFractionDigits: 3});
+//=> '1.900 kB'
+
+prettyBytes(1900);
+//=> '1.9 kB'
+```
+
+##### maximumFractionDigits
+
+Type: `number`\
+Default: `undefined`
+
+The maximum number of fraction digits to display.
+
+If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
+
+```js
+const prettyBytes = require('pretty-bytes');
+
+// Show the number with at most 1 fractional digit
+prettyBytes(1920, {maximumFractionDigits: 1});
+//=> '1.9 kB'
+
+prettyBytes(1920);
+//=> '1.92 kB'
+```
+
+## Related
+
+- [pretty-bytes-cli](https://github.com/sindresorhus/pretty-bytes-cli) - CLI for this module
+- [pretty-ms](https://github.com/sindresorhus/pretty-ms) - Convert milliseconds to a human readable string
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/CHANGELOG.md b/tools/ui/node_modules/workbox-build/node_modules/source-map/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..3c8b806117535ad1488f597f331616813c61fa83
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/CHANGELOG.md
@@ -0,0 +1,379 @@
+# Change Log
+
+## 0.8.0-beta.0
+
+### Breaking changes
+
+* [#350](https://github.com/mozilla/source-map/pull/350) -
+  Change browser detection logic for WASM loading.
+* [#363](https://github.com/mozilla/source-map/pull/363) -
+  Change WASM loading detection to rely on `package.json#browser` field.
+* [#362](https://github.com/mozilla/source-map/pull/362) -
+  Remove the `dist/` bundle.
+* [#371](https://github.com/mozilla/source-map/pull/371) -
+  Reimplement sourcemap URL processing using the WHATWG URL API.
+
+### Nonbreaking changes:
+
+* [#339](https://github.com/mozilla/source-map/pull/339) -
+  Allow initializing the consumer `mappings.wasm` file as an `ArrayBuffer`.
+
+### Internal Improvements:
+
+* [#347](https://github.com/mozilla/source-map/pull/347) -
+  Improve tests.
+* [#352](https://github.com/mozilla/source-map/pull/352) -
+  Improve documentation.
+* [#361](https://github.com/mozilla/source-map/pull/361) -
+  Use newer Webpack CLI when bundling.
+* [#364](https://github.com/mozilla/source-map/pull/364) -
+  Convert `IndexedSourceMapConsumer` implementation to pass more through
+    to `BasicSourceMapConsumer`.
+* [#366](https://github.com/mozilla/source-map/pull/366) -
+  Normalize internal URL representation to be easier to follow.
+* [#341](https://github.com/mozilla/source-map/pull/341) -
+  Use async functions to simplify `SourceMapConsumer.with` implementation.
+
+
+## 0.7.3
+
+* Fix a bug where nested uses of `SourceMapConsumer` could result in a
+  `TypeError`. [#338](https://github.com/mozilla/source-map/issues/338)
+  [#330](https://github.com/mozilla/source-map/issues/330)
+  [#319](https://github.com/mozilla/source-map/issues/319)
+
+## 0.7.2
+
+* Another 3x speed up in `SourceMapConsumer`. Read about it here:
+  http://fitzgeraldnick.com/2018/02/26/speed-without-wizardry.html
+
+## 0.7.1
+
+* Updated TypeScript typings. [#321][]
+
+[#321]: https://github.com/mozilla/source-map/pull/321
+
+## 0.7.0
+
+* `SourceMapConsumer` now uses WebAssembly, and is **much** faster! Read about
+  it here:
+  https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with-rust-and-webassembly/
+
+* **Breaking change:** `new SourceMapConsumer` now returns a `Promise` object
+  that resolves to the newly constructed `SourceMapConsumer` instance, rather
+  than returning the new instance immediately.
+
+* **Breaking change:** when you're done using a `SourceMapConsumer` instance,
+  you must call `SourceMapConsumer.prototype.destroy` on it. After calling
+  `destroy`, you must not use the instance again.
+
+* **Breaking change:** `SourceMapConsumer` used to be able to handle lines,
+  columns numbers and source and name indices up to `2^53 - 1` (aka
+  `Number.MAX_SAFE_INTEGER`). It can now only handle them up to `2^32 - 1`.
+
+* **Breaking change:** The `source-map` library now uses modern ECMAScript-isms:
+  `let`, arrow functions, `async`, etc. Use Babel to compile it down to
+  ECMAScript 5 if you need to support older JavaScript environments.
+
+* **Breaking change:** Drop support for Node < 8. If you want to support older
+versions of node, please use v0.6 or below.
+
+## 0.5.6
+
+* Fix for regression when people were using numbers as names in source maps. See
+  #236.
+
+## 0.5.5
+
+* Fix "regression" of unsupported, implementation behavior that half the world
+  happens to have come to depend on. See #235.
+
+* Fix regression involving function hoisting in SpiderMonkey. See #233.
+
+## 0.5.4
+
+* Large performance improvements to source-map serialization. See #228 and #229.
+
+## 0.5.3
+
+* Do not include unnecessary distribution files. See
+  commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
+
+## 0.5.2
+
+* Include browser distributions of the library in package.json's `files`. See
+  issue #212.
+
+## 0.5.1
+
+* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
+  ff05274becc9e6e1295ed60f3ea090d31d843379.
+
+## 0.5.0
+
+* Node 0.8 is no longer supported.
+
+* Use webpack instead of dryice for bundling.
+
+* Big speedups serializing source maps. See pull request #203.
+
+* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
+  explicitly start with the source root. See issue #199.
+
+## 0.4.4
+
+* Fix an issue where using a `SourceMapGenerator` after having created a
+  `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
+  issue #191.
+
+* Fix an issue with where `SourceMapGenerator` would mistakenly consider
+  different mappings as duplicates of each other and avoid generating them. See
+  issue #192.
+
+## 0.4.3
+
+* A very large number of performance improvements, particularly when parsing
+  source maps. Collectively about 75% of time shaved off of the source map
+  parsing benchmark!
+
+* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
+  searching in the presence of a column option. See issue #177.
+
+* Fix a bug with joining a source and its source root when the source is above
+  the root. See issue #182.
+
+* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
+  determine when all sources' contents are inlined into the source map. See
+  issue #190.
+
+## 0.4.2
+
+* Add an `.npmignore` file so that the benchmarks aren't pulled down by
+  dependent projects. Issue #169.
+
+* Add an optional `column` argument to
+  `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
+  with no mappings. Issues #172 and #173.
+
+## 0.4.1
+
+* Fix accidentally defining a global variable. #170.
+
+## 0.4.0
+
+* The default direction for fuzzy searching was changed back to its original
+  direction. See #164.
+
+* There is now a `bias` option you can supply to `SourceMapConsumer` to control
+  the fuzzy searching direction. See #167.
+
+* About an 8% speed up in parsing source maps. See #159.
+
+* Added a benchmark for parsing and generating source maps.
+
+## 0.3.0
+
+* Change the default direction that searching for positions fuzzes when there is
+  not an exact match. See #154.
+
+* Support for environments using json2.js for JSON serialization. See #156.
+
+## 0.2.0
+
+* Support for consuming "indexed" source maps which do not have any remote
+  sections. See pull request #127. This introduces a minor backwards
+  incompatibility if you are monkey patching `SourceMapConsumer.prototype`
+  methods.
+
+## 0.1.43
+
+* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
+  #148 for some discussion and issues #150, #151, and #152 for implementations.
+
+## 0.1.42
+
+* Fix an issue where `SourceNode`s from different versions of the source-map
+  library couldn't be used in conjunction with each other. See issue #142.
+
+## 0.1.41
+
+* Fix a bug with getting the source content of relative sources with a "./"
+  prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
+
+* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
+  column span of each mapping.
+
+* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
+  all generated positions associated with a given original source and line.
+
+## 0.1.40
+
+* Performance improvements for parsing source maps in SourceMapConsumer.
+
+## 0.1.39
+
+* Fix a bug where setting a source's contents to null before any source content
+  had been set before threw a TypeError. See issue #131.
+
+## 0.1.38
+
+* Fix a bug where finding relative paths from an empty path were creating
+  absolute paths. See issue #129.
+
+## 0.1.37
+
+* Fix a bug where if the source root was an empty string, relative source paths
+  would turn into absolute source paths. Issue #124.
+
+## 0.1.36
+
+* Allow the `names` mapping property to be an empty string. Issue #121.
+
+## 0.1.35
+
+* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
+  to specify a path that relative sources in the second parameter should be
+  relative to. Issue #105.
+
+* If no file property is given to a `SourceMapGenerator`, then the resulting
+  source map will no longer have a `null` file property. The property will
+  simply not exist. Issue #104.
+
+* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
+  Issue #116.
+
+## 0.1.34
+
+* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
+
+* Fix bug involving source contents and the
+  `SourceMapGenerator.prototype.applySourceMap`. Issue #100.
+
+## 0.1.33
+
+* Fix some edge cases surrounding path joining and URL resolution.
+
+* Add a third parameter for relative path to
+  `SourceMapGenerator.prototype.applySourceMap`.
+
+* Fix issues with mappings and EOLs.
+
+## 0.1.32
+
+* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
+  (issue 92).
+
+* Fixed test runner to actually report number of failed tests as its process
+  exit code.
+
+* Fixed a typo when reporting bad mappings (issue 87).
+
+## 0.1.31
+
+* Delay parsing the mappings in SourceMapConsumer until queried for a source
+  location.
+
+* Support Sass source maps (which at the time of writing deviate from the spec
+  in small ways) in SourceMapConsumer.
+
+## 0.1.30
+
+* Do not join source root with a source, when the source is a data URI.
+
+* Extend the test runner to allow running single specific test files at a time.
+
+* Performance improvements in `SourceNode.prototype.walk` and
+  `SourceMapConsumer.prototype.eachMapping`.
+
+* Source map browser builds will now work inside Workers.
+
+* Better error messages when attempting to add an invalid mapping to a
+  `SourceMapGenerator`.
+
+## 0.1.29
+
+* Allow duplicate entries in the `names` and `sources` arrays of source maps
+  (usually from TypeScript) we are parsing. Fixes github issue 72.
+
+## 0.1.28
+
+* Skip duplicate mappings when creating source maps from SourceNode; github
+  issue 75.
+
+## 0.1.27
+
+* Don't throw an error when the `file` property is missing in SourceMapConsumer,
+  we don't use it anyway.
+
+## 0.1.26
+
+* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
+
+## 0.1.25
+
+* Make compatible with browserify
+
+## 0.1.24
+
+* Fix issue with absolute paths and `file://` URIs. See
+  https://bugzilla.mozilla.org/show_bug.cgi?id=885597
+
+## 0.1.23
+
+* Fix issue with absolute paths and sourcesContent, github issue 64.
+
+## 0.1.22
+
+* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
+
+## 0.1.21
+
+* Fixed handling of sources that start with a slash so that they are relative to
+  the source root's host.
+
+## 0.1.20
+
+* Fixed github issue #43: absolute URLs aren't joined with the source root
+  anymore.
+
+## 0.1.19
+
+* Using Travis CI to run tests.
+
+## 0.1.18
+
+* Fixed a bug in the handling of sourceRoot.
+
+## 0.1.17
+
+* Added SourceNode.fromStringWithSourceMap.
+
+## 0.1.16
+
+* Added missing documentation.
+
+* Fixed the generating of empty mappings in SourceNode.
+
+## 0.1.15
+
+* Added SourceMapGenerator.applySourceMap.
+
+## 0.1.14
+
+* The sourceRoot is now handled consistently.
+
+## 0.1.13
+
+* Added SourceMapGenerator.fromSourceMap.
+
+## 0.1.12
+
+* SourceNode now generates empty mappings too.
+
+## 0.1.11
+
+* Added name support to SourceNode.
+
+## 0.1.10
+
+* Added sourcesContent support to the customer and generator.
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/LICENSE b/tools/ui/node_modules/workbox-build/node_modules/source-map/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..ed1b7cf27e97e136918e87ad7bb33baf169f0171
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/LICENSE
@@ -0,0 +1,28 @@
+
+Copyright (c) 2009-2011, Mozilla Foundation and contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the names of the Mozilla Foundation nor the names of project
+  contributors may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/README.md b/tools/ui/node_modules/workbox-build/node_modules/source-map/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..56e5ac3e8ffd72874201e91c2f45ceb1b614fb2f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/README.md
@@ -0,0 +1,822 @@
+# Source Map
+
+[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map)
+
+[![Coverage Status](https://coveralls.io/repos/github/mozilla/source-map/badge.svg)](https://coveralls.io/github/mozilla/source-map)
+
+[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map)
+
+This is a library to generate and consume the source map format
+[described here][format].
+
+[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
+
+## Use with Node
+
+    $ npm install source-map
+
+## Use on the Web
+
+    
+    
+
+--------------------------------------------------------------------------------
+
+
+
+
+
+## Table of Contents
+
+- [Examples](#examples)
+  - [Consuming a source map](#consuming-a-source-map)
+  - [Generating a source map](#generating-a-source-map)
+    - [With SourceNode (high level API)](#with-sourcenode-high-level-api)
+    - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
+- [API](#api)
+  - [SourceMapConsumer](#sourcemapconsumer)
+    - [SourceMapConsumer.initialize(options)](#sourcemapconsumerinitializeoptions)
+    - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
+    - [SourceMapConsumer.with](#sourcemapconsumerwith)
+    - [SourceMapConsumer.prototype.destroy()](#sourcemapconsumerprototypedestroy)
+    - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
+    - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
+    - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
+    - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
+    - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
+    - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
+    - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
+  - [SourceMapGenerator](#sourcemapgenerator)
+    - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
+    - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
+    - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
+    - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
+    - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
+    - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
+  - [SourceNode](#sourcenode)
+    - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
+    - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
+    - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
+    - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
+    - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
+    - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
+    - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
+    - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
+    - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
+    - [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
+    - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
+
+
+
+## Examples
+
+### Consuming a source map
+
+```js
+const rawSourceMap = {
+  version: 3,
+  file: 'min.js',
+  names: ['bar', 'baz', 'n'],
+  sources: ['one.js', 'two.js'],
+  sourceRoot: 'http://example.com/www/js/',
+  mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+};
+
+const whatever = await SourceMapConsumer.with(rawSourceMap, null, consumer => {
+
+  console.log(consumer.sources);
+  // [ 'http://example.com/www/js/one.js',
+  //   'http://example.com/www/js/two.js' ]
+
+  console.log(consumer.originalPositionFor({
+    line: 2,
+    column: 28
+  }));
+  // { source: 'http://example.com/www/js/two.js',
+  //   line: 2,
+  //   column: 10,
+  //   name: 'n' }
+
+  console.log(consumer.generatedPositionFor({
+    source: 'http://example.com/www/js/two.js',
+    line: 2,
+    column: 10
+  }));
+  // { line: 2, column: 28 }
+
+  consumer.eachMapping(function (m) {
+    // ...
+  });
+
+  return computeWhatever();
+});
+```
+
+### Generating a source map
+
+In depth guide:
+[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
+
+#### With SourceNode (high level API)
+
+```js
+function compile(ast) {
+  switch (ast.type) {
+  case 'BinaryExpression':
+    return new SourceNode(
+      ast.location.line,
+      ast.location.column,
+      ast.location.source,
+      [compile(ast.left), " + ", compile(ast.right)]
+    );
+  case 'Literal':
+    return new SourceNode(
+      ast.location.line,
+      ast.location.column,
+      ast.location.source,
+      String(ast.value)
+    );
+  // ...
+  default:
+    throw new Error("Bad AST");
+  }
+}
+
+var ast = parse("40 + 2", "add.js");
+console.log(compile(ast).toStringWithSourceMap({
+  file: 'add.js'
+}));
+// { code: '40 + 2',
+//   map: [object SourceMapGenerator] }
+```
+
+#### With SourceMapGenerator (low level API)
+
+```js
+var map = new SourceMapGenerator({
+  file: "source-mapped.js"
+});
+
+map.addMapping({
+  generated: {
+    line: 10,
+    column: 35
+  },
+  source: "foo.js",
+  original: {
+    line: 33,
+    column: 2
+  },
+  name: "christopher"
+});
+
+console.log(map.toString());
+// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
+```
+
+## API
+
+Get a reference to the module:
+
+```js
+// Node.js
+var sourceMap = require('source-map');
+
+// Browser builds
+var sourceMap = window.sourceMap;
+
+// Inside Firefox
+const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
+```
+
+### SourceMapConsumer
+
+A `SourceMapConsumer` instance represents a parsed source map which we can query
+for information about the original file positions by giving it a file position
+in the generated source.
+
+#### SourceMapConsumer.initialize(options)
+
+When using `SourceMapConsumer` outside of node.js, for example on the Web, it
+needs to know from what URL to load `lib/mappings.wasm`. You must inform it by
+calling `initialize` before constructing any `SourceMapConsumer`s.
+
+The options object has the following properties:
+
+* `"lib/mappings.wasm"`: A `String` containing the URL of the
+  `lib/mappings.wasm` file, or an `ArrayBuffer` with the contents of `lib/mappings.wasm`.
+
+```js
+sourceMap.SourceMapConsumer.initialize({
+  "lib/mappings.wasm": "https://example.com/source-map/lib/mappings.wasm"
+});
+```
+
+#### new SourceMapConsumer(rawSourceMap)
+
+The only parameter is the raw source map (either as a string which can be
+`JSON.parse`'d, or an object). According to the spec, source maps have the
+following attributes:
+
+* `version`: Which version of the source map spec this map is following.
+
+* `sources`: An array of URLs to the original source files.
+
+* `names`: An array of identifiers which can be referenced by individual
+  mappings.
+
+* `sourceRoot`: Optional. The URL root from which all sources are relative.
+
+* `sourcesContent`: Optional. An array of contents of the original source files.
+
+* `mappings`: A string of base64 VLQs which contain the actual mappings.
+
+* `file`: Optional. The generated filename this source map is associated with.
+
+The promise of the constructed souce map consumer is returned.
+
+When the `SourceMapConsumer` will no longer be used anymore, you must call its
+`destroy` method.
+
+```js
+const consumer = await new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
+doStuffWith(consumer);
+consumer.destroy();
+```
+
+Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember
+to call `destroy`.
+
+#### SourceMapConsumer.with
+
+Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
+(see the `SourceMapConsumer` constructor for details. Then, invoke the `async
+function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
+for `f` to complete, call `destroy` on the consumer, and return `f`'s return
+value.
+
+You must not use the consumer after `f` completes!
+
+By using `with`, you do not have to remember to manually call `destroy` on
+the consumer, since it will be called automatically once `f` completes.
+
+```js
+const xSquared = await SourceMapConsumer.with(
+  myRawSourceMap,
+  null,
+  async function (consumer) {
+    // Use `consumer` inside here and don't worry about remembering
+    // to call `destroy`.
+
+    const x = await whatever(consumer);
+    return x * x;
+  }
+);
+
+// You may not use that `consumer` anymore out here; it has
+// been destroyed. But you can use `xSquared`.
+console.log(xSquared);
+```
+
+#### SourceMapConsumer.prototype.destroy()
+
+Free this source map consumer's associated wasm data that is manually-managed.
+
+```js
+consumer.destroy();
+```
+
+Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember
+to call `destroy`.
+
+#### SourceMapConsumer.prototype.computeColumnSpans()
+
+Compute the last column for each generated mapping. The last column is
+inclusive.
+
+```js
+// Before:
+consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
+// [ { line: 2,
+//     column: 1 },
+//   { line: 2,
+//     column: 10 },
+//   { line: 2,
+//     column: 20 } ]
+
+consumer.computeColumnSpans();
+
+// After:
+consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
+// [ { line: 2,
+//     column: 1,
+//     lastColumn: 9 },
+//   { line: 2,
+//     column: 10,
+//     lastColumn: 19 },
+//   { line: 2,
+//     column: 20,
+//     lastColumn: Infinity } ]
+```
+
+#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
+
+Returns the original source, line, and column information for the generated
+source's line and column positions provided. The only argument is an object with
+the following properties:
+
+* `line`: The line number in the generated source.  Line numbers in
+  this library are 1-based (note that the underlying source map
+  specification uses 0-based line numbers -- this library handles the
+  translation).
+
+* `column`: The column number in the generated source.  Column numbers
+  in this library are 0-based.
+
+* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
+  `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
+  element that is smaller than or greater than the one we are searching for,
+  respectively, if the exact element cannot be found.  Defaults to
+  `SourceMapConsumer.GREATEST_LOWER_BOUND`.
+
+and an object is returned with the following properties:
+
+* `source`: The original source file, or null if this information is not
+  available.
+
+* `line`: The line number in the original source, or null if this information is
+  not available.  The line number is 1-based.
+
+* `column`: The column number in the original source, or null if this
+  information is not available.  The column number is 0-based.
+
+* `name`: The original identifier, or null if this information is not available.
+
+```js
+consumer.originalPositionFor({ line: 2, column: 10 })
+// { source: 'foo.coffee',
+//   line: 2,
+//   column: 2,
+//   name: null }
+
+consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
+// { source: null,
+//   line: null,
+//   column: null,
+//   name: null }
+```
+
+#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
+
+Returns the generated line and column information for the original source,
+line, and column positions provided. The only argument is an object with
+the following properties:
+
+* `source`: The filename of the original source.
+
+* `line`: The line number in the original source.  The line number is
+  1-based.
+
+* `column`: The column number in the original source.  The column
+  number is 0-based.
+
+and an object is returned with the following properties:
+
+* `line`: The line number in the generated source, or null.  The line
+  number is 1-based.
+
+* `column`: The column number in the generated source, or null.  The
+  column number is 0-based.
+
+```js
+consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
+// { line: 1,
+//   column: 56 }
+```
+
+#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
+
+Returns all generated line and column information for the original source, line,
+and column provided. If no column is provided, returns all mappings
+corresponding to a either the line we are searching for or the next closest line
+that has any mappings. Otherwise, returns all mappings corresponding to the
+given line and either the column we are searching for or the next closest column
+that has any offsets.
+
+The only argument is an object with the following properties:
+
+* `source`: The filename of the original source.
+
+* `line`: The line number in the original source.  The line number is
+  1-based.
+
+* `column`: Optional. The column number in the original source.  The
+  column number is 0-based.
+
+and an array of objects is returned, each with the following properties:
+
+* `line`: The line number in the generated source, or null.  The line
+  number is 1-based.
+
+* `column`: The column number in the generated source, or null.  The
+  column number is 0-based.
+
+```js
+consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
+// [ { line: 2,
+//     column: 1 },
+//   { line: 2,
+//     column: 10 },
+//   { line: 2,
+//     column: 20 } ]
+```
+
+#### SourceMapConsumer.prototype.hasContentsOfAllSources()
+
+Return true if we have the embedded source content for every source listed in
+the source map, false otherwise.
+
+In other words, if this method returns `true`, then
+`consumer.sourceContentFor(s)` will succeed for every source `s` in
+`consumer.sources`.
+
+```js
+// ...
+if (consumer.hasContentsOfAllSources()) {
+  consumerReadyCallback(consumer);
+} else {
+  fetchSources(consumer, consumerReadyCallback);
+}
+// ...
+```
+
+#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
+
+Returns the original source content for the source provided. The only
+argument is the URL of the original source file.
+
+If the source content for the given source is not found, then an error is
+thrown. Optionally, pass `true` as the second param to have `null` returned
+instead.
+
+```js
+consumer.sources
+// [ "my-cool-lib.clj" ]
+
+consumer.sourceContentFor("my-cool-lib.clj")
+// "..."
+
+consumer.sourceContentFor("this is not in the source map");
+// Error: "this is not in the source map" is not in the source map
+
+consumer.sourceContentFor("this is not in the source map", true);
+// null
+```
+
+#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
+
+Iterate over each mapping between an original source/line/column and a
+generated line/column in this source map.
+
+* `callback`: The function that is called with each mapping. Mappings have the
+  form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
+  name }`
+
+* `context`: Optional. If specified, this object will be the value of `this`
+  every time that `callback` is called.
+
+* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
+  `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
+  the mappings sorted by the generated file's line/column order or the
+  original's source/line/column order, respectively. Defaults to
+  `SourceMapConsumer.GENERATED_ORDER`.
+
+```js
+consumer.eachMapping(function (m) { console.log(m); })
+// ...
+// { source: 'illmatic.js',
+//   generatedLine: 1,
+//   generatedColumn: 0,
+//   originalLine: 1,
+//   originalColumn: 0,
+//   name: null }
+// { source: 'illmatic.js',
+//   generatedLine: 2,
+//   generatedColumn: 0,
+//   originalLine: 2,
+//   originalColumn: 0,
+//   name: null }
+// ...
+```
+### SourceMapGenerator
+
+An instance of the SourceMapGenerator represents a source map which is being
+built incrementally.
+
+#### new SourceMapGenerator([startOfSourceMap])
+
+You may pass an object with the following properties:
+
+* `file`: The filename of the generated source that this source map is
+  associated with.
+
+* `sourceRoot`: A root for all relative URLs in this source map.
+
+* `skipValidation`: Optional. When `true`, disables validation of mappings as
+  they are added. This can improve performance but should be used with
+  discretion, as a last resort. Even then, one should avoid using this flag when
+  running tests, if possible.
+
+```js
+var generator = new sourceMap.SourceMapGenerator({
+  file: "my-generated-javascript-file.js",
+  sourceRoot: "http://example.com/app/js/"
+});
+```
+
+#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
+
+Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
+
+* `sourceMapConsumer` The SourceMap.
+
+```js
+var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
+```
+
+#### SourceMapGenerator.prototype.addMapping(mapping)
+
+Add a single mapping from original source line and column to the generated
+source's line and column for this source map being created. The mapping object
+should have the following properties:
+
+* `generated`: An object with the generated line and column positions.
+
+* `original`: An object with the original line and column positions.
+
+* `source`: The original source file (relative to the sourceRoot).
+
+* `name`: An optional original token name for this mapping.
+
+```js
+generator.addMapping({
+  source: "module-one.scm",
+  original: { line: 128, column: 0 },
+  generated: { line: 3, column: 456 }
+})
+```
+
+#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
+
+Set the source content for an original source file.
+
+* `sourceFile` the URL of the original source file.
+
+* `sourceContent` the content of the source file.
+
+```js
+generator.setSourceContent("module-one.scm",
+                           fs.readFileSync("path/to/module-one.scm"))
+```
+
+#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
+
+Applies a SourceMap for a source file to the SourceMap.
+Each mapping to the supplied source file is rewritten using the
+supplied SourceMap. Note: The resolution for the resulting mappings
+is the minimum of this map and the supplied map.
+
+* `sourceMapConsumer`: The SourceMap to be applied.
+
+* `sourceFile`: Optional. The filename of the source file.
+  If omitted, sourceMapConsumer.file will be used, if it exists.
+  Otherwise an error will be thrown.
+
+* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
+  to be applied. If relative, it is relative to the SourceMap.
+
+  This parameter is needed when the two SourceMaps aren't in the same
+  directory, and the SourceMap to be applied contains relative source
+  paths. If so, those relative source paths need to be rewritten
+  relative to the SourceMap.
+
+  If omitted, it is assumed that both SourceMaps are in the same directory,
+  thus not needing any rewriting. (Supplying `'.'` has the same effect.)
+
+#### SourceMapGenerator.prototype.toString()
+
+Renders the source map being generated to a string.
+
+```js
+generator.toString()
+// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
+```
+
+### SourceNode
+
+SourceNodes provide a way to abstract over interpolating and/or concatenating
+snippets of generated JavaScript source code, while maintaining the line and
+column information associated between those snippets and the original source
+code. This is useful as the final intermediate representation a compiler might
+use before outputting the generated JS and source map.
+
+#### new SourceNode([line, column, source[, chunk[, name]]])
+
+* `line`: The original line number associated with this source node, or null if
+  it isn't associated with an original line.  The line number is 1-based.
+
+* `column`: The original column number associated with this source node, or null
+  if it isn't associated with an original column.  The column number
+  is 0-based.
+
+* `source`: The original source's filename; null if no filename is provided.
+
+* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
+  below.
+
+* `name`: Optional. The original identifier.
+
+```js
+var node = new SourceNode(1, 2, "a.cpp", [
+  new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
+  new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
+  new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
+]);
+```
+
+#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
+
+Creates a SourceNode from generated code and a SourceMapConsumer.
+
+* `code`: The generated code
+
+* `sourceMapConsumer` The SourceMap for the generated code
+
+* `relativePath` The optional path that relative sources in `sourceMapConsumer`
+  should be relative to.
+
+```js
+const consumer = await new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
+const node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), consumer);
+```
+
+#### SourceNode.prototype.add(chunk)
+
+Add a chunk of generated JS to this source node.
+
+* `chunk`: A string snippet of generated JS code, another instance of
+   `SourceNode`, or an array where each member is one of those things.
+
+```js
+node.add(" + ");
+node.add(otherNode);
+node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
+```
+
+#### SourceNode.prototype.prepend(chunk)
+
+Prepend a chunk of generated JS to this source node.
+
+* `chunk`: A string snippet of generated JS code, another instance of
+   `SourceNode`, or an array where each member is one of those things.
+
+```js
+node.prepend("/** Build Id: f783haef86324gf **/\n\n");
+```
+
+#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
+
+Set the source content for a source file. This will be added to the
+`SourceMap` in the `sourcesContent` field.
+
+* `sourceFile`: The filename of the source file
+
+* `sourceContent`: The content of the source file
+
+```js
+node.setSourceContent("module-one.scm",
+                      fs.readFileSync("path/to/module-one.scm"))
+```
+
+#### SourceNode.prototype.walk(fn)
+
+Walk over the tree of JS snippets in this node and its children. The walking
+function is called once for each snippet of JS and is passed that snippet and
+the its original associated source's line/column location.
+
+* `fn`: The traversal function.
+
+```js
+var node = new SourceNode(1, 2, "a.js", [
+  new SourceNode(3, 4, "b.js", "uno"),
+  "dos",
+  [
+    "tres",
+    new SourceNode(5, 6, "c.js", "quatro")
+  ]
+]);
+
+node.walk(function (code, loc) { console.log("WALK:", code, loc); })
+// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
+// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
+// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
+// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
+```
+
+#### SourceNode.prototype.walkSourceContents(fn)
+
+Walk over the tree of SourceNodes. The walking function is called for each
+source file content and is passed the filename and source content.
+
+* `fn`: The traversal function.
+
+```js
+var a = new SourceNode(1, 2, "a.js", "generated from a");
+a.setSourceContent("a.js", "original a");
+var b = new SourceNode(1, 2, "b.js", "generated from b");
+b.setSourceContent("b.js", "original b");
+var c = new SourceNode(1, 2, "c.js", "generated from c");
+c.setSourceContent("c.js", "original c");
+
+var node = new SourceNode(null, null, null, [a, b, c]);
+node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
+// WALK: a.js : original a
+// WALK: b.js : original b
+// WALK: c.js : original c
+```
+
+#### SourceNode.prototype.join(sep)
+
+Like `Array.prototype.join` except for SourceNodes. Inserts the separator
+between each of this source node's children.
+
+* `sep`: The separator.
+
+```js
+var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
+var operand = new SourceNode(3, 4, "a.rs", "=");
+var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
+
+var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
+var joinedNode = node.join(" ");
+```
+
+#### SourceNode.prototype.replaceRight(pattern, replacement)
+
+Call `String.prototype.replace` on the very right-most source snippet. Useful
+for trimming white space from the end of a source node, etc.
+
+* `pattern`: The pattern to replace.
+
+* `replacement`: The thing to replace the pattern with.
+
+```js
+// Trim trailing white space.
+node.replaceRight(/\s*$/, "");
+```
+
+#### SourceNode.prototype.toString()
+
+Return the string representation of this source node. Walks over the tree and
+concatenates all the various snippets together to one string.
+
+```js
+var node = new SourceNode(1, 2, "a.js", [
+  new SourceNode(3, 4, "b.js", "uno"),
+  "dos",
+  [
+    "tres",
+    new SourceNode(5, 6, "c.js", "quatro")
+  ]
+]);
+
+node.toString()
+// 'unodostresquatro'
+```
+
+#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
+
+Returns the string representation of this tree of source nodes, plus a
+SourceMapGenerator which contains all the mappings between the generated and
+original sources.
+
+The arguments are the same as those to `new SourceMapGenerator`.
+
+```js
+var node = new SourceNode(1, 2, "a.js", [
+  new SourceNode(3, 4, "b.js", "uno"),
+  "dos",
+  [
+    "tres",
+    new SourceNode(5, 6, "c.js", "quatro")
+  ]
+]);
+
+node.toStringWithSourceMap({ file: "my-output-file.js" })
+// { code: 'unodostresquatro',
+//   map: [object SourceMapGenerator] }
+```
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/array-set.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/array-set.js
new file mode 100644
index 0000000000000000000000000000000000000000..40171b9a64c4fc050d7d7c6a253e22e51667a946
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/array-set.js
@@ -0,0 +1,100 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+class ArraySet {
+  constructor() {
+    this._array = [];
+    this._set = new Map();
+  }
+
+  /**
+   * Static method for creating ArraySet instances from an existing array.
+   */
+  static fromArray(aArray, aAllowDuplicates) {
+    const set = new ArraySet();
+    for (let i = 0, len = aArray.length; i < len; i++) {
+      set.add(aArray[i], aAllowDuplicates);
+    }
+    return set;
+  }
+
+  /**
+   * Return how many unique items are in this ArraySet. If duplicates have been
+   * added, than those do not count towards the size.
+   *
+   * @returns Number
+   */
+  size() {
+    return this._set.size;
+  }
+
+  /**
+   * Add the given string to this set.
+   *
+   * @param String aStr
+   */
+  add(aStr, aAllowDuplicates) {
+    const isDuplicate = this.has(aStr);
+    const idx = this._array.length;
+    if (!isDuplicate || aAllowDuplicates) {
+      this._array.push(aStr);
+    }
+    if (!isDuplicate) {
+      this._set.set(aStr, idx);
+    }
+  }
+
+  /**
+   * Is the given string a member of this set?
+   *
+   * @param String aStr
+   */
+  has(aStr) {
+      return this._set.has(aStr);
+  }
+
+  /**
+   * What is the index of the given string in the array?
+   *
+   * @param String aStr
+   */
+  indexOf(aStr) {
+    const idx = this._set.get(aStr);
+    if (idx >= 0) {
+        return idx;
+    }
+    throw new Error('"' + aStr + '" is not in the set.');
+  }
+
+  /**
+   * What is the element at the given index?
+   *
+   * @param Number aIdx
+   */
+  at(aIdx) {
+    if (aIdx >= 0 && aIdx < this._array.length) {
+      return this._array[aIdx];
+    }
+    throw new Error("No element indexed by " + aIdx);
+  }
+
+  /**
+   * Returns the array representation of this set (which has the proper indices
+   * indicated by indexOf). Note that this is a copy of the internal array used
+   * for storing the members so that no one can mess with internal state.
+   */
+  toArray() {
+    return this._array.slice();
+  }
+}
+exports.ArraySet = ArraySet;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64-vlq.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64-vlq.js
new file mode 100644
index 0000000000000000000000000000000000000000..fc1049c89dcf500f9f7f4b0ae4af74755600ff16
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64-vlq.js
@@ -0,0 +1,111 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution.
+ *  * Neither the name of Google Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+const base64 = require("./base64");
+
+// A single base 64 digit can contain 6 bits of data. For the base 64 variable
+// length quantities we use in the source map spec, the first bit is the sign,
+// the next four bits are the actual value, and the 6th bit is the
+// continuation bit. The continuation bit tells us whether there are more
+// digits in this value following this digit.
+//
+//   Continuation
+//   |    Sign
+//   |    |
+//   V    V
+//   101011
+
+const VLQ_BASE_SHIFT = 5;
+
+// binary: 100000
+const VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+// binary: 011111
+const VLQ_BASE_MASK = VLQ_BASE - 1;
+
+// binary: 100000
+const VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+/**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit.  For example, as decimals:
+ *   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ *   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+function toVLQSigned(aValue) {
+  return aValue < 0
+    ? ((-aValue) << 1) + 1
+    : (aValue << 1) + 0;
+}
+
+/**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit.  For example, as decimals:
+ *   2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ *   4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+// eslint-disable-next-line no-unused-vars
+function fromVLQSigned(aValue) {
+  const isNegative = (aValue & 1) === 1;
+  const shifted = aValue >> 1;
+  return isNegative
+    ? -shifted
+    : shifted;
+}
+
+/**
+ * Returns the base 64 VLQ encoded value.
+ */
+exports.encode = function base64VLQ_encode(aValue) {
+  let encoded = "";
+  let digit;
+
+  let vlq = toVLQSigned(aValue);
+
+  do {
+    digit = vlq & VLQ_BASE_MASK;
+    vlq >>>= VLQ_BASE_SHIFT;
+    if (vlq > 0) {
+      // There are still more digits in this value, so we must make sure the
+      // continuation bit is marked.
+      digit |= VLQ_CONTINUATION_BIT;
+    }
+    encoded += base64.encode(digit);
+  } while (vlq > 0);
+
+  return encoded;
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64.js
new file mode 100644
index 0000000000000000000000000000000000000000..b9ca3199ce79c98f74fdd593174810ae2392beb6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/base64.js
@@ -0,0 +1,18 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
+
+/**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+exports.encode = function(number) {
+  if (0 <= number && number < intToCharMap.length) {
+    return intToCharMap[number];
+  }
+  throw new TypeError("Must be between 0 and 63: " + number);
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/binary-search.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/binary-search.js
new file mode 100644
index 0000000000000000000000000000000000000000..d6f898ead90f29c9dbc710f8bae3e966a7af7505
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/binary-search.js
@@ -0,0 +1,107 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+exports.GREATEST_LOWER_BOUND = 1;
+exports.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ *     closest element that is smaller than or greater than the one we are
+ *     searching for, respectively, if the exact element cannot be found.
+ */
+function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+  // This function terminates when one of the following is true:
+  //
+  //   1. We find the exact element we are looking for.
+  //
+  //   2. We did not find the exact element, but we can return the index of
+  //      the next-closest element.
+  //
+  //   3. We did not find the exact element, and there is no next-closest
+  //      element than the one we are searching for, so we return -1.
+  const mid = Math.floor((aHigh - aLow) / 2) + aLow;
+  const cmp = aCompare(aNeedle, aHaystack[mid], true);
+  if (cmp === 0) {
+    // Found the element we are looking for.
+    return mid;
+  } else if (cmp > 0) {
+    // Our needle is greater than aHaystack[mid].
+    if (aHigh - mid > 1) {
+      // The element is in the upper half.
+      return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+    }
+
+    // The exact needle element was not found in this haystack. Determine if
+    // we are in termination case (3) or (2) and return the appropriate thing.
+    if (aBias == exports.LEAST_UPPER_BOUND) {
+      return aHigh < aHaystack.length ? aHigh : -1;
+    }
+    return mid;
+  }
+
+  // Our needle is less than aHaystack[mid].
+  if (mid - aLow > 1) {
+    // The element is in the lower half.
+    return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+  }
+
+  // we are in termination case (3) or (2) and return the appropriate thing.
+  if (aBias == exports.LEAST_UPPER_BOUND) {
+    return mid;
+  }
+  return aLow < 0 ? -1 : aLow;
+}
+
+/**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ *     array and returns -1, 0, or 1 depending on whether the needle is less
+ *     than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ *     closest element that is smaller than or greater than the one we are
+ *     searching for, respectively, if the exact element cannot be found.
+ *     Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+  if (aHaystack.length === 0) {
+    return -1;
+  }
+
+  let index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+                              aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+  if (index < 0) {
+    return -1;
+  }
+
+  // We have found either the exact element, or the next-closest element than
+  // the one we are searching for. However, there may be more than one such
+  // element. Make sure we always return the smallest of these.
+  while (index - 1 >= 0) {
+    if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+      break;
+    }
+    --index;
+  }
+
+  return index;
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mapping-list.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mapping-list.js
new file mode 100644
index 0000000000000000000000000000000000000000..7056861078d90e994b577fa8c4a4e1766db56bd9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mapping-list.js
@@ -0,0 +1,80 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const util = require("./util");
+
+/**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+function generatedPositionAfter(mappingA, mappingB) {
+  // Optimized for most common case
+  const lineA = mappingA.generatedLine;
+  const lineB = mappingB.generatedLine;
+  const columnA = mappingA.generatedColumn;
+  const columnB = mappingB.generatedColumn;
+  return lineB > lineA || lineB == lineA && columnB >= columnA ||
+         util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+}
+
+/**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a negligible overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+class MappingList {
+  constructor() {
+    this._array = [];
+    this._sorted = true;
+    // Serves as infimum
+    this._last = {generatedLine: -1, generatedColumn: 0};
+  }
+
+  /**
+   * Iterate through internal items. This method takes the same arguments that
+   * `Array.prototype.forEach` takes.
+   *
+   * NOTE: The order of the mappings is NOT guaranteed.
+   */
+  unsortedForEach(aCallback, aThisArg) {
+    this._array.forEach(aCallback, aThisArg);
+  }
+
+  /**
+   * Add the given source mapping.
+   *
+   * @param Object aMapping
+   */
+  add(aMapping) {
+    if (generatedPositionAfter(this._last, aMapping)) {
+      this._last = aMapping;
+      this._array.push(aMapping);
+    } else {
+      this._sorted = false;
+      this._array.push(aMapping);
+    }
+  }
+
+  /**
+   * Returns the flat, sorted array of mappings. The mappings are sorted by
+   * generated position.
+   *
+   * WARNING: This method returns internal data without copying, for
+   * performance. The return value must NOT be mutated, and should be treated as
+   * an immutable borrow. If you want to take ownership, you must make your own
+   * copy.
+   */
+  toArray() {
+    if (!this._sorted) {
+      this._array.sort(util.compareByGeneratedPositionsInflated);
+      this._sorted = true;
+    }
+    return this._array;
+  }
+}
+
+exports.MappingList = MappingList;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mappings.wasm b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mappings.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..03eea57b70f77d34afbce469e84532ca131ba5cb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/mappings.wasm
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be2dc7da3885e55013c8da58d7ba356705d932459db94ada37d5de2fa8733cfe
+size 48693
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm-browser.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..10478bc1752df32862b04fe6677d7e28235e95bd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm-browser.js
@@ -0,0 +1,22 @@
+"use strict";
+
+let mappingsWasm = null;
+
+module.exports = function readWasm() {
+  if (typeof mappingsWasm === "string") {
+    return fetch(mappingsWasm)
+      .then(response => response.arrayBuffer());
+  }
+  if (mappingsWasm instanceof ArrayBuffer) {
+    return Promise.resolve(mappingsWasm);
+  }
+
+  throw new Error("You must provide the string URL or ArrayBuffer contents " +
+                  "of lib/mappings.wasm by calling " +
+                  "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " +
+                  "before using SourceMapConsumer");
+};
+
+module.exports.initialize = input => {
+  mappingsWasm = input;
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm.js
new file mode 100644
index 0000000000000000000000000000000000000000..18df8525716c05b35cc04236ba150405653b8435
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/read-wasm.js
@@ -0,0 +1,25 @@
+"use strict";
+
+// Note: This file is replaced with "read-wasm-browser.js" when this module is
+// bundled with a packager that takes package.json#browser fields into account.
+
+const fs = require("fs");
+const path = require("path");
+
+module.exports = function readWasm() {
+  return new Promise((resolve, reject) => {
+    const wasmPath = path.join(__dirname, "mappings.wasm");
+    fs.readFile(wasmPath, null, (error, data) => {
+      if (error) {
+        reject(error);
+        return;
+      }
+
+      resolve(data.buffer);
+    });
+  });
+};
+
+module.exports.initialize = _ => {
+  console.debug("SourceMapConsumer.initialize is a no-op when running in node.js");
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-consumer.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-consumer.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b68e3933fe2064e939745e6395f499602ca5b4c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-consumer.js
@@ -0,0 +1,1016 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const util = require("./util");
+const binarySearch = require("./binary-search");
+const ArraySet = require("./array-set").ArraySet;
+const base64VLQ = require("./base64-vlq"); // eslint-disable-line no-unused-vars
+const readWasm = require("../lib/read-wasm");
+const wasm = require("./wasm");
+
+const INTERNAL = Symbol("smcInternal");
+
+class SourceMapConsumer {
+  constructor(aSourceMap, aSourceMapURL) {
+    // If the constructor was called by super(), just return Promise.
+    // Yes, this is a hack to retain the pre-existing API of the base-class
+    // constructor also being an async factory function.
+    if (aSourceMap == INTERNAL) {
+      return Promise.resolve(this);
+    }
+
+    return _factory(aSourceMap, aSourceMapURL);
+  }
+
+  static initialize(opts) {
+    readWasm.initialize(opts["lib/mappings.wasm"]);
+  }
+
+  static fromSourceMap(aSourceMap, aSourceMapURL) {
+    return _factoryBSM(aSourceMap, aSourceMapURL);
+  }
+
+  /**
+   * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
+   * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
+   * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
+   * for `f` to complete, call `destroy` on the consumer, and return `f`'s return
+   * value.
+   *
+   * You must not use the consumer after `f` completes!
+   *
+   * By using `with`, you do not have to remember to manually call `destroy` on
+   * the consumer, since it will be called automatically once `f` completes.
+   *
+   * ```js
+   * const xSquared = await SourceMapConsumer.with(
+   *   myRawSourceMap,
+   *   null,
+   *   async function (consumer) {
+   *     // Use `consumer` inside here and don't worry about remembering
+   *     // to call `destroy`.
+   *
+   *     const x = await whatever(consumer);
+   *     return x * x;
+   *   }
+   * );
+   *
+   * // You may not use that `consumer` anymore out here; it has
+   * // been destroyed. But you can use `xSquared`.
+   * console.log(xSquared);
+   * ```
+   */
+  static async with(rawSourceMap, sourceMapUrl, f) {
+    const consumer = await new SourceMapConsumer(rawSourceMap, sourceMapUrl);
+    try {
+      return await f(consumer);
+    } finally {
+      consumer.destroy();
+    }
+  }
+
+  /**
+   * Iterate over each mapping between an original source/line/column and a
+   * generated line/column in this source map.
+   *
+   * @param Function aCallback
+   *        The function that is called with each mapping.
+   * @param Object aContext
+   *        Optional. If specified, this object will be the value of `this` every
+   *        time that `aCallback` is called.
+   * @param aOrder
+   *        Either `SourceMapConsumer.GENERATED_ORDER` or
+   *        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+   *        iterate over the mappings sorted by the generated file's line/column
+   *        order or the original's source/line/column order, respectively. Defaults to
+   *        `SourceMapConsumer.GENERATED_ORDER`.
+   */
+  eachMapping(aCallback, aContext, aOrder) {
+    throw new Error("Subclasses must implement eachMapping");
+  }
+
+  /**
+   * Returns all generated line and column information for the original source,
+   * line, and column provided. If no column is provided, returns all mappings
+   * corresponding to a either the line we are searching for or the next
+   * closest line that has any mappings. Otherwise, returns all mappings
+   * corresponding to the given line and either the column we are searching for
+   * or the next closest column that has any offsets.
+   *
+   * The only argument is an object with the following properties:
+   *
+   *   - source: The filename of the original source.
+   *   - line: The line number in the original source.  The line number is 1-based.
+   *   - column: Optional. the column number in the original source.
+   *    The column number is 0-based.
+   *
+   * and an array of objects is returned, each with the following properties:
+   *
+   *   - line: The line number in the generated source, or null.  The
+   *    line number is 1-based.
+   *   - column: The column number in the generated source, or null.
+   *    The column number is 0-based.
+   */
+  allGeneratedPositionsFor(aArgs) {
+    throw new Error("Subclasses must implement allGeneratedPositionsFor");
+  }
+
+  destroy() {
+    throw new Error("Subclasses must implement destroy");
+  }
+}
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+SourceMapConsumer.prototype._version = 3;
+SourceMapConsumer.GENERATED_ORDER = 1;
+SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+exports.SourceMapConsumer = SourceMapConsumer;
+
+/**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The first parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ *   - version: Which version of the source map spec this map is following.
+ *   - sources: An array of URLs to the original source files.
+ *   - names: An array of identifiers which can be referenced by individual mappings.
+ *   - sourceRoot: Optional. The URL root from which all sources are relative.
+ *   - sourcesContent: Optional. An array of contents of the original source files.
+ *   - mappings: A string of base64 VLQs which contain the actual mappings.
+ *   - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ *     {
+ *       version : 3,
+ *       file: "out.js",
+ *       sourceRoot : "",
+ *       sources: ["foo.js", "bar.js"],
+ *       names: ["src", "maps", "are", "fun"],
+ *       mappings: "AA,AB;;ABCDE;"
+ *     }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found.  This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+class BasicSourceMapConsumer extends SourceMapConsumer {
+  constructor(aSourceMap, aSourceMapURL) {
+    return super(INTERNAL).then(that => {
+      let sourceMap = aSourceMap;
+      if (typeof aSourceMap === "string") {
+        sourceMap = util.parseSourceMapInput(aSourceMap);
+      }
+
+      const version = util.getArg(sourceMap, "version");
+      const sources = util.getArg(sourceMap, "sources").map(String);
+      // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+      // requires the array) to play nice here.
+      const names = util.getArg(sourceMap, "names", []);
+      const sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
+      const sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
+      const mappings = util.getArg(sourceMap, "mappings");
+      const file = util.getArg(sourceMap, "file", null);
+
+      // Once again, Sass deviates from the spec and supplies the version as a
+      // string rather than a number, so we use loose equality checking here.
+      if (version != that._version) {
+        throw new Error("Unsupported version: " + version);
+      }
+
+      that._sourceLookupCache = new Map();
+
+      // Pass `true` below to allow duplicate names and sources. While source maps
+      // are intended to be compressed and deduplicated, the TypeScript compiler
+      // sometimes generates source maps with duplicates in them. See Github issue
+      // #72 and bugzil.la/889492.
+      that._names = ArraySet.fromArray(names.map(String), true);
+      that._sources = ArraySet.fromArray(sources, true);
+
+      that._absoluteSources = ArraySet.fromArray(that._sources.toArray().map(function(s) {
+        return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
+      }), true);
+
+      that.sourceRoot = sourceRoot;
+      that.sourcesContent = sourcesContent;
+      that._mappings = mappings;
+      that._sourceMapURL = aSourceMapURL;
+      that.file = file;
+
+      that._computedColumnSpans = false;
+      that._mappingsPtr = 0;
+      that._wasm = null;
+
+      return wasm().then(w => {
+        that._wasm = w;
+        return that;
+      });
+    });
+  }
+
+  /**
+   * Utility function to find the index of a source.  Returns -1 if not
+   * found.
+   */
+  _findSourceIndex(aSource) {
+    // In the most common usecases, we'll be constantly looking up the index for the same source
+    // files, so we cache the index lookup to avoid constantly recomputing the full URLs.
+    const cachedIndex = this._sourceLookupCache.get(aSource);
+    if (typeof cachedIndex === "number") {
+      return cachedIndex;
+    }
+
+    // Treat the source as map-relative overall by default.
+    const sourceAsMapRelative = util.computeSourceURL(null, aSource, this._sourceMapURL);
+    if (this._absoluteSources.has(sourceAsMapRelative)) {
+      const index = this._absoluteSources.indexOf(sourceAsMapRelative);
+      this._sourceLookupCache.set(aSource, index);
+      return index;
+    }
+
+    // Fall back to treating the source as sourceRoot-relative.
+    const sourceAsSourceRootRelative = util.computeSourceURL(this.sourceRoot, aSource, this._sourceMapURL);
+    if (this._absoluteSources.has(sourceAsSourceRootRelative)) {
+      const index = this._absoluteSources.indexOf(sourceAsSourceRootRelative);
+      this._sourceLookupCache.set(aSource, index);
+      return index;
+    }
+
+    // To avoid this cache growing forever, we do not cache lookup misses.
+    return -1;
+  }
+
+  /**
+   * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+   *
+   * @param SourceMapGenerator aSourceMap
+   *        The source map that will be consumed.
+   * @param String aSourceMapURL
+   *        The URL at which the source map can be found (optional)
+   * @returns BasicSourceMapConsumer
+   */
+  static fromSourceMap(aSourceMap, aSourceMapURL) {
+    return new BasicSourceMapConsumer(aSourceMap.toString());
+  }
+
+  get sources() {
+    return this._absoluteSources.toArray();
+  }
+
+  _getMappingsPtr() {
+    if (this._mappingsPtr === 0) {
+      this._parseMappings();
+    }
+
+    return this._mappingsPtr;
+  }
+
+  /**
+   * Parse the mappings in a string in to a data structure which we can easily
+   * query (the ordered arrays in the `this.__generatedMappings` and
+   * `this.__originalMappings` properties).
+   */
+  _parseMappings() {
+    const aStr = this._mappings;
+    const size = aStr.length;
+
+    const mappingsBufPtr = this._wasm.exports.allocate_mappings(size);
+    const mappingsBuf = new Uint8Array(this._wasm.exports.memory.buffer, mappingsBufPtr, size);
+    for (let i = 0; i < size; i++) {
+      mappingsBuf[i] = aStr.charCodeAt(i);
+    }
+
+    const mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr);
+
+    if (!mappingsPtr) {
+      const error = this._wasm.exports.get_last_error();
+      let msg = `Error parsing mappings (code ${error}): `;
+
+      // XXX: keep these error codes in sync with `fitzgen/source-map-mappings`.
+      switch (error) {
+        case 1:
+          msg += "the mappings contained a negative line, column, source index, or name index";
+          break;
+        case 2:
+          msg += "the mappings contained a number larger than 2**32";
+          break;
+        case 3:
+          msg += "reached EOF while in the middle of parsing a VLQ";
+          break;
+        case 4:
+          msg += "invalid base 64 character while parsing a VLQ";
+          break;
+        default:
+          msg += "unknown error code";
+          break;
+      }
+
+      throw new Error(msg);
+    }
+
+    this._mappingsPtr = mappingsPtr;
+  }
+
+  eachMapping(aCallback, aContext, aOrder) {
+    const context = aContext || null;
+    const order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+    this._wasm.withMappingCallback(
+      mapping => {
+        if (mapping.source !== null) {
+          mapping.source = this._absoluteSources.at(mapping.source);
+
+          if (mapping.name !== null) {
+            mapping.name = this._names.at(mapping.name);
+          }
+        }
+        if (this._computedColumnSpans && mapping.lastGeneratedColumn === null) {
+          mapping.lastGeneratedColumn = Infinity;
+        }
+
+        aCallback.call(context, mapping);
+      },
+      () => {
+        switch (order) {
+        case SourceMapConsumer.GENERATED_ORDER:
+          this._wasm.exports.by_generated_location(this._getMappingsPtr());
+          break;
+        case SourceMapConsumer.ORIGINAL_ORDER:
+          this._wasm.exports.by_original_location(this._getMappingsPtr());
+          break;
+        default:
+          throw new Error("Unknown order of iteration.");
+        }
+      }
+    );
+  }
+
+  allGeneratedPositionsFor(aArgs) {
+    let source = util.getArg(aArgs, "source");
+    const originalLine = util.getArg(aArgs, "line");
+    const originalColumn = aArgs.column || 0;
+
+    source = this._findSourceIndex(source);
+    if (source < 0) {
+      return [];
+    }
+
+    if (originalLine < 1) {
+      throw new Error("Line numbers must be >= 1");
+    }
+
+    if (originalColumn < 0) {
+      throw new Error("Column numbers must be >= 0");
+    }
+
+    const mappings = [];
+
+    this._wasm.withMappingCallback(
+      m => {
+        let lastColumn = m.lastGeneratedColumn;
+        if (this._computedColumnSpans && lastColumn === null) {
+          lastColumn = Infinity;
+        }
+        mappings.push({
+          line: m.generatedLine,
+          column: m.generatedColumn,
+          lastColumn,
+        });
+      }, () => {
+        this._wasm.exports.all_generated_locations_for(
+          this._getMappingsPtr(),
+          source,
+          originalLine - 1,
+          "column" in aArgs,
+          originalColumn
+        );
+      }
+    );
+
+    return mappings;
+  }
+
+  destroy() {
+    if (this._mappingsPtr !== 0) {
+      this._wasm.exports.free_mappings(this._mappingsPtr);
+      this._mappingsPtr = 0;
+    }
+  }
+
+  /**
+   * Compute the last column for each generated mapping. The last column is
+   * inclusive.
+   */
+  computeColumnSpans() {
+    if (this._computedColumnSpans) {
+      return;
+    }
+
+    this._wasm.exports.compute_column_spans(this._getMappingsPtr());
+    this._computedColumnSpans = true;
+  }
+
+  /**
+   * Returns the original source, line, and column information for the generated
+   * source's line and column positions provided. The only argument is an object
+   * with the following properties:
+   *
+   *   - line: The line number in the generated source.  The line number
+   *     is 1-based.
+   *   - column: The column number in the generated source.  The column
+   *     number is 0-based.
+   *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+   *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+   *     closest element that is smaller than or greater than the one we are
+   *     searching for, respectively, if the exact element cannot be found.
+   *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+   *
+   * and an object is returned with the following properties:
+   *
+   *   - source: The original source file, or null.
+   *   - line: The line number in the original source, or null.  The
+   *     line number is 1-based.
+   *   - column: The column number in the original source, or null.  The
+   *     column number is 0-based.
+   *   - name: The original identifier, or null.
+   */
+  originalPositionFor(aArgs) {
+    const needle = {
+      generatedLine: util.getArg(aArgs, "line"),
+      generatedColumn: util.getArg(aArgs, "column")
+    };
+
+    if (needle.generatedLine < 1) {
+      throw new Error("Line numbers must be >= 1");
+    }
+
+    if (needle.generatedColumn < 0) {
+      throw new Error("Column numbers must be >= 0");
+    }
+
+    let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
+    if (bias == null) {
+      bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
+    }
+
+    let mapping;
+    this._wasm.withMappingCallback(m => mapping = m, () => {
+      this._wasm.exports.original_location_for(
+        this._getMappingsPtr(),
+        needle.generatedLine - 1,
+        needle.generatedColumn,
+        bias
+      );
+    });
+
+    if (mapping) {
+      if (mapping.generatedLine === needle.generatedLine) {
+        let source = util.getArg(mapping, "source", null);
+        if (source !== null) {
+          source = this._absoluteSources.at(source);
+        }
+
+        let name = util.getArg(mapping, "name", null);
+        if (name !== null) {
+          name = this._names.at(name);
+        }
+
+        return {
+          source,
+          line: util.getArg(mapping, "originalLine", null),
+          column: util.getArg(mapping, "originalColumn", null),
+          name
+        };
+      }
+    }
+
+    return {
+      source: null,
+      line: null,
+      column: null,
+      name: null
+    };
+  }
+
+  /**
+   * Return true if we have the source content for every source in the source
+   * map, false otherwise.
+   */
+  hasContentsOfAllSources() {
+    if (!this.sourcesContent) {
+      return false;
+    }
+    return this.sourcesContent.length >= this._sources.size() &&
+      !this.sourcesContent.some(function(sc) { return sc == null; });
+  }
+
+  /**
+   * Returns the original source content. The only argument is the url of the
+   * original source file. Returns null if no original source content is
+   * available.
+   */
+  sourceContentFor(aSource, nullOnMissing) {
+    if (!this.sourcesContent) {
+      return null;
+    }
+
+    const index = this._findSourceIndex(aSource);
+    if (index >= 0) {
+      return this.sourcesContent[index];
+    }
+
+    // This function is used recursively from
+    // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+    // don't want to throw if we can't find the source - we just want to
+    // return null, so we provide a flag to exit gracefully.
+    if (nullOnMissing) {
+      return null;
+    }
+
+    throw new Error('"' + aSource + '" is not in the SourceMap.');
+  }
+
+  /**
+   * Returns the generated line and column information for the original source,
+   * line, and column positions provided. The only argument is an object with
+   * the following properties:
+   *
+   *   - source: The filename of the original source.
+   *   - line: The line number in the original source.  The line number
+   *     is 1-based.
+   *   - column: The column number in the original source.  The column
+   *     number is 0-based.
+   *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+   *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+   *     closest element that is smaller than or greater than the one we are
+   *     searching for, respectively, if the exact element cannot be found.
+   *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+   *
+   * and an object is returned with the following properties:
+   *
+   *   - line: The line number in the generated source, or null.  The
+   *     line number is 1-based.
+   *   - column: The column number in the generated source, or null.
+   *     The column number is 0-based.
+   */
+  generatedPositionFor(aArgs) {
+    let source = util.getArg(aArgs, "source");
+    source = this._findSourceIndex(source);
+    if (source < 0) {
+      return {
+        line: null,
+        column: null,
+        lastColumn: null
+      };
+    }
+
+    const needle = {
+      source,
+      originalLine: util.getArg(aArgs, "line"),
+      originalColumn: util.getArg(aArgs, "column")
+    };
+
+    if (needle.originalLine < 1) {
+      throw new Error("Line numbers must be >= 1");
+    }
+
+    if (needle.originalColumn < 0) {
+      throw new Error("Column numbers must be >= 0");
+    }
+
+    let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
+    if (bias == null) {
+      bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
+    }
+
+    let mapping;
+    this._wasm.withMappingCallback(m => mapping = m, () => {
+      this._wasm.exports.generated_location_for(
+        this._getMappingsPtr(),
+        needle.source,
+        needle.originalLine - 1,
+        needle.originalColumn,
+        bias
+      );
+    });
+
+    if (mapping) {
+      if (mapping.source === needle.source) {
+        let lastColumn = mapping.lastGeneratedColumn;
+        if (this._computedColumnSpans && lastColumn === null) {
+          lastColumn = Infinity;
+        }
+        return {
+          line: util.getArg(mapping, "generatedLine", null),
+          column: util.getArg(mapping, "generatedColumn", null),
+          lastColumn,
+        };
+      }
+    }
+
+    return {
+      line: null,
+      column: null,
+      lastColumn: null
+    };
+  }
+}
+
+BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+/**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The first parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ *   - version: Which version of the source map spec this map is following.
+ *   - file: Optional. The generated file this source map is associated with.
+ *   - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ *   - offset: The offset into the original specified at which this section
+ *       begins to apply, defined as an object with a "line" and "column"
+ *       field.
+ *   - map: A source map definition. This source map could also be indexed,
+ *       but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ *  {
+ *    version : 3,
+ *    file: "app.js",
+ *    sections: [{
+ *      offset: {line:100, column:10},
+ *      map: {
+ *        version : 3,
+ *        file: "section.js",
+ *        sources: ["foo.js", "bar.js"],
+ *        names: ["src", "maps", "are", "fun"],
+ *        mappings: "AAAA,E;;ABCDE;"
+ *      }
+ *    }],
+ *  }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found.  This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+class IndexedSourceMapConsumer extends SourceMapConsumer {
+  constructor(aSourceMap, aSourceMapURL) {
+    return super(INTERNAL).then(that => {
+      let sourceMap = aSourceMap;
+      if (typeof aSourceMap === "string") {
+        sourceMap = util.parseSourceMapInput(aSourceMap);
+      }
+
+      const version = util.getArg(sourceMap, "version");
+      const sections = util.getArg(sourceMap, "sections");
+
+      if (version != that._version) {
+        throw new Error("Unsupported version: " + version);
+      }
+
+      let lastOffset = {
+        line: -1,
+        column: 0
+      };
+      return Promise.all(sections.map(s => {
+        if (s.url) {
+          // The url field will require support for asynchronicity.
+          // See https://github.com/mozilla/source-map/issues/16
+          throw new Error("Support for url field in sections not implemented.");
+        }
+        const offset = util.getArg(s, "offset");
+        const offsetLine = util.getArg(offset, "line");
+        const offsetColumn = util.getArg(offset, "column");
+
+        if (offsetLine < lastOffset.line ||
+            (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+          throw new Error("Section offsets must be ordered and non-overlapping.");
+        }
+        lastOffset = offset;
+
+        const cons = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL);
+        return cons.then(consumer => {
+          return {
+            generatedOffset: {
+              // The offset fields are 0-based, but we use 1-based indices when
+              // encoding/decoding from VLQ.
+              generatedLine: offsetLine + 1,
+              generatedColumn: offsetColumn + 1
+            },
+            consumer
+          };
+        });
+      })).then(s => {
+        that._sections = s;
+        return that;
+      });
+    });
+  }
+
+  /**
+   * The list of original sources.
+   */
+  get sources() {
+    const sources = [];
+    for (let i = 0; i < this._sections.length; i++) {
+      for (let j = 0; j < this._sections[i].consumer.sources.length; j++) {
+        sources.push(this._sections[i].consumer.sources[j]);
+      }
+    }
+    return sources;
+  }
+
+  /**
+   * Returns the original source, line, and column information for the generated
+   * source's line and column positions provided. The only argument is an object
+   * with the following properties:
+   *
+   *   - line: The line number in the generated source.  The line number
+   *     is 1-based.
+   *   - column: The column number in the generated source.  The column
+   *     number is 0-based.
+   *
+   * and an object is returned with the following properties:
+   *
+   *   - source: The original source file, or null.
+   *   - line: The line number in the original source, or null.  The
+   *     line number is 1-based.
+   *   - column: The column number in the original source, or null.  The
+   *     column number is 0-based.
+   *   - name: The original identifier, or null.
+   */
+  originalPositionFor(aArgs) {
+    const needle = {
+      generatedLine: util.getArg(aArgs, "line"),
+      generatedColumn: util.getArg(aArgs, "column")
+    };
+
+    // Find the section containing the generated position we're trying to map
+    // to an original position.
+    const sectionIndex = binarySearch.search(needle, this._sections,
+      function(aNeedle, section) {
+        const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;
+        if (cmp) {
+          return cmp;
+        }
+
+        return (aNeedle.generatedColumn -
+                section.generatedOffset.generatedColumn);
+      });
+    const section = this._sections[sectionIndex];
+
+    if (!section) {
+      return {
+        source: null,
+        line: null,
+        column: null,
+        name: null
+      };
+    }
+
+    return section.consumer.originalPositionFor({
+      line: needle.generatedLine -
+        (section.generatedOffset.generatedLine - 1),
+      column: needle.generatedColumn -
+        (section.generatedOffset.generatedLine === needle.generatedLine
+         ? section.generatedOffset.generatedColumn - 1
+         : 0),
+      bias: aArgs.bias
+    });
+  }
+
+  /**
+   * Return true if we have the source content for every source in the source
+   * map, false otherwise.
+   */
+  hasContentsOfAllSources() {
+    return this._sections.every(function(s) {
+      return s.consumer.hasContentsOfAllSources();
+    });
+  }
+
+  /**
+   * Returns the original source content. The only argument is the url of the
+   * original source file. Returns null if no original source content is
+   * available.
+   */
+  sourceContentFor(aSource, nullOnMissing) {
+    for (let i = 0; i < this._sections.length; i++) {
+      const section = this._sections[i];
+
+      const content = section.consumer.sourceContentFor(aSource, true);
+      if (content) {
+        return content;
+      }
+    }
+    if (nullOnMissing) {
+      return null;
+    }
+    throw new Error('"' + aSource + '" is not in the SourceMap.');
+  }
+
+  _findSectionIndex(source) {
+    for (let i = 0; i < this._sections.length; i++) {
+      const { consumer } = this._sections[i];
+      if (consumer._findSourceIndex(source) !== -1) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
+  /**
+   * Returns the generated line and column information for the original source,
+   * line, and column positions provided. The only argument is an object with
+   * the following properties:
+   *
+   *   - source: The filename of the original source.
+   *   - line: The line number in the original source.  The line number
+   *     is 1-based.
+   *   - column: The column number in the original source.  The column
+   *     number is 0-based.
+   *
+   * and an object is returned with the following properties:
+   *
+   *   - line: The line number in the generated source, or null.  The
+   *     line number is 1-based.
+   *   - column: The column number in the generated source, or null.
+   *     The column number is 0-based.
+   */
+  generatedPositionFor(aArgs) {
+    const index = this._findSectionIndex(util.getArg(aArgs, "source"));
+    const section = index >= 0 ? this._sections[index] : null;
+    const nextSection =
+      index >= 0 && index + 1 < this._sections.length
+        ? this._sections[index + 1]
+        : null;
+
+    const generatedPosition =
+      section && section.consumer.generatedPositionFor(aArgs);
+    if (generatedPosition && generatedPosition.line !== null) {
+      const lineShift = section.generatedOffset.generatedLine - 1;
+      const columnShift = section.generatedOffset.generatedColumn - 1;
+
+      if (generatedPosition.line === 1) {
+        generatedPosition.column += columnShift;
+        if (typeof generatedPosition.lastColumn === "number") {
+          generatedPosition.lastColumn += columnShift;
+        }
+      }
+
+      if (
+        generatedPosition.lastColumn === Infinity &&
+        nextSection &&
+        generatedPosition.line === nextSection.generatedOffset.generatedLine
+      ) {
+        generatedPosition.lastColumn =
+          nextSection.generatedOffset.generatedColumn - 2;
+      }
+      generatedPosition.line += lineShift;
+
+      return generatedPosition;
+    }
+
+    return {
+      line: null,
+      column: null,
+      lastColumn: null
+    };
+  }
+
+  allGeneratedPositionsFor(aArgs) {
+    const index = this._findSectionIndex(util.getArg(aArgs, "source"));
+    const section = index >= 0 ? this._sections[index] : null;
+    const nextSection =
+      index >= 0 && index + 1 < this._sections.length
+        ? this._sections[index + 1]
+        : null;
+
+    if (!section) return [];
+
+    return section.consumer.allGeneratedPositionsFor(aArgs).map(
+      generatedPosition => {
+        const lineShift = section.generatedOffset.generatedLine - 1;
+        const columnShift = section.generatedOffset.generatedColumn - 1;
+
+        if (generatedPosition.line === 1) {
+          generatedPosition.column += columnShift;
+          if (typeof generatedPosition.lastColumn === "number") {
+            generatedPosition.lastColumn += columnShift;
+          }
+        }
+
+        if (
+          generatedPosition.lastColumn === Infinity &&
+          nextSection &&
+          generatedPosition.line === nextSection.generatedOffset.generatedLine
+        ) {
+          generatedPosition.lastColumn =
+            nextSection.generatedOffset.generatedColumn - 2;
+        }
+        generatedPosition.line += lineShift;
+
+        return generatedPosition;
+      }
+    );
+  }
+
+  eachMapping(aCallback, aContext, aOrder) {
+    this._sections.forEach((section, index) => {
+      const nextSection =
+        index + 1 < this._sections.length
+          ? this._sections[index + 1]
+          : null;
+      const { generatedOffset } = section;
+
+      const lineShift = generatedOffset.generatedLine - 1;
+      const columnShift = generatedOffset.generatedColumn - 1;
+
+      section.consumer.eachMapping(function(mapping) {
+        if (mapping.generatedLine === 1) {
+          mapping.generatedColumn += columnShift;
+
+          if (typeof mapping.lastGeneratedColumn === "number") {
+            mapping.lastGeneratedColumn += columnShift;
+          }
+        }
+
+        if (
+          mapping.lastGeneratedColumn === Infinity &&
+          nextSection &&
+          mapping.generatedLine === nextSection.generatedOffset.generatedLine
+        ) {
+          mapping.lastGeneratedColumn =
+            nextSection.generatedOffset.generatedColumn - 2;
+        }
+        mapping.generatedLine += lineShift;
+
+        aCallback.call(this, mapping);
+      }, aContext, aOrder);
+    });
+  }
+
+  computeColumnSpans() {
+    for (let i = 0; i < this._sections.length; i++) {
+      this._sections[i].consumer.computeColumnSpans();
+    }
+  }
+
+  destroy() {
+    for (let i = 0; i < this._sections.length; i++) {
+      this._sections[i].consumer.destroy();
+    }
+  }
+}
+exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
+
+/*
+ * Cheat to get around inter-twingled classes.  `factory()` can be at the end
+ * where it has access to non-hoisted classes, but it gets hoisted itself.
+ */
+function _factory(aSourceMap, aSourceMapURL) {
+  let sourceMap = aSourceMap;
+  if (typeof aSourceMap === "string") {
+    sourceMap = util.parseSourceMapInput(aSourceMap);
+  }
+
+  const consumer = sourceMap.sections != null
+      ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
+      : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
+  return Promise.resolve(consumer);
+}
+
+function _factoryBSM(aSourceMap, aSourceMapURL) {
+  return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-generator.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-generator.js
new file mode 100644
index 0000000000000000000000000000000000000000..8111e0613766cfc787880fc528a11b96dd8572f6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-map-generator.js
@@ -0,0 +1,413 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const base64VLQ = require("./base64-vlq");
+const util = require("./util");
+const ArraySet = require("./array-set").ArraySet;
+const MappingList = require("./mapping-list").MappingList;
+
+/**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ *   - file: The filename of the generated source.
+ *   - sourceRoot: A root for all relative URLs in this source map.
+ */
+class SourceMapGenerator {
+  constructor(aArgs) {
+    if (!aArgs) {
+      aArgs = {};
+    }
+    this._file = util.getArg(aArgs, "file", null);
+    this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
+    this._skipValidation = util.getArg(aArgs, "skipValidation", false);
+    this._sources = new ArraySet();
+    this._names = new ArraySet();
+    this._mappings = new MappingList();
+    this._sourcesContents = null;
+  }
+
+  /**
+   * Creates a new SourceMapGenerator based on a SourceMapConsumer
+   *
+   * @param aSourceMapConsumer The SourceMap.
+   */
+  static fromSourceMap(aSourceMapConsumer) {
+    const sourceRoot = aSourceMapConsumer.sourceRoot;
+    const generator = new SourceMapGenerator({
+      file: aSourceMapConsumer.file,
+      sourceRoot
+    });
+    aSourceMapConsumer.eachMapping(function(mapping) {
+      const newMapping = {
+        generated: {
+          line: mapping.generatedLine,
+          column: mapping.generatedColumn
+        }
+      };
+
+      if (mapping.source != null) {
+        newMapping.source = mapping.source;
+        if (sourceRoot != null) {
+          newMapping.source = util.relative(sourceRoot, newMapping.source);
+        }
+
+        newMapping.original = {
+          line: mapping.originalLine,
+          column: mapping.originalColumn
+        };
+
+        if (mapping.name != null) {
+          newMapping.name = mapping.name;
+        }
+      }
+
+      generator.addMapping(newMapping);
+    });
+    aSourceMapConsumer.sources.forEach(function(sourceFile) {
+      let sourceRelative = sourceFile;
+      if (sourceRoot !== null) {
+        sourceRelative = util.relative(sourceRoot, sourceFile);
+      }
+
+      if (!generator._sources.has(sourceRelative)) {
+        generator._sources.add(sourceRelative);
+      }
+
+      const content = aSourceMapConsumer.sourceContentFor(sourceFile);
+      if (content != null) {
+        generator.setSourceContent(sourceFile, content);
+      }
+    });
+    return generator;
+  }
+
+  /**
+   * Add a single mapping from original source line and column to the generated
+   * source's line and column for this source map being created. The mapping
+   * object should have the following properties:
+   *
+   *   - generated: An object with the generated line and column positions.
+   *   - original: An object with the original line and column positions.
+   *   - source: The original source file (relative to the sourceRoot).
+   *   - name: An optional original token name for this mapping.
+   */
+  addMapping(aArgs) {
+    const generated = util.getArg(aArgs, "generated");
+    const original = util.getArg(aArgs, "original", null);
+    let source = util.getArg(aArgs, "source", null);
+    let name = util.getArg(aArgs, "name", null);
+
+    if (!this._skipValidation) {
+      this._validateMapping(generated, original, source, name);
+    }
+
+    if (source != null) {
+      source = String(source);
+      if (!this._sources.has(source)) {
+        this._sources.add(source);
+      }
+    }
+
+    if (name != null) {
+      name = String(name);
+      if (!this._names.has(name)) {
+        this._names.add(name);
+      }
+    }
+
+    this._mappings.add({
+      generatedLine: generated.line,
+      generatedColumn: generated.column,
+      originalLine: original != null && original.line,
+      originalColumn: original != null && original.column,
+      source,
+      name
+    });
+  }
+
+  /**
+   * Set the source content for a source file.
+   */
+  setSourceContent(aSourceFile, aSourceContent) {
+    let source = aSourceFile;
+    if (this._sourceRoot != null) {
+      source = util.relative(this._sourceRoot, source);
+    }
+
+    if (aSourceContent != null) {
+      // Add the source content to the _sourcesContents map.
+      // Create a new _sourcesContents map if the property is null.
+      if (!this._sourcesContents) {
+        this._sourcesContents = Object.create(null);
+      }
+      this._sourcesContents[util.toSetString(source)] = aSourceContent;
+    } else if (this._sourcesContents) {
+      // Remove the source file from the _sourcesContents map.
+      // If the _sourcesContents map is empty, set the property to null.
+      delete this._sourcesContents[util.toSetString(source)];
+      if (Object.keys(this._sourcesContents).length === 0) {
+        this._sourcesContents = null;
+      }
+    }
+  }
+
+  /**
+   * Applies the mappings of a sub-source-map for a specific source file to the
+   * source map being generated. Each mapping to the supplied source file is
+   * rewritten using the supplied source map. Note: The resolution for the
+   * resulting mappings is the minimium of this map and the supplied map.
+   *
+   * @param aSourceMapConsumer The source map to be applied.
+   * @param aSourceFile Optional. The filename of the source file.
+   *        If omitted, SourceMapConsumer's file property will be used.
+   * @param aSourceMapPath Optional. The dirname of the path to the source map
+   *        to be applied. If relative, it is relative to the SourceMapConsumer.
+   *        This parameter is needed when the two source maps aren't in the same
+   *        directory, and the source map to be applied contains relative source
+   *        paths. If so, those relative source paths need to be rewritten
+   *        relative to the SourceMapGenerator.
+   */
+  applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+    let sourceFile = aSourceFile;
+    // If aSourceFile is omitted, we will use the file property of the SourceMap
+    if (aSourceFile == null) {
+      if (aSourceMapConsumer.file == null) {
+        throw new Error(
+          "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " +
+          'or the source map\'s "file" property. Both were omitted.'
+        );
+      }
+      sourceFile = aSourceMapConsumer.file;
+    }
+    const sourceRoot = this._sourceRoot;
+    // Make "sourceFile" relative if an absolute Url is passed.
+    if (sourceRoot != null) {
+      sourceFile = util.relative(sourceRoot, sourceFile);
+    }
+    // Applying the SourceMap can add and remove items from the sources and
+    // the names array.
+    const newSources = this._mappings.toArray().length > 0
+      ? new ArraySet()
+      : this._sources;
+    const newNames = new ArraySet();
+
+    // Find mappings for the "sourceFile"
+    this._mappings.unsortedForEach(function(mapping) {
+      if (mapping.source === sourceFile && mapping.originalLine != null) {
+        // Check if it can be mapped by the source map, then update the mapping.
+        const original = aSourceMapConsumer.originalPositionFor({
+          line: mapping.originalLine,
+          column: mapping.originalColumn
+        });
+        if (original.source != null) {
+          // Copy mapping
+          mapping.source = original.source;
+          if (aSourceMapPath != null) {
+            mapping.source = util.join(aSourceMapPath, mapping.source);
+          }
+          if (sourceRoot != null) {
+            mapping.source = util.relative(sourceRoot, mapping.source);
+          }
+          mapping.originalLine = original.line;
+          mapping.originalColumn = original.column;
+          if (original.name != null) {
+            mapping.name = original.name;
+          }
+        }
+      }
+
+      const source = mapping.source;
+      if (source != null && !newSources.has(source)) {
+        newSources.add(source);
+      }
+
+      const name = mapping.name;
+      if (name != null && !newNames.has(name)) {
+        newNames.add(name);
+      }
+
+    }, this);
+    this._sources = newSources;
+    this._names = newNames;
+
+    // Copy sourcesContents of applied map.
+    aSourceMapConsumer.sources.forEach(function(srcFile) {
+      const content = aSourceMapConsumer.sourceContentFor(srcFile);
+      if (content != null) {
+        if (aSourceMapPath != null) {
+          srcFile = util.join(aSourceMapPath, srcFile);
+        }
+        if (sourceRoot != null) {
+          srcFile = util.relative(sourceRoot, srcFile);
+        }
+        this.setSourceContent(srcFile, content);
+      }
+    }, this);
+  }
+
+  /**
+   * A mapping can have one of the three levels of data:
+   *
+   *   1. Just the generated position.
+   *   2. The Generated position, original position, and original source.
+   *   3. Generated and original position, original source, as well as a name
+   *      token.
+   *
+   * To maintain consistency, we validate that any new mapping being added falls
+   * in to one of these categories.
+   */
+  _validateMapping(aGenerated, aOriginal, aSource, aName) {
+    // When aOriginal is truthy but has empty values for .line and .column,
+    // it is most likely a programmer error. In this case we throw a very
+    // specific error message to try to guide them the right way.
+    // For example: https://github.com/Polymer/polymer-bundler/pull/519
+    if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
+        throw new Error(
+            "original.line and original.column are not numbers -- you probably meant to omit " +
+            "the original mapping entirely and only map the generated position. If so, pass " +
+            "null for the original mapping instead of an object with empty or null values."
+        );
+    }
+
+    if (aGenerated && "line" in aGenerated && "column" in aGenerated
+        && aGenerated.line > 0 && aGenerated.column >= 0
+        && !aOriginal && !aSource && !aName) {
+      // Case 1.
+
+    } else if (aGenerated && "line" in aGenerated && "column" in aGenerated
+             && aOriginal && "line" in aOriginal && "column" in aOriginal
+             && aGenerated.line > 0 && aGenerated.column >= 0
+             && aOriginal.line > 0 && aOriginal.column >= 0
+             && aSource) {
+      // Cases 2 and 3.
+
+    } else {
+      throw new Error("Invalid mapping: " + JSON.stringify({
+        generated: aGenerated,
+        source: aSource,
+        original: aOriginal,
+        name: aName
+      }));
+    }
+  }
+
+  /**
+   * Serialize the accumulated mappings in to the stream of base 64 VLQs
+   * specified by the source map format.
+   */
+  _serializeMappings() {
+    let previousGeneratedColumn = 0;
+    let previousGeneratedLine = 1;
+    let previousOriginalColumn = 0;
+    let previousOriginalLine = 0;
+    let previousName = 0;
+    let previousSource = 0;
+    let result = "";
+    let next;
+    let mapping;
+    let nameIdx;
+    let sourceIdx;
+
+    const mappings = this._mappings.toArray();
+    for (let i = 0, len = mappings.length; i < len; i++) {
+      mapping = mappings[i];
+      next = "";
+
+      if (mapping.generatedLine !== previousGeneratedLine) {
+        previousGeneratedColumn = 0;
+        while (mapping.generatedLine !== previousGeneratedLine) {
+          next += ";";
+          previousGeneratedLine++;
+        }
+      } else if (i > 0) {
+        if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+          continue;
+        }
+        next += ",";
+      }
+
+      next += base64VLQ.encode(mapping.generatedColumn
+                                 - previousGeneratedColumn);
+      previousGeneratedColumn = mapping.generatedColumn;
+
+      if (mapping.source != null) {
+        sourceIdx = this._sources.indexOf(mapping.source);
+        next += base64VLQ.encode(sourceIdx - previousSource);
+        previousSource = sourceIdx;
+
+        // lines are stored 0-based in SourceMap spec version 3
+        next += base64VLQ.encode(mapping.originalLine - 1
+                                   - previousOriginalLine);
+        previousOriginalLine = mapping.originalLine - 1;
+
+        next += base64VLQ.encode(mapping.originalColumn
+                                   - previousOriginalColumn);
+        previousOriginalColumn = mapping.originalColumn;
+
+        if (mapping.name != null) {
+          nameIdx = this._names.indexOf(mapping.name);
+          next += base64VLQ.encode(nameIdx - previousName);
+          previousName = nameIdx;
+        }
+      }
+
+      result += next;
+    }
+
+    return result;
+  }
+
+  _generateSourcesContent(aSources, aSourceRoot) {
+    return aSources.map(function(source) {
+      if (!this._sourcesContents) {
+        return null;
+      }
+      if (aSourceRoot != null) {
+        source = util.relative(aSourceRoot, source);
+      }
+      const key = util.toSetString(source);
+      return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+        ? this._sourcesContents[key]
+        : null;
+    }, this);
+  }
+
+  /**
+   * Externalize the source map.
+   */
+  toJSON() {
+    const map = {
+      version: this._version,
+      sources: this._sources.toArray(),
+      names: this._names.toArray(),
+      mappings: this._serializeMappings()
+    };
+    if (this._file != null) {
+      map.file = this._file;
+    }
+    if (this._sourceRoot != null) {
+      map.sourceRoot = this._sourceRoot;
+    }
+    if (this._sourcesContents) {
+      map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+    }
+
+    return map;
+  }
+
+  /**
+   * Render the source map being generated to a string.
+   */
+  toString() {
+    return JSON.stringify(this.toJSON());
+  }
+}
+
+SourceMapGenerator.prototype._version = 3;
+exports.SourceMapGenerator = SourceMapGenerator;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-node.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-node.js
new file mode 100644
index 0000000000000000000000000000000000000000..8a7a157ec59bc7145a3db88939397707afc91c44
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/source-node.js
@@ -0,0 +1,404 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const SourceMapGenerator = require("./source-map-generator").SourceMapGenerator;
+const util = require("./util");
+
+// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+// operating systems these days (capturing the result).
+const REGEX_NEWLINE = /(\r?\n)/;
+
+// Newline character code for charCodeAt() comparisons
+const NEWLINE_CODE = 10;
+
+// Private symbol for identifying `SourceNode`s when multiple versions of
+// the source-map library are loaded. This MUST NOT CHANGE across
+// versions!
+const isSourceNode = "$$$isSourceNode$$$";
+
+/**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ *        generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+class SourceNode {
+  constructor(aLine, aColumn, aSource, aChunks, aName) {
+    this.children = [];
+    this.sourceContents = {};
+    this.line = aLine == null ? null : aLine;
+    this.column = aColumn == null ? null : aColumn;
+    this.source = aSource == null ? null : aSource;
+    this.name = aName == null ? null : aName;
+    this[isSourceNode] = true;
+    if (aChunks != null) this.add(aChunks);
+  }
+
+  /**
+   * Creates a SourceNode from generated code and a SourceMapConsumer.
+   *
+   * @param aGeneratedCode The generated code
+   * @param aSourceMapConsumer The SourceMap for the generated code
+   * @param aRelativePath Optional. The path that relative sources in the
+   *        SourceMapConsumer should be relative to.
+   */
+  static fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+    // The SourceNode we want to fill with the generated code
+    // and the SourceMap
+    const node = new SourceNode();
+
+    // All even indices of this array are one line of the generated code,
+    // while all odd indices are the newlines between two adjacent lines
+    // (since `REGEX_NEWLINE` captures its match).
+    // Processed fragments are accessed by calling `shiftNextLine`.
+    const remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+    let remainingLinesIndex = 0;
+    const shiftNextLine = function() {
+      const lineContents = getNextLine();
+      // The last line of a file might not have a newline.
+      const newLine = getNextLine() || "";
+      return lineContents + newLine;
+
+      function getNextLine() {
+        return remainingLinesIndex < remainingLines.length ?
+            remainingLines[remainingLinesIndex++] : undefined;
+      }
+    };
+
+    // We need to remember the position of "remainingLines"
+    let lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+    // The generate SourceNodes we need a code range.
+    // To extract it current and last mapping is used.
+    // Here we store the last mapping.
+    let lastMapping = null;
+    let nextLine;
+
+    aSourceMapConsumer.eachMapping(function(mapping) {
+      if (lastMapping !== null) {
+        // We add the code from "lastMapping" to "mapping":
+        // First check if there is a new line in between.
+        if (lastGeneratedLine < mapping.generatedLine) {
+          // Associate first line with "lastMapping"
+          addMappingWithCode(lastMapping, shiftNextLine());
+          lastGeneratedLine++;
+          lastGeneratedColumn = 0;
+          // The remaining code is added without mapping
+        } else {
+          // There is no new line in between.
+          // Associate the code between "lastGeneratedColumn" and
+          // "mapping.generatedColumn" with "lastMapping"
+          nextLine = remainingLines[remainingLinesIndex] || "";
+          const code = nextLine.substr(0, mapping.generatedColumn -
+                                        lastGeneratedColumn);
+          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+                                              lastGeneratedColumn);
+          lastGeneratedColumn = mapping.generatedColumn;
+          addMappingWithCode(lastMapping, code);
+          // No more remaining code, continue
+          lastMapping = mapping;
+          return;
+        }
+      }
+      // We add the generated code until the first mapping
+      // to the SourceNode without any mapping.
+      // Each line is added as separate string.
+      while (lastGeneratedLine < mapping.generatedLine) {
+        node.add(shiftNextLine());
+        lastGeneratedLine++;
+      }
+      if (lastGeneratedColumn < mapping.generatedColumn) {
+        nextLine = remainingLines[remainingLinesIndex] || "";
+        node.add(nextLine.substr(0, mapping.generatedColumn));
+        remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+        lastGeneratedColumn = mapping.generatedColumn;
+      }
+      lastMapping = mapping;
+    }, this);
+    // We have processed all mappings.
+    if (remainingLinesIndex < remainingLines.length) {
+      if (lastMapping) {
+        // Associate the remaining code in the current line with "lastMapping"
+        addMappingWithCode(lastMapping, shiftNextLine());
+      }
+      // and add the remaining lines without any mapping
+      node.add(remainingLines.splice(remainingLinesIndex).join(""));
+    }
+
+    // Copy sourcesContent into SourceNode
+    aSourceMapConsumer.sources.forEach(function(sourceFile) {
+      const content = aSourceMapConsumer.sourceContentFor(sourceFile);
+      if (content != null) {
+        if (aRelativePath != null) {
+          sourceFile = util.join(aRelativePath, sourceFile);
+        }
+        node.setSourceContent(sourceFile, content);
+      }
+    });
+
+    return node;
+
+    function addMappingWithCode(mapping, code) {
+      if (mapping === null || mapping.source === undefined) {
+        node.add(code);
+      } else {
+        const source = aRelativePath
+          ? util.join(aRelativePath, mapping.source)
+          : mapping.source;
+        node.add(new SourceNode(mapping.originalLine,
+                                mapping.originalColumn,
+                                source,
+                                code,
+                                mapping.name));
+      }
+    }
+  }
+
+  /**
+   * Add a chunk of generated JS to this source node.
+   *
+   * @param aChunk A string snippet of generated JS code, another instance of
+   *        SourceNode, or an array where each member is one of those things.
+   */
+  add(aChunk) {
+    if (Array.isArray(aChunk)) {
+      aChunk.forEach(function(chunk) {
+        this.add(chunk);
+      }, this);
+    } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+      if (aChunk) {
+        this.children.push(aChunk);
+      }
+    } else {
+      throw new TypeError(
+        "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+      );
+    }
+    return this;
+  }
+
+  /**
+   * Add a chunk of generated JS to the beginning of this source node.
+   *
+   * @param aChunk A string snippet of generated JS code, another instance of
+   *        SourceNode, or an array where each member is one of those things.
+   */
+  prepend(aChunk) {
+    if (Array.isArray(aChunk)) {
+      for (let i = aChunk.length - 1; i >= 0; i--) {
+        this.prepend(aChunk[i]);
+      }
+    } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+      this.children.unshift(aChunk);
+    } else {
+      throw new TypeError(
+        "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+      );
+    }
+    return this;
+  }
+
+  /**
+   * Walk over the tree of JS snippets in this node and its children. The
+   * walking function is called once for each snippet of JS and is passed that
+   * snippet and the its original associated source's line/column location.
+   *
+   * @param aFn The traversal function.
+   */
+  walk(aFn) {
+    let chunk;
+    for (let i = 0, len = this.children.length; i < len; i++) {
+      chunk = this.children[i];
+      if (chunk[isSourceNode]) {
+        chunk.walk(aFn);
+      } else if (chunk !== "") {
+        aFn(chunk, { source: this.source,
+                      line: this.line,
+                      column: this.column,
+                      name: this.name });
+      }
+    }
+  }
+
+  /**
+   * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+   * each of `this.children`.
+   *
+   * @param aSep The separator.
+   */
+  join(aSep) {
+    let newChildren;
+    let i;
+    const len = this.children.length;
+    if (len > 0) {
+      newChildren = [];
+      for (i = 0; i < len - 1; i++) {
+        newChildren.push(this.children[i]);
+        newChildren.push(aSep);
+      }
+      newChildren.push(this.children[i]);
+      this.children = newChildren;
+    }
+    return this;
+  }
+
+  /**
+   * Call String.prototype.replace on the very right-most source snippet. Useful
+   * for trimming whitespace from the end of a source node, etc.
+   *
+   * @param aPattern The pattern to replace.
+   * @param aReplacement The thing to replace the pattern with.
+   */
+  replaceRight(aPattern, aReplacement) {
+    const lastChild = this.children[this.children.length - 1];
+    if (lastChild[isSourceNode]) {
+      lastChild.replaceRight(aPattern, aReplacement);
+    } else if (typeof lastChild === "string") {
+      this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+    } else {
+      this.children.push("".replace(aPattern, aReplacement));
+    }
+    return this;
+  }
+
+  /**
+   * Set the source content for a source file. This will be added to the SourceMapGenerator
+   * in the sourcesContent field.
+   *
+   * @param aSourceFile The filename of the source file
+   * @param aSourceContent The content of the source file
+   */
+  setSourceContent(aSourceFile, aSourceContent) {
+    this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+  }
+
+  /**
+   * Walk over the tree of SourceNodes. The walking function is called for each
+   * source file content and is passed the filename and source content.
+   *
+   * @param aFn The traversal function.
+   */
+  walkSourceContents(aFn) {
+    for (let i = 0, len = this.children.length; i < len; i++) {
+      if (this.children[i][isSourceNode]) {
+        this.children[i].walkSourceContents(aFn);
+      }
+    }
+
+    const sources = Object.keys(this.sourceContents);
+    for (let i = 0, len = sources.length; i < len; i++) {
+      aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+    }
+  }
+
+  /**
+   * Return the string representation of this source node. Walks over the tree
+   * and concatenates all the various snippets together to one string.
+   */
+  toString() {
+    let str = "";
+    this.walk(function(chunk) {
+      str += chunk;
+    });
+    return str;
+  }
+
+  /**
+   * Returns the string representation of this source node along with a source
+   * map.
+   */
+  toStringWithSourceMap(aArgs) {
+    const generated = {
+      code: "",
+      line: 1,
+      column: 0
+    };
+    const map = new SourceMapGenerator(aArgs);
+    let sourceMappingActive = false;
+    let lastOriginalSource = null;
+    let lastOriginalLine = null;
+    let lastOriginalColumn = null;
+    let lastOriginalName = null;
+    this.walk(function(chunk, original) {
+      generated.code += chunk;
+      if (original.source !== null
+          && original.line !== null
+          && original.column !== null) {
+        if (lastOriginalSource !== original.source
+          || lastOriginalLine !== original.line
+          || lastOriginalColumn !== original.column
+          || lastOriginalName !== original.name) {
+          map.addMapping({
+            source: original.source,
+            original: {
+              line: original.line,
+              column: original.column
+            },
+            generated: {
+              line: generated.line,
+              column: generated.column
+            },
+            name: original.name
+          });
+        }
+        lastOriginalSource = original.source;
+        lastOriginalLine = original.line;
+        lastOriginalColumn = original.column;
+        lastOriginalName = original.name;
+        sourceMappingActive = true;
+      } else if (sourceMappingActive) {
+        map.addMapping({
+          generated: {
+            line: generated.line,
+            column: generated.column
+          }
+        });
+        lastOriginalSource = null;
+        sourceMappingActive = false;
+      }
+      for (let idx = 0, length = chunk.length; idx < length; idx++) {
+        if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+          generated.line++;
+          generated.column = 0;
+          // Mappings end at eol
+          if (idx + 1 === length) {
+            lastOriginalSource = null;
+            sourceMappingActive = false;
+          } else if (sourceMappingActive) {
+            map.addMapping({
+              source: original.source,
+              original: {
+                line: original.line,
+                column: original.column
+              },
+              generated: {
+                line: generated.line,
+                column: generated.column
+              },
+              name: original.name
+            });
+          }
+        } else {
+          generated.column++;
+        }
+      }
+    });
+    this.walkSourceContents(function(sourceFile, sourceContent) {
+      map.setSourceContent(sourceFile, sourceContent);
+    });
+
+    return { code: generated.code, map };
+  }
+}
+
+exports.SourceNode = SourceNode;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url-browser.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..c9da02a8ec2256fa56a7e005d2ed98575a8f1d71
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url-browser.js
@@ -0,0 +1,21 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+"use strict";
+
+/**
+ * Browser 'URL' implementations have been found to handle non-standard URL
+ * schemes poorly, and schemes like
+ *
+ *   webpack:///src/folder/file.js
+ *
+ * are very common in source maps. For the time being we use a JS
+ * implementation in these contexts instead. See
+ *
+ * * https://bugzilla.mozilla.org/show_bug.cgi?id=1374505
+ * * https://bugs.chromium.org/p/chromium/issues/detail?id=734880
+ */
+module.exports = require("whatwg-url").URL;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url.js
new file mode 100644
index 0000000000000000000000000000000000000000..8bb71b6ac19eb83d406ae4ac75bd17476ca5b5d5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/url.js
@@ -0,0 +1,13 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+"use strict";
+
+// Note: This file is overridden in the 'package.json#browser' field to
+// substitute lib/url-browser.js instead.
+
+// Use the URL global for Node 10, and the 'url' module for Node 8.
+module.exports = typeof URL === "function" ? URL : require("url").URL;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/util.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/util.js
new file mode 100644
index 0000000000000000000000000000000000000000..430ec4de0a8d2aca195a8e3d1922750d3411e616
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/util.js
@@ -0,0 +1,438 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+const URL = require("./url");
+
+/**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+function getArg(aArgs, aName, aDefaultValue) {
+  if (aName in aArgs) {
+    return aArgs[aName];
+  } else if (arguments.length === 3) {
+    return aDefaultValue;
+  }
+    throw new Error('"' + aName + '" is a required argument.');
+
+}
+exports.getArg = getArg;
+
+const supportsNullProto = (function() {
+  const obj = Object.create(null);
+  return !("__proto__" in obj);
+}());
+
+function identity(s) {
+  return s;
+}
+
+/**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+function toSetString(aStr) {
+  if (isProtoString(aStr)) {
+    return "$" + aStr;
+  }
+
+  return aStr;
+}
+exports.toSetString = supportsNullProto ? identity : toSetString;
+
+function fromSetString(aStr) {
+  if (isProtoString(aStr)) {
+    return aStr.slice(1);
+  }
+
+  return aStr;
+}
+exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+function isProtoString(s) {
+  if (!s) {
+    return false;
+  }
+
+  const length = s.length;
+
+  if (length < 9 /* "__proto__".length */) {
+    return false;
+  }
+
+  /* eslint-disable no-multi-spaces */
+  if (s.charCodeAt(length - 1) !== 95  /* '_' */ ||
+      s.charCodeAt(length - 2) !== 95  /* '_' */ ||
+      s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+      s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+      s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+      s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+      s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+      s.charCodeAt(length - 8) !== 95  /* '_' */ ||
+      s.charCodeAt(length - 9) !== 95  /* '_' */) {
+    return false;
+  }
+  /* eslint-enable no-multi-spaces */
+
+  for (let i = length - 10; i >= 0; i--) {
+    if (s.charCodeAt(i) !== 36 /* '$' */) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+function strcmp(aStr1, aStr2) {
+  if (aStr1 === aStr2) {
+    return 0;
+  }
+
+  if (aStr1 === null) {
+    return 1; // aStr2 !== null
+  }
+
+  if (aStr2 === null) {
+    return -1; // aStr1 !== null
+  }
+
+  if (aStr1 > aStr2) {
+    return 1;
+  }
+
+  return -1;
+}
+
+/**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+  let cmp = mappingA.generatedLine - mappingB.generatedLine;
+  if (cmp !== 0) {
+    return cmp;
+  }
+
+  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+  if (cmp !== 0) {
+    return cmp;
+  }
+
+  cmp = strcmp(mappingA.source, mappingB.source);
+  if (cmp !== 0) {
+    return cmp;
+  }
+
+  cmp = mappingA.originalLine - mappingB.originalLine;
+  if (cmp !== 0) {
+    return cmp;
+  }
+
+  cmp = mappingA.originalColumn - mappingB.originalColumn;
+  if (cmp !== 0) {
+    return cmp;
+  }
+
+  return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+
+/**
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
+ * in the source maps specification), and then parse the string as
+ * JSON.
+ */
+function parseSourceMapInput(str) {
+  return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
+}
+exports.parseSourceMapInput = parseSourceMapInput;
+
+// We use 'http' as the base here because we want URLs processed relative
+// to the safe base to be treated as "special" URLs during parsing using
+// the WHATWG URL parsing. This ensures that backslash normalization
+// applies to the path and such.
+const PROTOCOL = "http:";
+const PROTOCOL_AND_HOST = `${PROTOCOL}//host`;
+
+/**
+ * Make it easy to create small utilities that tweak a URL's path.
+ */
+function createSafeHandler(cb) {
+  return input => {
+    const type = getURLType(input);
+    const base = buildSafeBase(input);
+    const url = new URL(input, base);
+
+    cb(url);
+
+    const result = url.toString();
+
+    if (type === "absolute") {
+      return result;
+    } else if (type === "scheme-relative") {
+      return result.slice(PROTOCOL.length);
+    } else if (type === "path-absolute") {
+      return result.slice(PROTOCOL_AND_HOST.length);
+    }
+
+    // This assumes that the callback will only change
+    // the path, search and hash values.
+    return computeRelativeURL(base, result);
+  };
+}
+
+function withBase(url, base) {
+  return new URL(url, base).toString();
+}
+
+function buildUniqueSegment(prefix, str) {
+  let id = 0;
+  do {
+    const ident = prefix + (id++);
+    if (str.indexOf(ident) === -1) return ident;
+  } while (true);
+}
+
+function buildSafeBase(str) {
+  const maxDotParts = str.split("..").length - 1;
+
+  // If we used a segment that also existed in `str`, then we would be unable
+  // to compute relative paths. For example, if `segment` were just "a":
+  //
+  //   const url = "../../a/"
+  //   const base = buildSafeBase(url); // http://host/a/a/
+  //   const joined = "http://host/a/";
+  //   const result = relative(base, joined);
+  //
+  // Expected: "../../a/";
+  // Actual: "a/"
+  //
+  const segment = buildUniqueSegment("p", str);
+
+  let base = `${PROTOCOL_AND_HOST}/`;
+  for (let i = 0; i < maxDotParts; i++) {
+    base += `${segment}/`;
+  }
+  return base;
+}
+
+const ABSOLUTE_SCHEME = /^[A-Za-z0-9\+\-\.]+:/;
+function getURLType(url) {
+  if (url[0] === "/") {
+    if (url[1] === "/") return "scheme-relative";
+    return "path-absolute";
+  }
+
+  return ABSOLUTE_SCHEME.test(url) ? "absolute" : "path-relative";
+}
+
+/**
+ * Given two URLs that are assumed to be on the same
+ * protocol/host/user/password build a relative URL from the
+ * path, params, and hash values.
+ *
+ * @param rootURL The root URL that the target will be relative to.
+ * @param targetURL The target that the relative URL points to.
+ * @return A rootURL-relative, normalized URL value.
+ */
+function computeRelativeURL(rootURL, targetURL) {
+  if (typeof rootURL === "string") rootURL = new URL(rootURL);
+  if (typeof targetURL === "string") targetURL = new URL(targetURL);
+
+  const targetParts = targetURL.pathname.split("/");
+  const rootParts = rootURL.pathname.split("/");
+
+  // If we've got a URL path ending with a "/", we remove it since we'd
+  // otherwise be relative to the wrong location.
+  if (rootParts.length > 0 && !rootParts[rootParts.length - 1]) {
+    rootParts.pop();
+  }
+
+  while (
+    targetParts.length > 0 &&
+    rootParts.length > 0 &&
+    targetParts[0] === rootParts[0]
+  ) {
+    targetParts.shift();
+    rootParts.shift();
+  }
+
+  const relativePath = rootParts
+    .map(() => "..")
+    .concat(targetParts)
+    .join("/");
+
+  return relativePath + targetURL.search + targetURL.hash;
+}
+
+/**
+ * Given a URL, ensure that it is treated as a directory URL.
+ *
+ * @param url
+ * @return A normalized URL value.
+ */
+const ensureDirectory = createSafeHandler(url => {
+  url.pathname = url.pathname.replace(/\/?$/, "/");
+});
+
+/**
+ * Given a URL, strip off any filename if one is present.
+ *
+ * @param url
+ * @return A normalized URL value.
+ */
+const trimFilename = createSafeHandler(url => {
+  url.href = new URL(".", url.toString()).toString();
+});
+
+/**
+ * Normalize a given URL.
+ * * Convert backslashes.
+ * * Remove any ".." and "." segments.
+ *
+ * @param url
+ * @return A normalized URL value.
+ */
+const normalize = createSafeHandler(url => {});
+exports.normalize = normalize;
+
+/**
+ * Joins two paths/URLs.
+ *
+ * All returned URLs will be normalized.
+ *
+ * @param aRoot The root path or URL. Assumed to reference a directory.
+ * @param aPath The path or URL to be joined with the root.
+ * @return A joined and normalized URL value.
+ */
+function join(aRoot, aPath) {
+  const pathType = getURLType(aPath);
+  const rootType = getURLType(aRoot);
+
+  aRoot = ensureDirectory(aRoot);
+
+  if (pathType === "absolute") {
+    return withBase(aPath, undefined);
+  }
+  if (rootType === "absolute") {
+    return withBase(aPath, aRoot);
+  }
+
+  if (pathType === "scheme-relative") {
+    return normalize(aPath);
+  }
+  if (rootType === "scheme-relative") {
+    return withBase(aPath, withBase(aRoot, PROTOCOL_AND_HOST)).slice(PROTOCOL.length);
+  }
+
+  if (pathType === "path-absolute") {
+    return normalize(aPath);
+  }
+  if (rootType === "path-absolute") {
+    return withBase(aPath, withBase(aRoot, PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);
+  }
+
+  const base = buildSafeBase(aPath + aRoot);
+  const newPath = withBase(aPath, withBase(aRoot, base));
+  return computeRelativeURL(base, newPath);
+}
+exports.join = join;
+
+/**
+ * Make a path relative to a URL or another path. If returning a
+ * relative URL is not possible, the original target will be returned.
+ * All returned URLs will be normalized.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ * @return A rootURL-relative (if possible), normalized URL value.
+ */
+function relative(rootURL, targetURL) {
+  const result = relativeIfPossible(rootURL, targetURL);
+
+  return typeof result === "string" ? result : normalize(targetURL);
+}
+exports.relative = relative;
+
+function relativeIfPossible(rootURL, targetURL) {
+  const urlType = getURLType(rootURL);
+  if (urlType !== getURLType(targetURL)) {
+    return null;
+  }
+
+  const base = buildSafeBase(rootURL + targetURL);
+  const root = new URL(rootURL, base);
+  const target = new URL(targetURL, base);
+
+  try {
+    new URL("", target.toString());
+  } catch (err) {
+    // Bail if the URL doesn't support things being relative to it,
+    // For example, data: and blob: URLs.
+    return null;
+  }
+
+  if (
+    target.protocol !== root.protocol ||
+    target.user !== root.user ||
+    target.password !== root.password ||
+    target.hostname !== root.hostname ||
+    target.port !== root.port
+  ) {
+    return null;
+  }
+
+  return computeRelativeURL(root, target);
+}
+
+/**
+ * Compute the URL of a source given the the source root, the source's
+ * URL, and the source map's URL.
+ */
+function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
+  // The source map spec states that "sourceRoot" and "sources" entries are to be appended. While
+  // that is a little vague, implementations have generally interpreted that as joining the
+  // URLs with a `/` between then, assuming the "sourceRoot" doesn't already end with one.
+  // For example,
+  //
+  //   sourceRoot: "some-dir",
+  //   sources: ["/some-path.js"]
+  //
+  // and
+  //
+  //   sourceRoot: "some-dir/",
+  //   sources: ["/some-path.js"]
+  //
+  // must behave as "some-dir/some-path.js".
+  //
+  // With this library's the transition to a more URL-focused implementation, that behavior is
+  // preserved here. To acheive that, we trim the "/" from absolute-path when a sourceRoot value
+  // is present in order to make the sources entries behave as if they are relative to the
+  // "sourceRoot", as they would have if the two strings were simply concated.
+  if (sourceRoot && getURLType(sourceURL) === "path-absolute") {
+    sourceURL = sourceURL.replace(/^\//, "");
+  }
+
+  let url = normalize(sourceURL || "");
+
+  // Parsing URLs can be expensive, so we only perform these joins when needed.
+  if (sourceRoot) url = join(sourceRoot, url);
+  if (sourceMapURL) url = join(trimFilename(sourceMapURL), url);
+  return url;
+}
+exports.computeSourceURL = computeSourceURL;
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/wasm.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/wasm.js
new file mode 100644
index 0000000000000000000000000000000000000000..88b18bea809f563ede8bf58b57abc8d6f8332c79
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/lib/wasm.js
@@ -0,0 +1,107 @@
+const readWasm = require("../lib/read-wasm");
+
+/**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+function Mapping() {
+  this.generatedLine = 0;
+  this.generatedColumn = 0;
+  this.lastGeneratedColumn = null;
+  this.source = null;
+  this.originalLine = null;
+  this.originalColumn = null;
+  this.name = null;
+}
+
+let cachedWasm = null;
+
+module.exports = function wasm() {
+  if (cachedWasm) {
+    return cachedWasm;
+  }
+
+  const callbackStack = [];
+
+  cachedWasm = readWasm().then(buffer => {
+      return WebAssembly.instantiate(buffer, {
+        env: {
+          mapping_callback(
+            generatedLine,
+            generatedColumn,
+
+            hasLastGeneratedColumn,
+            lastGeneratedColumn,
+
+            hasOriginal,
+            source,
+            originalLine,
+            originalColumn,
+
+            hasName,
+            name
+          ) {
+            const mapping = new Mapping();
+            // JS uses 1-based line numbers, wasm uses 0-based.
+            mapping.generatedLine = generatedLine + 1;
+            mapping.generatedColumn = generatedColumn;
+
+            if (hasLastGeneratedColumn) {
+              // JS uses inclusive last generated column, wasm uses exclusive.
+              mapping.lastGeneratedColumn = lastGeneratedColumn - 1;
+            }
+
+            if (hasOriginal) {
+              mapping.source = source;
+              // JS uses 1-based line numbers, wasm uses 0-based.
+              mapping.originalLine = originalLine + 1;
+              mapping.originalColumn = originalColumn;
+
+              if (hasName) {
+                mapping.name = name;
+              }
+            }
+
+            callbackStack[callbackStack.length - 1](mapping);
+          },
+
+          start_all_generated_locations_for() { console.time("all_generated_locations_for"); },
+          end_all_generated_locations_for() { console.timeEnd("all_generated_locations_for"); },
+
+          start_compute_column_spans() { console.time("compute_column_spans"); },
+          end_compute_column_spans() { console.timeEnd("compute_column_spans"); },
+
+          start_generated_location_for() { console.time("generated_location_for"); },
+          end_generated_location_for() { console.timeEnd("generated_location_for"); },
+
+          start_original_location_for() { console.time("original_location_for"); },
+          end_original_location_for() { console.timeEnd("original_location_for"); },
+
+          start_parse_mappings() { console.time("parse_mappings"); },
+          end_parse_mappings() { console.timeEnd("parse_mappings"); },
+
+          start_sort_by_generated_location() { console.time("sort_by_generated_location"); },
+          end_sort_by_generated_location() { console.timeEnd("sort_by_generated_location"); },
+
+          start_sort_by_original_location() { console.time("sort_by_original_location"); },
+          end_sort_by_original_location() { console.timeEnd("sort_by_original_location"); },
+        }
+      });
+  }).then(Wasm => {
+    return {
+      exports: Wasm.instance.exports,
+      withMappingCallback: (mappingCallback, f) => {
+        callbackStack.push(mappingCallback);
+        try {
+          f();
+        } finally {
+          callbackStack.pop();
+        }
+      }
+    };
+  }).then(null, e => {
+    cachedWasm = null;
+    throw e;
+  });
+
+  return cachedWasm;
+};
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/package.json b/tools/ui/node_modules/workbox-build/node_modules/source-map/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..878fc676dbfcbd62d878723c23c2d090d0843439
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/package.json
@@ -0,0 +1,95 @@
+{
+  "name": "source-map",
+  "description": "Generates and consumes source maps",
+  "version": "0.8.0-beta.0",
+  "homepage": "https://github.com/mozilla/source-map",
+  "author": "Nick Fitzgerald ",
+  "contributors": [
+    "Tobias Koppers ",
+    "Duncan Beevers ",
+    "Stephen Crane ",
+    "Ryan Seddon ",
+    "Miles Elam ",
+    "Mihai Bazon ",
+    "Michael Ficarra ",
+    "Todd Wolfson ",
+    "Alexander Solovyov ",
+    "Felix Gnass ",
+    "Conrad Irwin ",
+    "usrbincc ",
+    "David Glasser ",
+    "Chase Douglas ",
+    "Evan Wallace ",
+    "Heather Arthur ",
+    "Hugh Kennedy ",
+    "David Glasser ",
+    "Simon Lydell ",
+    "Jmeas Smith ",
+    "Michael Z Goddard ",
+    "azu ",
+    "John Gozde ",
+    "Adam Kirkton ",
+    "Chris Montgomery ",
+    "J. Ryan Stinnett ",
+    "Jack Herrington ",
+    "Chris Truter ",
+    "Daniel Espeset ",
+    "Jamie Wong ",
+    "Eddy Bruël ",
+    "Hawken Rives ",
+    "Gilad Peleg ",
+    "djchie ",
+    "Gary Ye ",
+    "Nicolas Lalevée "
+  ],
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/mozilla/source-map.git"
+  },
+  "main": "./source-map.js",
+  "types": "./source-map.d.ts",
+  "browser": {
+    "./lib/url.js": "./lib/url-browser.js",
+    "./lib/read-wasm.js": "./lib/read-wasm-browser.js"
+  },
+  "files": [
+    "source-map.js",
+    "source-map.d.ts",
+    "lib/"
+  ],
+  "publishConfig": {
+    "tag": "next"
+  },
+  "engines": {
+    "node": ">= 8"
+  },
+  "license": "BSD-3-Clause",
+  "scripts": {
+    "lint": "eslint *.js lib/ test/",
+    "prebuild": "npm run lint",
+    "test": "node test/run-tests.js",
+    "coverage": "nyc node test/run-tests.js",
+    "setup": "mkdir -p coverage && cp -n .waiting.html coverage/index.html || true",
+    "dev:live": "live-server --port=4103 --ignorePattern='(js|css|png)$' coverage",
+    "dev:watch": "watch 'npm run coverage' lib/ test/",
+    "predev": "npm run setup",
+    "dev": "npm-run-all -p --silent dev:*",
+    "clean": "rm -rf coverage .nyc_output",
+    "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
+  },
+  "devDependencies": {
+    "doctoc": "^1.3.1",
+    "eslint": "^4.19.1",
+    "live-server": "^1.2.0",
+    "npm-run-all": "^4.1.2",
+    "nyc": "^11.7.1",
+    "watch": "^1.0.2"
+  },
+  "nyc": {
+    "reporter": "html"
+  },
+  "typings": "source-map",
+  "dependencies": {
+    "whatwg-url": "^7.0.0"
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.d.ts b/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2459391592c19a0249514767a6d58563210bef28
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.d.ts
@@ -0,0 +1,369 @@
+// Type definitions for source-map 0.7
+// Project: https://github.com/mozilla/source-map
+// Definitions by: Morten Houston Ludvigsen ,
+//                 Ron Buckton ,
+//                 John Vilk 
+// Definitions: https://github.com/mozilla/source-map
+export type SourceMapUrl = string;
+
+export interface StartOfSourceMap {
+    file?: string;
+    sourceRoot?: string;
+    skipValidation?: boolean;
+}
+
+export interface RawSourceMap {
+    version: number;
+    sources: string[];
+    names: string[];
+    sourceRoot?: string;
+    sourcesContent?: string[];
+    mappings: string;
+    file: string;
+}
+
+export interface RawIndexMap extends StartOfSourceMap {
+    version: number;
+    sections: RawSection[];
+}
+
+export interface RawSection {
+    offset: Position;
+    map: RawSourceMap;
+}
+
+export interface Position {
+    line: number;
+    column: number;
+}
+
+export interface NullablePosition {
+    line: number | null;
+    column: number | null;
+    lastColumn: number | null;
+}
+
+export interface MappedPosition {
+    source: string;
+    line: number;
+    column: number;
+    name?: string;
+}
+
+export interface NullableMappedPosition {
+    source: string | null;
+    line: number | null;
+    column: number | null;
+    name: string | null;
+}
+
+export interface MappingItem {
+    source: string;
+    generatedLine: number;
+    generatedColumn: number;
+    originalLine: number;
+    originalColumn: number;
+    name: string;
+}
+
+export interface Mapping {
+    generated: Position;
+    original: Position;
+    source: string;
+    name?: string;
+}
+
+export interface CodeWithSourceMap {
+    code: string;
+    map: SourceMapGenerator;
+}
+
+export interface SourceMapConsumer {
+    /**
+     * Compute the last column for each generated mapping. The last column is
+     * inclusive.
+     */
+    computeColumnSpans(): void;
+
+    /**
+     * Returns the original source, line, and column information for the generated
+     * source's line and column positions provided. The only argument is an object
+     * with the following properties:
+     *
+     *   - line: The line number in the generated source.
+     *   - column: The column number in the generated source.
+     *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+     *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+     *     closest element that is smaller than or greater than the one we are
+     *     searching for, respectively, if the exact element cannot be found.
+     *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+     *
+     * and an object is returned with the following properties:
+     *
+     *   - source: The original source file, or null.
+     *   - line: The line number in the original source, or null.
+     *   - column: The column number in the original source, or null.
+     *   - name: The original identifier, or null.
+     */
+    originalPositionFor(generatedPosition: Position & { bias?: number }): NullableMappedPosition;
+
+    /**
+     * Returns the generated line and column information for the original source,
+     * line, and column positions provided. The only argument is an object with
+     * the following properties:
+     *
+     *   - source: The filename of the original source.
+     *   - line: The line number in the original source.
+     *   - column: The column number in the original source.
+     *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+     *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+     *     closest element that is smaller than or greater than the one we are
+     *     searching for, respectively, if the exact element cannot be found.
+     *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+     *
+     * and an object is returned with the following properties:
+     *
+     *   - line: The line number in the generated source, or null.
+     *   - column: The column number in the generated source, or null.
+     */
+    generatedPositionFor(originalPosition: MappedPosition & { bias?: number }): NullablePosition;
+
+    /**
+     * Returns all generated line and column information for the original source,
+     * line, and column provided. If no column is provided, returns all mappings
+     * corresponding to a either the line we are searching for or the next
+     * closest line that has any mappings. Otherwise, returns all mappings
+     * corresponding to the given line and either the column we are searching for
+     * or the next closest column that has any offsets.
+     *
+     * The only argument is an object with the following properties:
+     *
+     *   - source: The filename of the original source.
+     *   - line: The line number in the original source.
+     *   - column: Optional. the column number in the original source.
+     *
+     * and an array of objects is returned, each with the following properties:
+     *
+     *   - line: The line number in the generated source, or null.
+     *   - column: The column number in the generated source, or null.
+     */
+    allGeneratedPositionsFor(originalPosition: MappedPosition): NullablePosition[];
+
+    /**
+     * Return true if we have the source content for every source in the source
+     * map, false otherwise.
+     */
+    hasContentsOfAllSources(): boolean;
+
+    /**
+     * Returns the original source content. The only argument is the url of the
+     * original source file. Returns null if no original source content is
+     * available.
+     */
+    sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;
+
+    /**
+     * Iterate over each mapping between an original source/line/column and a
+     * generated line/column in this source map.
+     *
+     * @param callback
+     *        The function that is called with each mapping.
+     * @param context
+     *        Optional. If specified, this object will be the value of `this` every
+     *        time that `aCallback` is called.
+     * @param order
+     *        Either `SourceMapConsumer.GENERATED_ORDER` or
+     *        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+     *        iterate over the mappings sorted by the generated file's line/column
+     *        order or the original's source/line/column order, respectively. Defaults to
+     *        `SourceMapConsumer.GENERATED_ORDER`.
+     */
+    eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
+    /**
+     * Free this source map consumer's associated wasm data that is manually-managed.
+     * Alternatively, you can use SourceMapConsumer.with to avoid needing to remember to call destroy.
+     */
+    destroy(): void;
+}
+
+export interface SourceMapConsumerConstructor {
+    prototype: SourceMapConsumer;
+
+    GENERATED_ORDER: number;
+    ORIGINAL_ORDER: number;
+    GREATEST_LOWER_BOUND: number;
+    LEAST_UPPER_BOUND: number;
+
+    new (rawSourceMap: RawSourceMap, sourceMapUrl?: SourceMapUrl): Promise;
+    new (rawSourceMap: RawIndexMap, sourceMapUrl?: SourceMapUrl): Promise;
+    new (rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl?: SourceMapUrl): Promise;
+
+    /**
+     * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+     *
+     * @param sourceMap
+     *        The source map that will be consumed.
+     */
+    fromSourceMap(sourceMap: SourceMapGenerator, sourceMapUrl?: SourceMapUrl): Promise;
+
+    /**
+     * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
+     * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
+     * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
+     * for `f` to complete, call `destroy` on the consumer, and return `f`'s return
+     * value.
+     *
+     * You must not use the consumer after `f` completes!
+     *
+     * By using `with`, you do not have to remember to manually call `destroy` on
+     * the consumer, since it will be called automatically once `f` completes.
+     *
+     * ```js
+     * const xSquared = await SourceMapConsumer.with(
+     *   myRawSourceMap,
+     *   null,
+     *   async function (consumer) {
+     *     // Use `consumer` inside here and don't worry about remembering
+     *     // to call `destroy`.
+     *
+     *     const x = await whatever(consumer);
+     *     return x * x;
+     *   }
+     * );
+     *
+     * // You may not use that `consumer` anymore out here; it has
+     * // been destroyed. But you can use `xSquared`.
+     * console.log(xSquared);
+     * ```
+     */
+    with(rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl: SourceMapUrl | null | undefined, callback: (consumer: BasicSourceMapConsumer | IndexedSourceMapConsumer) => Promise | T): Promise;
+}
+
+export const SourceMapConsumer: SourceMapConsumerConstructor;
+
+export interface BasicSourceMapConsumer extends SourceMapConsumer {
+    file: string;
+    sourceRoot: string;
+    sources: string[];
+    sourcesContent: string[];
+}
+
+export interface BasicSourceMapConsumerConstructor {
+    prototype: BasicSourceMapConsumer;
+
+    new (rawSourceMap: RawSourceMap | string): Promise;
+
+    /**
+     * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+     *
+     * @param sourceMap
+     *        The source map that will be consumed.
+     */
+    fromSourceMap(sourceMap: SourceMapGenerator): Promise;
+}
+
+export const BasicSourceMapConsumer: BasicSourceMapConsumerConstructor;
+
+export interface IndexedSourceMapConsumer extends SourceMapConsumer {
+    sources: string[];
+}
+
+export interface IndexedSourceMapConsumerConstructor {
+    prototype: IndexedSourceMapConsumer;
+
+    new (rawSourceMap: RawIndexMap | string): Promise;
+}
+
+export const IndexedSourceMapConsumer: IndexedSourceMapConsumerConstructor;
+
+export class SourceMapGenerator {
+    constructor(startOfSourceMap?: StartOfSourceMap);
+
+    /**
+     * Creates a new SourceMapGenerator based on a SourceMapConsumer
+     *
+     * @param sourceMapConsumer The SourceMap.
+     */
+    static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
+
+    /**
+     * Add a single mapping from original source line and column to the generated
+     * source's line and column for this source map being created. The mapping
+     * object should have the following properties:
+     *
+     *   - generated: An object with the generated line and column positions.
+     *   - original: An object with the original line and column positions.
+     *   - source: The original source file (relative to the sourceRoot).
+     *   - name: An optional original token name for this mapping.
+     */
+    addMapping(mapping: Mapping): void;
+
+    /**
+     * Set the source content for a source file.
+     */
+    setSourceContent(sourceFile: string, sourceContent: string): void;
+
+    /**
+     * Applies the mappings of a sub-source-map for a specific source file to the
+     * source map being generated. Each mapping to the supplied source file is
+     * rewritten using the supplied source map. Note: The resolution for the
+     * resulting mappings is the minimium of this map and the supplied map.
+     *
+     * @param sourceMapConsumer The source map to be applied.
+     * @param sourceFile Optional. The filename of the source file.
+     *        If omitted, SourceMapConsumer's file property will be used.
+     * @param sourceMapPath Optional. The dirname of the path to the source map
+     *        to be applied. If relative, it is relative to the SourceMapConsumer.
+     *        This parameter is needed when the two source maps aren't in the same
+     *        directory, and the source map to be applied contains relative source
+     *        paths. If so, those relative source paths need to be rewritten
+     *        relative to the SourceMapGenerator.
+     */
+    applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
+
+    toString(): string;
+
+    toJSON(): RawSourceMap;
+}
+
+export class SourceNode {
+    children: SourceNode[];
+    sourceContents: any;
+    line: number;
+    column: number;
+    source: string;
+    name: string;
+
+    constructor();
+    constructor(
+        line: number | null,
+        column: number | null,
+        source: string | null,
+        chunks?: Array<(string | SourceNode)> | SourceNode | string,
+        name?: string
+    );
+
+    static fromStringWithSourceMap(
+        code: string,
+        sourceMapConsumer: SourceMapConsumer,
+        relativePath?: string
+    ): SourceNode;
+
+    add(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
+
+    prepend(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
+
+    setSourceContent(sourceFile: string, sourceContent: string): void;
+
+    walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
+
+    walkSourceContents(fn: (file: string, content: string) => void): void;
+
+    join(sep: string): SourceNode;
+
+    replaceRight(pattern: string, replacement: string): SourceNode;
+
+    toString(): string;
+
+    toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
+}
diff --git a/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.js b/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.js
new file mode 100644
index 0000000000000000000000000000000000000000..a84abf1e0416f08b03f015de8c450796cc8df8b8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/node_modules/source-map/source-map.js
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = require("./lib/source-map-generator").SourceMapGenerator;
+exports.SourceMapConsumer = require("./lib/source-map-consumer").SourceMapConsumer;
+exports.SourceNode = require("./lib/source-node").SourceNode;
diff --git a/tools/ui/node_modules/workbox-build/package.json b/tools/ui/node_modules/workbox-build/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..bfced709b485a71a2a40bb44f4976643883ae73e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/package.json
@@ -0,0 +1,73 @@
+{
+  "name": "workbox-build",
+  "version": "7.4.1",
+  "description": "A module that integrates into your build process, helping you generate a manifest of local files that workbox-sw should precache.",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "caching",
+    "fetch requests",
+    "offline",
+    "file manifest"
+  ],
+  "engines": {
+    "node": ">=20.0.0"
+  },
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/GoogleChrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "dependencies": {
+    "@apideck/better-ajv-errors": "^0.3.1",
+    "@babel/core": "^7.24.4",
+    "@babel/preset-env": "^7.11.0",
+    "@babel/runtime": "^7.11.2",
+    "@rollup/plugin-babel": "^6.1.0",
+    "@rollup/plugin-node-resolve": "^16.0.3",
+    "@rollup/plugin-replace": "^6.0.3",
+    "@rollup/plugin-terser": "^1.0.0",
+    "@trickfilm400/rollup-plugin-off-main-thread": "^3.0.0-pre1",
+    "ajv": "^8.6.0",
+    "common-tags": "^1.8.0",
+    "eta": "^4.5.1",
+    "fast-json-stable-stringify": "^2.1.0",
+    "fs-extra": "^9.0.1",
+    "glob": "^11.0.1",
+    "pretty-bytes": "^5.3.0",
+    "rollup": "^4.53.3",
+    "source-map": "^0.8.0-beta.0",
+    "stringify-object": "^3.3.0",
+    "strip-comments": "^2.0.1",
+    "tempy": "^0.6.0",
+    "upath": "^1.2.0",
+    "workbox-background-sync": "7.4.1",
+    "workbox-broadcast-update": "7.4.1",
+    "workbox-cacheable-response": "7.4.1",
+    "workbox-core": "7.4.1",
+    "workbox-expiration": "7.4.1",
+    "workbox-google-analytics": "7.4.1",
+    "workbox-navigation-preload": "7.4.1",
+    "workbox-precaching": "7.4.1",
+    "workbox-range-requests": "7.4.1",
+    "workbox-recipes": "7.4.1",
+    "workbox-routing": "7.4.1",
+    "workbox-strategies": "7.4.1",
+    "workbox-streams": "7.4.1",
+    "workbox-sw": "7.4.1",
+    "workbox-window": "7.4.1"
+  },
+  "main": "build/index.js",
+  "workbox": {
+    "packageType": "node_ts"
+  },
+  "types": "build/index.d.ts",
+  "devDependencies": {
+    "@types/node": "^20.14.8"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/_types.js b/tools/ui/node_modules/workbox-build/src/_types.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f06f90f4575c6d64eb2804a63b6a5ad341803b3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/_types.js
@@ -0,0 +1,120 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.mjs';
+
+/**
+ * @typedef {Object} ManifestEntry
+ * @property {string} url The URL to the asset in the manifest.
+ * @property {string} revision The revision details for the file. This should be
+ * either a hash generated based on the file contents, or `null` if there is
+ * versioning already included in the URL.
+ * @property {string} [integrity] Integrity metadata that will be used when
+ * making the network request for the URL.
+ *
+ * @memberof module:workbox-build
+ */
+
+/**
+ * @typedef {Object} ManifestTransformResult
+ * @property {Array} manifest
+ * @property {Array|undefined} warnings
+ *
+ * @memberof module:workbox-build
+ */
+
+/**
+ * @typedef {Object} RuntimeCachingEntry
+ *
+ * @property {string|module:workbox-routing~handlerCallback} handler
+ * Either the name of one of the [built-in strategy classes]{@link module:workbox-strategies},
+ * or custom handler callback to use when the generated route matches.
+ *
+ * @property {string|RegExp|module:workbox-routing~matchCallback} urlPattern
+ * The value that will be passed to [`registerRoute()`]{@link module:workbox-routing.registerRoute},
+ * used to determine whether the generated route will match a given request.
+ *
+ * @property {string} [method='GET'] The
+ * [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) that
+ * will match the generated route.
+ *
+ * @property {Object} [options]
+ *
+ * @property {Object} [options.backgroundSync]
+ *
+ * @property {string} [options.backgroundSync.name] The `name` property to use
+ * when creating the
+ * [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
+ *
+ * @property {Object} [options.backgroundSync.options] The `options` property
+ * to use when creating the
+ * [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
+ *
+ * @property {Object} [options.broadcastUpdate]
+ *
+ * @property {string} [options.broadcastUpdate.channelName] The `channelName`
+ * property to use when creating the
+ * [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
+ *
+ * @property {Object} [options.broadcastUpdate.options] The `options` property
+ * to use when creating the
+ * [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
+ *
+ * @property {Object} [options.cacheableResponse]
+ *
+ * @property {Object} [options.cacheableResponse.headers] The `headers` property
+ * to use when creating the
+ * [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
+ *
+ * @property {Array} [options.cacheableResponse.statuses] `statuses`
+ * property to use when creating the
+ * [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
+ *
+ * @property {string} [options.cacheName] The `cacheName` to use when
+ * constructing one of the
+ * [Workbox strategy classes]{@link module:workbox-strategies}.
+ *
+ * @property {Object} [options.fetchOptions] The `fetchOptions` property value
+ * to use when constructing one of the
+ * [Workbox strategy classes]{@link module:workbox-strategies}.
+ *
+ * @property {Object} [options.expiration]
+ *
+ * @property {number} [options.expiration.maxAgeSeconds] The `maxAgeSeconds`
+ * property to use when creating the
+ * [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
+ *
+ * @property {number} [options.expiration.maxEntries] The `maxEntries`
+ * property to use when creating the
+ * [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
+ *
+ * @property {Object} [options.precacheFallback]
+ *
+ * @property {string} [options.precacheFallback.fallbackURL] The `fallbackURL`
+ * property to use when creating the
+ * [`PrecacheFallbackPlugin`]{@link module:workbox-precaching.PrecacheFallbackPlugin}.
+ *
+ * @property {boolean} [options.rangeRequests] Set to `true` to add the
+ * [`RangeRequestsPlugin`]{@link module:workbox-range-requests.RangeRequestsPlugin}
+ * for the strategy being configured.
+ *
+ * @property {Object} [options.matchOptions] The `matchOptions` property value
+ * to use when constructing one of the
+ * [Workbox strategy classes]{@link module:workbox-strategies}.
+ *
+ * @property {number} [options.networkTimeoutSeconds] The
+ * `networkTimeoutSeconds` property value to use when creating a
+ * [`NetworkFirst`]{@link module:workbox-strategies.NetworkFirst} strategy.
+ *
+ * @property {Array} [options.plugins]
+ * One or more [additional plugins](https://developers.google.com/web/tools/workbox/guides/using-plugins#custom_plugins)
+ * to apply to the handler. Useful when you want a plugin that doesn't have a
+ * "shortcut" configuration.
+ *
+ * @memberof module:workbox-build
+ */
diff --git a/tools/ui/node_modules/workbox-build/src/cdn-details.json b/tools/ui/node_modules/workbox-build/src/cdn-details.json
new file mode 100644
index 0000000000000000000000000000000000000000..63d993022c1b414311161f9c9e58bdf21517848a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/cdn-details.json
@@ -0,0 +1,6 @@
+{
+  "origin": "https://storage.googleapis.com",
+  "bucketName": "workbox-cdn",
+  "releasesDir": "releases",
+  "latestVersion": "7.4.1"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/generate-sw.ts b/tools/ui/node_modules/workbox-build/src/generate-sw.ts
new file mode 100644
index 0000000000000000000000000000000000000000..85aa576f6c11212649ec9b00523fb6d4b89eb00e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/generate-sw.ts
@@ -0,0 +1,117 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import upath from 'upath';
+
+import {BuildResult, GetManifestOptions, GenerateSWOptions} from './types';
+import {getFileManifestEntries} from './lib/get-file-manifest-entries';
+import {rebasePath} from './lib/rebase-path';
+import {validateGenerateSWOptions} from './lib/validate-options';
+import {writeSWUsingDefaultTemplate} from './lib/write-sw-using-default-template';
+
+/**
+ * This method creates a list of URLs to precache, referred to as a "precache
+ * manifest", based on the options you provide.
+ *
+ * It also takes in additional options that configures the service worker's
+ * behavior, like any `runtimeCaching` rules it should use.
+ *
+ * Based on the precache manifest and the additional configuration, it writes
+ * a ready-to-use service worker file to disk at `swDest`.
+ *
+ * ```
+ * // The following lists some common options; see the rest of the documentation
+ * // for the full set of options and defaults.
+ * const {count, size, warnings} = await generateSW({
+ *   dontCacheBustURLsMatching: [new RegExp('...')],
+ *   globDirectory: '...',
+ *   globPatterns: ['...', '...'],
+ *   maximumFileSizeToCacheInBytes: ...,
+ *   navigateFallback: '...',
+ *   runtimeCaching: [{
+ *     // Routing via a matchCallback function:
+ *     urlPattern: ({request, url}) => ...,
+ *     handler: '...',
+ *     options: {
+ *       cacheName: '...',
+ *       expiration: {
+ *         maxEntries: ...,
+ *       },
+ *     },
+ *   }, {
+ *     // Routing via a RegExp:
+ *     urlPattern: new RegExp('...'),
+ *     handler: '...',
+ *     options: {
+ *       cacheName: '...',
+ *       plugins: [..., ...],
+ *     },
+ *   }],
+ *   skipWaiting: ...,
+ *   swDest: '...',
+ * });
+ * ```
+ *
+ * @memberof workbox-build
+ */
+export async function generateSW(
+  config: GenerateSWOptions,
+): Promise {
+  const options = validateGenerateSWOptions(config);
+  let entriesResult;
+
+  if (options.globDirectory) {
+    // Make sure we leave swDest out of the precache manifest.
+    options.globIgnores!.push(
+      rebasePath({
+        baseDirectory: options.globDirectory,
+        file: options.swDest,
+      }),
+    );
+
+    // If we create an extra external runtime file, ignore that, too.
+    // See https://rollupjs.org/guide/en/#outputchunkfilenames for naming.
+    if (!options.inlineWorkboxRuntime) {
+      const swDestDir = upath.dirname(options.swDest);
+      const workboxRuntimeFile = upath.join(swDestDir, 'workbox-*.js');
+      options.globIgnores!.push(
+        rebasePath({
+          baseDirectory: options.globDirectory,
+          file: workboxRuntimeFile,
+        }),
+      );
+    }
+
+    // We've previously asserted that options.globDirectory is set, so this
+    // should be a safe cast.
+    entriesResult = await getFileManifestEntries(options as GetManifestOptions);
+  } else {
+    entriesResult = {
+      count: 0,
+      manifestEntries: [],
+      size: 0,
+      warnings: [],
+    };
+  }
+
+  const filePaths = await writeSWUsingDefaultTemplate(
+    Object.assign(
+      {
+        manifestEntries: entriesResult.manifestEntries,
+      },
+      options,
+    ),
+  );
+
+  return {
+    filePaths,
+    count: entriesResult.count,
+    size: entriesResult.size,
+    warnings: entriesResult.warnings,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/get-manifest.ts b/tools/ui/node_modules/workbox-build/src/get-manifest.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c5361418e4f16727f95549931bca01e099120fd2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/get-manifest.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getFileManifestEntries} from './lib/get-file-manifest-entries';
+import {GetManifestOptions, GetManifestResult} from './types';
+import {validateGetManifestOptions} from './lib/validate-options';
+
+/**
+ * This method returns a list of URLs to precache, referred to as a "precache
+ * manifest", along with details about the number of entries and their size,
+ * based on the options you provide.
+ *
+ * ```
+ * // The following lists some common options; see the rest of the documentation
+ * // for the full set of options and defaults.
+ * const {count, manifestEntries, size, warnings} = await getManifest({
+ *   dontCacheBustURLsMatching: [new RegExp('...')],
+ *   globDirectory: '...',
+ *   globPatterns: ['...', '...'],
+ *   maximumFileSizeToCacheInBytes: ...,
+ * });
+ * ```
+ *
+ * @memberof workbox-build
+ */
+export async function getManifest(
+  config: GetManifestOptions,
+): Promise {
+  const options = validateGetManifestOptions(config);
+
+  return await getFileManifestEntries(options);
+}
diff --git a/tools/ui/node_modules/workbox-build/src/index.ts b/tools/ui/node_modules/workbox-build/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f8325fce9e704af7230a0fe1d5b31ae7d09c66a1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/index.ts
@@ -0,0 +1,26 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {copyWorkboxLibraries} from './lib/copy-workbox-libraries';
+import {getModuleURL} from './lib/cdn-utils';
+import {generateSW} from './generate-sw';
+import {getManifest} from './get-manifest';
+import {injectManifest} from './inject-manifest';
+
+/**
+ * @module workbox-build
+ */
+export {
+  copyWorkboxLibraries,
+  generateSW,
+  getManifest,
+  getModuleURL,
+  injectManifest,
+};
+
+export * from './types';
diff --git a/tools/ui/node_modules/workbox-build/src/inject-manifest.ts b/tools/ui/node_modules/workbox-build/src/inject-manifest.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8795ddcaa77aea7b0356417e4bc4b19e2b3f860c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/inject-manifest.ts
@@ -0,0 +1,163 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {RawSourceMap} from 'source-map';
+import assert from 'assert';
+import fse from 'fs-extra';
+import stringify from 'fast-json-stable-stringify';
+import upath from 'upath';
+
+import {BuildResult, InjectManifestOptions} from './types';
+import {errors} from './lib/errors';
+import {escapeRegExp} from './lib/escape-regexp';
+import {getFileManifestEntries} from './lib/get-file-manifest-entries';
+import {getSourceMapURL} from './lib/get-source-map-url';
+import {rebasePath} from './lib/rebase-path';
+import {replaceAndUpdateSourceMap} from './lib/replace-and-update-source-map';
+import {translateURLToSourcemapPaths} from './lib/translate-url-to-sourcemap-paths';
+import {validateInjectManifestOptions} from './lib/validate-options';
+
+/**
+ * This method creates a list of URLs to precache, referred to as a "precache
+ * manifest", based on the options you provide.
+ *
+ * The manifest is injected into the `swSrc` file, and the placeholder string
+ * `injectionPoint` determines where in the file the manifest should go.
+ *
+ * The final service worker file, with the manifest injected, is written to
+ * disk at `swDest`.
+ *
+ * This method will not compile or bundle your `swSrc` file; it just handles
+ * injecting the manifest.
+ *
+ * ```
+ * // The following lists some common options; see the rest of the documentation
+ * // for the full set of options and defaults.
+ * const {count, size, warnings} = await injectManifest({
+ *   dontCacheBustURLsMatching: [new RegExp('...')],
+ *   globDirectory: '...',
+ *   globPatterns: ['...', '...'],
+ *   maximumFileSizeToCacheInBytes: ...,
+ *   swDest: '...',
+ *   swSrc: '...',
+ * });
+ * ```
+ *
+ * @memberof workbox-build
+ */
+export async function injectManifest(
+  config: InjectManifestOptions,
+): Promise {
+  const options = validateInjectManifestOptions(config);
+
+  // Make sure we leave swSrc and swDest out of the precache manifest.
+  for (const file of [options.swSrc, options.swDest]) {
+    options.globIgnores!.push(
+      rebasePath({
+        file,
+        baseDirectory: options.globDirectory,
+      }),
+    );
+  }
+
+  const globalRegexp = new RegExp(escapeRegExp(options.injectionPoint!), 'g');
+
+  const {count, size, manifestEntries, warnings} = await getFileManifestEntries(
+    options,
+  );
+  let swFileContents: string;
+  try {
+    swFileContents = await fse.readFile(options.swSrc, 'utf8');
+  } catch (error) {
+    throw new Error(
+      `${errors['invalid-sw-src']} ${
+        error instanceof Error && error.message ? error.message : ''
+      }`,
+    );
+  }
+
+  const injectionResults = swFileContents.match(globalRegexp);
+  // See https://github.com/GoogleChrome/workbox/issues/2230
+  const injectionPoint = options.injectionPoint ? options.injectionPoint : '';
+  if (!injectionResults) {
+    if (upath.resolve(options.swSrc) === upath.resolve(options.swDest)) {
+      throw new Error(`${errors['same-src-and-dest']} ${injectionPoint}`);
+    }
+    throw new Error(`${errors['injection-point-not-found']} ${injectionPoint}`);
+  }
+
+  assert(
+    injectionResults.length === 1,
+    `${errors['multiple-injection-points']} ${injectionPoint}`,
+  );
+
+  const manifestString = stringify(manifestEntries);
+  const filesToWrite: {[key: string]: string} = {};
+
+  const url = getSourceMapURL(swFileContents);
+  // See https://github.com/GoogleChrome/workbox/issues/2957
+  const {destPath, srcPath, warning} = translateURLToSourcemapPaths(
+    url,
+    options.swSrc,
+    options.swDest,
+  );
+  if (warning) {
+    warnings.push(warning);
+  }
+
+  // If our swSrc file contains a sourcemap, we would invalidate that
+  // mapping if we just replaced injectionPoint with the stringified manifest.
+  // Instead, we need to update the swDest contents as well as the sourcemap
+  // (assuming it's a real file, not a data: URL) at the same time.
+  // See https://github.com/GoogleChrome/workbox/issues/2235
+  // and https://github.com/GoogleChrome/workbox/issues/2648
+  if (srcPath && destPath) {
+    const originalMap = (await fse.readJSON(srcPath, {
+      encoding: 'utf8',
+    })) as RawSourceMap;
+
+    const {map, source} = await replaceAndUpdateSourceMap({
+      originalMap,
+      jsFilename: upath.basename(options.swDest),
+      originalSource: swFileContents,
+      replaceString: manifestString,
+      searchString: options.injectionPoint!,
+    });
+
+    filesToWrite[options.swDest] = source;
+    filesToWrite[destPath] = map;
+  } else {
+    // If there's no sourcemap associated with swSrc, a simple string
+    // replacement will suffice.
+    filesToWrite[options.swDest] = swFileContents.replace(
+      globalRegexp,
+      manifestString,
+    );
+  }
+
+  for (const [file, contents] of Object.entries(filesToWrite)) {
+    try {
+      await fse.mkdirp(upath.dirname(file));
+    } catch (error: unknown) {
+      throw new Error(
+        errors['unable-to-make-sw-directory'] +
+          ` '${error instanceof Error && error.message ? error.message : ''}'`,
+      );
+    }
+
+    await fse.writeFile(file, contents);
+  }
+
+  return {
+    count,
+    size,
+    warnings,
+    // Use upath.resolve() to make all the paths absolute.
+    filePaths: Object.keys(filesToWrite).map((f) => upath.resolve(f)),
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/additional-manifest-entries-transform.ts b/tools/ui/node_modules/workbox-build/src/lib/additional-manifest-entries-transform.ts
new file mode 100644
index 0000000000000000000000000000000000000000..13fc1a687a1602f00db1a0b4399bcf633cccd352
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/additional-manifest-entries-transform.ts
@@ -0,0 +1,58 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {errors} from './errors';
+import {ManifestEntry} from '../types';
+
+type AdditionalManifestEntriesTransform = {
+  (manifest: Array): {
+    manifest: Array;
+    warnings: string[];
+  };
+};
+
+export function additionalManifestEntriesTransform(
+  additionalManifestEntries: Array,
+): AdditionalManifestEntriesTransform {
+  return (manifest: Array) => {
+    const warnings: Array = [];
+    const stringEntries = new Set();
+
+    for (const additionalEntry of additionalManifestEntries) {
+      // Warn about either a string or an object that lacks a revision property.
+      // (An object with a revision property set to null is okay.)
+      if (typeof additionalEntry === 'string') {
+        stringEntries.add(additionalEntry);
+        manifest.push({
+          revision: null,
+          size: 0,
+          url: additionalEntry,
+        });
+      } else {
+        if (additionalEntry && additionalEntry.revision === undefined) {
+          stringEntries.add(additionalEntry.url);
+        }
+        manifest.push(Object.assign({size: 0}, additionalEntry));
+      }
+    }
+
+    if (stringEntries.size > 0) {
+      let urls = '\n';
+      for (const stringEntry of stringEntries) {
+        urls += `  - ${stringEntry}\n`;
+      }
+
+      warnings.push(errors['string-entry-warning'] + urls);
+    }
+
+    return {
+      manifest,
+      warnings,
+    };
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/bundle.ts b/tools/ui/node_modules/workbox-build/src/lib/bundle.ts
new file mode 100644
index 0000000000000000000000000000000000000000..82f50d0ca01efc06dcb476ecc59f26482c2d6e05
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/bundle.ts
@@ -0,0 +1,167 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {babel} from '@rollup/plugin-babel';
+import {nodeResolve} from '@rollup/plugin-node-resolve';
+import {rollup, Plugin} from 'rollup';
+import terser from '@rollup/plugin-terser';
+import {writeFile} from 'fs-extra';
+import omt from '@trickfilm400/rollup-plugin-off-main-thread';
+import presetEnv from '@babel/preset-env';
+import replace from '@rollup/plugin-replace';
+import tempy from 'tempy';
+import upath from 'upath';
+
+import {GeneratePartial, RequiredSWDestPartial} from '../types';
+
+interface NameAndContents {
+  contents: string | Uint8Array;
+  name: string;
+}
+
+export async function bundle({
+  babelPresetEnvTargets,
+  inlineWorkboxRuntime,
+  mode,
+  sourcemap,
+  swDest,
+  unbundledCode,
+}: Omit &
+  RequiredSWDestPartial & {unbundledCode: string}): Promise<
+  Array
+> {
+  // We need to write this to the "real" file system, as Rollup won't read from
+  // a custom file system.
+  const {dir, base} = upath.parse(swDest);
+
+  const temporaryFile = tempy.file({name: base});
+  await writeFile(temporaryFile, unbundledCode);
+
+  const plugins = [
+    nodeResolve(),
+    replace({
+      // See https://github.com/GoogleChrome/workbox/issues/2769
+      'preventAssignment': true,
+      'process.env.NODE_ENV': JSON.stringify(mode),
+    }),
+    babel({
+      babelHelpers: 'bundled',
+      // Disable the logic that checks for local Babel config files:
+      // https://github.com/GoogleChrome/workbox/issues/2111
+      babelrc: false,
+      configFile: false,
+      presets: [
+        [
+          presetEnv,
+          {
+            targets: {
+              browsers: babelPresetEnvTargets,
+            },
+            loose: true,
+          },
+        ],
+      ],
+    }),
+  ];
+
+  if (mode === 'production') {
+    plugins.push(
+      terser({
+        mangle: {
+          toplevel: true,
+          properties: {
+            regex: /(^_|_$)/,
+          },
+        },
+      }),
+    );
+  }
+
+  const rollupConfig: {
+    input: string;
+    plugins: Array;
+  } = {
+    plugins,
+    input: temporaryFile,
+  };
+
+  // Rollup will inline the runtime by default. If we don't want that, we need
+  // to add in some additional config.
+  if (!inlineWorkboxRuntime) {
+    // No lint for omt(), library has no types.
+    // eslint-disable-next-line  @typescript-eslint/no-unsafe-call
+    rollupConfig.plugins.unshift(omt());
+  }
+
+  const bundle = await rollup(rollupConfig);
+
+  const outputOptions: {
+    sourcemap?: boolean;
+    format: 'es' | 'amd';
+    manualChunks?: (id: string) => string | undefined;
+    chunkFileNames?: string;
+    hashCharacters?: 'base64' | 'hex';
+  } = {
+    sourcemap,
+    // Using an external Workbox runtime requires 'amd'.
+    format: inlineWorkboxRuntime ? 'es' : 'amd',
+  };
+
+  if (!inlineWorkboxRuntime) {
+    outputOptions.manualChunks = (id) => {
+      return id.includes('workbox') ? 'workbox' : undefined;
+    };
+    outputOptions.hashCharacters = 'hex';
+  }
+
+  const {output} = await bundle.generate(outputOptions);
+  const files: Array = [];
+  for (const chunkOrAsset of output) {
+    if (chunkOrAsset.type === 'asset') {
+      if (!files.some((f) => f.name === chunkOrAsset.fileName)) {
+        files.push({
+          name: chunkOrAsset.fileName,
+          contents: chunkOrAsset.source,
+        });
+      }
+    } else {
+      let code = chunkOrAsset.code;
+
+      if (chunkOrAsset.map) {
+        const sourceMapFile = chunkOrAsset.fileName + '.map';
+        code += `//# sourceMappingURL=${sourceMapFile}\n`;
+        if (!files.some((f) => f.name === sourceMapFile)) {
+          files.push({
+            name: sourceMapFile,
+            contents: chunkOrAsset.map.toString(),
+          });
+        }
+      }
+
+      if (!files.some((f) => f.name === chunkOrAsset.fileName)) {
+        files.push({
+          name: chunkOrAsset.fileName,
+          contents: code,
+        });
+      }
+    }
+  }
+
+  // Make sure that if there was a directory portion included in swDest, it's
+  // preprended to all of the generated files.
+  return files.map((file) => {
+    file.name = upath.format({
+      dir,
+      base: file.name,
+      ext: '',
+      name: '',
+      root: '',
+    });
+    return file;
+  });
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/cdn-utils.ts b/tools/ui/node_modules/workbox-build/src/lib/cdn-utils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b9b5a53b0f07008a3cec76079572453c0e0feb6d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/cdn-utils.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {ok} from 'assert';
+
+import {BuildType, WorkboxPackageJSON} from '../types';
+import {errors} from './errors';
+import * as cdn from '../cdn-details.json';
+
+function getVersionedURL(): string {
+  return `${getCDNPrefix()}/${cdn.latestVersion}`;
+}
+
+function getCDNPrefix() {
+  return `${cdn.origin}/${cdn.bucketName}/${cdn.releasesDir}`;
+}
+
+export function getModuleURL(moduleName: string, buildType: BuildType): string {
+  ok(moduleName, errors['no-module-name']);
+
+  if (buildType) {
+    // eslint-disable-next-line  @typescript-eslint/no-unsafe-assignment
+    const pkgJson: WorkboxPackageJSON = require(`${moduleName}/package.json`);
+    if (buildType === 'dev' && pkgJson.workbox && pkgJson.workbox.prodOnly) {
+      // This is not due to a public-facing exception, so just throw an Error(),
+      // without creating an entry in errors.js.
+      throw Error(`The 'dev' build of ${moduleName} is not available.`);
+    }
+    return `${getVersionedURL()}/${moduleName}.${buildType.slice(0, 4)}.js`;
+  }
+  return `${getVersionedURL()}/${moduleName}.js`;
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/copy-workbox-libraries.ts b/tools/ui/node_modules/workbox-build/src/lib/copy-workbox-libraries.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f0dbc2f57e7a268a1da636659da10dbfa7d89250
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/copy-workbox-libraries.ts
@@ -0,0 +1,84 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import fse from 'fs-extra';
+import upath from 'upath';
+
+import {WorkboxPackageJSON} from '../types';
+import {errors} from './errors';
+
+// Used to filter the libraries to copy based on our package.json dependencies.
+const WORKBOX_PREFIX = 'workbox-';
+
+// The directory within each package containing the final bundles.
+const BUILD_DIR = 'build';
+
+/**
+ * This copies over a set of runtime libraries used by Workbox into a
+ * local directory, which should be deployed alongside your service worker file.
+ *
+ * As an alternative to deploying these local copies, you could instead use
+ * Workbox from its official CDN URL.
+ *
+ * This method is exposed for the benefit of developers using
+ * {@link workbox-build.injectManifest} who would
+ * prefer not to use the CDN copies of Workbox. Developers using
+ * {@link workbox-build.generateSW} don't need to
+ * explicitly call this method.
+ *
+ * @param {string} destDirectory The path to the parent directory under which
+ * the new directory of libraries will be created.
+ * @return {Promise} The name of the newly created directory.
+ *
+ * @alias workbox-build.copyWorkboxLibraries
+ */
+export async function copyWorkboxLibraries(
+  destDirectory: string,
+): Promise {
+  // eslint-disable-next-line  @typescript-eslint/no-unsafe-assignment
+  const thisPkg: WorkboxPackageJSON = require('../../package.json');
+  // Use the version string from workbox-build in the name of the parent
+  // directory. This should be safe, because lerna will bump workbox-build's
+  // pkg.version whenever one of the dependent libraries gets bumped, and we
+  // care about versioning the dependent libraries.
+  const workboxDirectoryName = `workbox-v${
+    thisPkg.version ? thisPkg.version : ''
+  }`;
+  const workboxDirectoryPath = upath.join(destDirectory, workboxDirectoryName);
+  await fse.ensureDir(workboxDirectoryPath);
+
+  const copyPromises: Array> = [];
+  const librariesToCopy = Object.keys(thisPkg.dependencies || {}).filter(
+    (dependency) => dependency.startsWith(WORKBOX_PREFIX),
+  );
+
+  for (const library of librariesToCopy) {
+    // Get the path to the package on the user's filesystem by require-ing
+    // the package's `package.json` file via the node resolution algorithm.
+    const libraryPath = upath.dirname(
+      require.resolve(`${library}/package.json`),
+    );
+
+    const buildPath = upath.join(libraryPath, BUILD_DIR);
+
+    // fse.copy() copies all the files in a directory, not the directory itself.
+    // See https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy.md#copysrc-dest-options-callback
+    copyPromises.push(fse.copy(buildPath, workboxDirectoryPath));
+  }
+
+  try {
+    await Promise.all(copyPromises);
+    return workboxDirectoryName;
+  } catch (error) {
+    throw Error(
+      `${errors['unable-to-copy-workbox-libraries']} ${
+        error instanceof Error ? error.toString() : ''
+      }`,
+    );
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/errors.ts b/tools/ui/node_modules/workbox-build/src/lib/errors.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bf24ca39287fc4bd440e6638b602752eb46fd79c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/errors.ts
@@ -0,0 +1,124 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {oneLine as ol} from 'common-tags';
+
+export const errors = {
+  'unable-to-get-rootdir': `Unable to get the root directory of your web app.`,
+  'no-extension': ol`Unable to detect a usable extension for a file in your web
+    app directory.`,
+  'invalid-file-manifest-name': ol`The File Manifest Name must have at least one
+    character.`,
+  'unable-to-get-file-manifest-name': 'Unable to get a file manifest name.',
+  'invalid-sw-dest': `The 'swDest' value must be a valid path.`,
+  'unable-to-get-sw-name': 'Unable to get a service worker file name.',
+  'unable-to-get-save-config': ol`An error occurred when asking to save details
+    in a config file.`,
+  'unable-to-get-file-hash': ol`An error occurred when attempting to create a
+    file hash.`,
+  'unable-to-get-file-size': ol`An error occurred when attempting to get a file
+    size.`,
+  'unable-to-glob-files': 'An error occurred when globbing for files.',
+  'unable-to-make-manifest-directory': ol`Unable to make output directory for
+    file manifest.`,
+  'read-manifest-template-failure': 'Unable to read template for file manifest',
+  'populating-manifest-tmpl-failed': ol`An error occurred when populating the
+    file manifest template.`,
+  'manifest-file-write-failure': 'Unable to write the file manifest.',
+  'unable-to-make-sw-directory': ol`Unable to make the directories to output
+    the service worker path.`,
+  'read-sw-template-failure': ol`Unable to read the service worker template
+    file.`,
+  'sw-write-failure': 'Unable to write the service worker file.',
+  'sw-write-failure-directory': ol`Unable to write the service worker file;
+    'swDest' should be a full path to the file, not a path to a directory.`,
+  'unable-to-copy-workbox-libraries': ol`One or more of the Workbox libraries
+    could not be copied over to the destination directory: `,
+  'invalid-generate-sw-input': ol`The input to generateSW() must be an object.`,
+  'invalid-glob-directory': ol`The supplied globDirectory must be a path as a
+    string.`,
+  'invalid-dont-cache-bust': ol`The supplied 'dontCacheBustURLsMatching'
+    parameter must be a RegExp.`,
+  'invalid-exclude-files': 'The excluded files should be an array of strings.',
+  'invalid-get-manifest-entries-input': ol`The input to
+    'getFileManifestEntries()' must be an object.`,
+  'invalid-manifest-path': ol`The supplied manifest path is not a string with
+    at least one character.`,
+  'invalid-manifest-entries': ol`The manifest entries must be an array of
+    strings or JavaScript objects containing a url parameter.`,
+  'invalid-manifest-format': ol`The value of the 'format' option passed to
+    generateFileManifest() must be either 'iife' (the default) or 'es'.`,
+  'invalid-static-file-globs': ol`The 'globPatterns' value must be an array
+    of strings.`,
+  'invalid-templated-urls': ol`The 'templatedURLs' value should be an object
+    that maps URLs to either a string, or to an array of glob patterns.`,
+  'templated-url-matches-glob': ol`One of the 'templatedURLs' URLs is already
+    being tracked via 'globPatterns': `,
+  'invalid-glob-ignores': ol`The 'globIgnores' parameter must be an array of
+    glob pattern strings.`,
+  'manifest-entry-bad-url': ol`The generated manifest contains an entry without
+    a URL string. This is likely an error with workbox-build.`,
+  'modify-url-prefix-bad-prefixes': ol`The 'modifyURLPrefix' parameter must be
+    an object with string key value pairs.`,
+  'invalid-inject-manifest-arg': ol`The input to 'injectManifest()' must be an
+    object.`,
+  'injection-point-not-found': ol`Unable to find a place to inject the manifest.
+    Please ensure that your service worker file contains the following: `,
+  'multiple-injection-points': ol`Please ensure that your 'swSrc' file contains
+    only one match for the following: `,
+  'populating-sw-tmpl-failed': ol`Unable to generate service worker from
+    template.`,
+  'useless-glob-pattern': ol`One of the glob patterns doesn't match any files.
+    Please remove or fix the following: `,
+  'bad-template-urls-asset': ol`There was an issue using one of the provided
+    'templatedURLs'.`,
+  'invalid-runtime-caching': ol`The 'runtimeCaching' parameter must an an
+    array of objects with at least a 'urlPattern' and 'handler'.`,
+  'static-file-globs-deprecated': ol`'staticFileGlobs' is deprecated.
+    Please use 'globPatterns' instead.`,
+  'dynamic-url-deprecated': ol`'dynamicURLToDependencies' is deprecated.
+    Please use 'templatedURLs' instead.`,
+  'urlPattern-is-required': ol`The 'urlPattern' option is required when using
+    'runtimeCaching'.`,
+  'handler-is-required': ol`The 'handler' option is required when using
+    runtimeCaching.`,
+  'invalid-generate-file-manifest-arg': ol`The input to generateFileManifest()
+    must be an Object.`,
+  'invalid-sw-src': `The 'swSrc' file can't be read.`,
+  'same-src-and-dest': ol`Unable to find a place to inject the manifest. This is
+    likely because swSrc and swDest are configured to the same file.
+    Please ensure that your swSrc file contains the following:`,
+  'only-regexp-routes-supported': ol`Please use a regular expression object as
+    the urlPattern parameter. (Express-style routes are not currently
+    supported.)`,
+  'bad-runtime-caching-config': ol`An unknown configuration option was used
+    with runtimeCaching: `,
+  'invalid-network-timeout-seconds': ol`When using networkTimeoutSeconds, you
+    must set the handler to 'NetworkFirst'.`,
+  'no-module-name': ol`You must provide a moduleName parameter when calling
+    getModuleURL().`,
+  'bad-manifest-transforms-return-value': ol`The return value from a
+    manifestTransform should be an object with 'manifest' and optionally
+    'warnings' properties.`,
+  'string-entry-warning': ol`Some items were passed to additionalManifestEntries
+    without revisioning info. This is generally NOT safe. Learn more at
+    https://bit.ly/wb-precache.`,
+  'no-manifest-entries-or-runtime-caching': ol`Couldn't find configuration for
+    either precaching or runtime caching. Please ensure that the various glob
+    options are set to match one or more files, and/or configure the
+    runtimeCaching option.`,
+  'cant-find-sourcemap': ol`The swSrc file refers to a sourcemap that can't be
+    opened:`,
+  'nav-preload-runtime-caching': ol`When using navigationPreload, you must also
+    configure a runtimeCaching route that will use the preloaded response.`,
+  'cache-name-required': ol`When using cache expiration, you must also
+    configure a custom cacheName.`,
+  'manifest-transforms': ol`When using manifestTransforms, you must provide
+    an array of functions.`,
+  'invalid-handler-string': ol`The handler name provided is not valid: `,
+};
diff --git a/tools/ui/node_modules/workbox-build/src/lib/escape-regexp.ts b/tools/ui/node_modules/workbox-build/src/lib/escape-regexp.ts
new file mode 100644
index 0000000000000000000000000000000000000000..139b12975b7589c2e1c29434be2828e839b1ae63
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/escape-regexp.ts
@@ -0,0 +1,12 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
+export function escapeRegExp(str: string): string {
+  return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-composite-details.ts b/tools/ui/node_modules/workbox-build/src/lib/get-composite-details.ts
new file mode 100644
index 0000000000000000000000000000000000000000..011ddcc75022b99f322c32629288a4b9c04f4153
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-composite-details.ts
@@ -0,0 +1,34 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import crypto from 'crypto';
+
+import {FileDetails} from '../types';
+
+export function getCompositeDetails(
+  compositeURL: string,
+  dependencyDetails: Array,
+): FileDetails {
+  let totalSize = 0;
+  let compositeHash = '';
+
+  for (const fileDetails of dependencyDetails) {
+    totalSize += fileDetails.size;
+    compositeHash += fileDetails.hash;
+  }
+
+  const md5 = crypto.createHash('md5');
+  md5.update(compositeHash);
+  const hashOfHashes = md5.digest('hex');
+
+  return {
+    file: compositeURL,
+    hash: hashOfHashes,
+    size: totalSize,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-file-details.ts b/tools/ui/node_modules/workbox-build/src/lib/get-file-details.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c81695ab3bcdaaea5fb14e4afb55ae0a71ed3641
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-file-details.ts
@@ -0,0 +1,75 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {globSync} from 'glob';
+import upath from 'upath';
+
+import {errors} from './errors';
+import {getFileSize} from './get-file-size';
+import {getFileHash} from './get-file-hash';
+
+import {GlobPartial} from '../types';
+
+interface FileDetails {
+  file: string;
+  hash: string;
+  size: number;
+}
+
+export function getFileDetails({
+  globDirectory,
+  globFollow,
+  globIgnores,
+  globPattern,
+}: Omit & {
+  // This will only be called when globDirectory is not undefined.
+  globDirectory: string;
+  globPattern: string;
+}): {
+  globbedFileDetails: Array;
+  warning: string;
+} {
+  let globbedFiles: Array;
+  let warning = '';
+
+  try {
+    globbedFiles = globSync(globPattern, {
+      cwd: globDirectory,
+      follow: globFollow,
+      ignore: globIgnores,
+    });
+  } catch (err) {
+    throw new Error(
+      errors['unable-to-glob-files'] +
+        ` '${err instanceof Error && err.message ? err.message : ''}'`,
+    );
+  }
+
+  if (globbedFiles.length === 0) {
+    warning =
+      errors['useless-glob-pattern'] +
+      ' ' +
+      JSON.stringify({globDirectory, globPattern, globIgnores}, null, 2);
+  }
+
+  const globbedFileDetails: Array = [];
+  for (const file of globbedFiles) {
+    const fullPath = upath.join(globDirectory, file);
+    const fileSize = getFileSize(fullPath);
+    if (fileSize !== null) {
+      const fileHash = getFileHash(fullPath);
+      globbedFileDetails.push({
+        file: `${upath.relative(globDirectory, fullPath)}`,
+        hash: fileHash,
+        size: fileSize,
+      });
+    }
+  }
+
+  return {globbedFileDetails, warning};
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-file-hash.ts b/tools/ui/node_modules/workbox-build/src/lib/get-file-hash.ts
new file mode 100644
index 0000000000000000000000000000000000000000..91c15ec57b5f76a1580ab6a8de81290a1e550081
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-file-hash.ts
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import fse from 'fs-extra';
+
+import {getStringHash} from './get-string-hash';
+import {errors} from './errors';
+
+export function getFileHash(file: string): string {
+  try {
+    const buffer = fse.readFileSync(file);
+    return getStringHash(buffer);
+  } catch (err) {
+    throw new Error(
+      errors['unable-to-get-file-hash'] +
+        ` '${err instanceof Error && err.message ? err.message : ''}'`,
+    );
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-file-manifest-entries.ts b/tools/ui/node_modules/workbox-build/src/lib/get-file-manifest-entries.ts
new file mode 100644
index 0000000000000000000000000000000000000000..680ac0c3f120a58c5afaad66d347ecc2218adf68
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-file-manifest-entries.ts
@@ -0,0 +1,118 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import assert from 'assert';
+
+import {GetManifestResult, FileDetails, GetManifestOptions} from '../types';
+import {errors} from './errors';
+import {getCompositeDetails} from './get-composite-details';
+import {getFileDetails} from './get-file-details';
+import {getStringDetails} from './get-string-details';
+import {transformManifest} from './transform-manifest';
+
+export async function getFileManifestEntries({
+  additionalManifestEntries,
+  dontCacheBustURLsMatching,
+  globDirectory,
+  globFollow,
+  globIgnores,
+  globPatterns = [],
+  manifestTransforms,
+  maximumFileSizeToCacheInBytes,
+  modifyURLPrefix,
+  templatedURLs,
+}: GetManifestOptions): Promise {
+  const warnings: Array = [];
+  const allFileDetails = new Map();
+
+  try {
+    for (const globPattern of globPatterns) {
+      const {globbedFileDetails, warning} = getFileDetails({
+        globDirectory,
+        globFollow,
+        globIgnores,
+        globPattern,
+      });
+
+      if (warning) {
+        warnings.push(warning);
+      }
+
+      for (const details of globbedFileDetails) {
+        if (details && !allFileDetails.has(details.file)) {
+          allFileDetails.set(details.file, details);
+        }
+      }
+    }
+  } catch (error) {
+    // If there's an exception thrown while globbing, then report
+    // it back as a warning, and don't consider it fatal.
+    if (error instanceof Error && error.message) {
+      warnings.push(error.message);
+    }
+  }
+
+  if (templatedURLs) {
+    for (const url of Object.keys(templatedURLs)) {
+      assert(!allFileDetails.has(url), errors['templated-url-matches-glob']);
+
+      const dependencies = templatedURLs[url];
+      if (Array.isArray(dependencies)) {
+        const details = dependencies.reduce>(
+          (previous, globPattern) => {
+            try {
+              const {globbedFileDetails, warning} = getFileDetails({
+                globDirectory,
+                globFollow,
+                globIgnores,
+                globPattern,
+              });
+
+              if (warning) {
+                warnings.push(warning);
+              }
+
+              return previous.concat(globbedFileDetails);
+            } catch (error) {
+              const debugObj: {[key: string]: Array} = {};
+              debugObj[url] = dependencies;
+              throw new Error(
+                `${errors['bad-template-urls-asset']} ` +
+                  `'${globPattern}' from '${JSON.stringify(debugObj)}':\n` +
+                  `${error instanceof Error ? error.toString() : ''}`,
+              );
+            }
+          },
+          [],
+        );
+        if (details.length === 0) {
+          throw new Error(
+            `${errors['bad-template-urls-asset']} The glob ` +
+              `pattern '${dependencies.toString()}' did not match anything.`,
+          );
+        }
+        allFileDetails.set(url, getCompositeDetails(url, details));
+      } else if (typeof dependencies === 'string') {
+        allFileDetails.set(url, getStringDetails(url, dependencies));
+      }
+    }
+  }
+
+  const transformedManifest = await transformManifest({
+    additionalManifestEntries,
+    dontCacheBustURLsMatching,
+    manifestTransforms,
+    maximumFileSizeToCacheInBytes,
+    modifyURLPrefix,
+    fileDetails: Array.from(allFileDetails.values()),
+  });
+
+  transformedManifest.warnings.push(...warnings);
+
+  return transformedManifest;
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-file-size.ts b/tools/ui/node_modules/workbox-build/src/lib/get-file-size.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4368043debe833345a714476191354d097d0f217
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-file-size.ts
@@ -0,0 +1,26 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import fse from 'fs-extra';
+
+import {errors} from './errors';
+
+export function getFileSize(file: string): number | null {
+  try {
+    const stat = fse.statSync(file);
+    if (!stat.isFile()) {
+      return null;
+    }
+    return stat.size;
+  } catch (err) {
+    throw new Error(
+      errors['unable-to-get-file-size'] +
+        ` '${err instanceof Error && err.message ? err.message : ''}'`,
+    );
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-source-map-url.ts b/tools/ui/node_modules/workbox-build/src/lib/get-source-map-url.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6b0aee97bbab17600a79f32af42c9fc51d295a7c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-source-map-url.ts
@@ -0,0 +1,32 @@
+/*
+  Copyright 2022 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+// Adapted from https://github.com/lydell/source-map-url/blob/master/source-map-url.js
+// See https://github.com/GoogleChrome/workbox/issues/3019
+const innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/;
+const regex = RegExp(
+  '(?:' +
+    '/\\*' +
+    '(?:\\s*\r?\n(?://)?)?' +
+    '(?:' +
+    innerRegex.source +
+    ')' +
+    '\\s*' +
+    '\\*/' +
+    '|' +
+    '//(?:' +
+    innerRegex.source +
+    ')' +
+    ')' +
+    '\\s*',
+);
+
+export function getSourceMapURL(srcContents: string): string | null {
+  const match = srcContents.match(regex);
+  return match ? match[1] || match[2] || '' : null;
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-string-details.ts b/tools/ui/node_modules/workbox-build/src/lib/get-string-details.ts
new file mode 100644
index 0000000000000000000000000000000000000000..141863e8432b84b11a15ddee58937ecdf5b6ca1e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-string-details.ts
@@ -0,0 +1,18 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {FileDetails} from '../types';
+import {getStringHash} from './get-string-hash';
+
+export function getStringDetails(url: string, str: string): FileDetails {
+  return {
+    file: url,
+    hash: getStringHash(str),
+    size: str.length,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/get-string-hash.ts b/tools/ui/node_modules/workbox-build/src/lib/get-string-hash.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5ce1a5c1ca28c2d0d121213b249abc1373aac9eb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/get-string-hash.ts
@@ -0,0 +1,15 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import crypto from 'crypto';
+
+export function getStringHash(input: crypto.BinaryLike): string {
+  const md5 = crypto.createHash('md5');
+  md5.update(input);
+  return md5.digest('hex');
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/maximum-size-transform.ts b/tools/ui/node_modules/workbox-build/src/lib/maximum-size-transform.ts
new file mode 100644
index 0000000000000000000000000000000000000000..03a7da4e8a1e1a364d9acba3b5d6f7eb59dd470d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/maximum-size-transform.ts
@@ -0,0 +1,33 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import prettyBytes from 'pretty-bytes';
+
+import {ManifestTransform} from '../types';
+
+export function maximumSizeTransform(
+  maximumFileSizeToCacheInBytes: number,
+): ManifestTransform {
+  return (originalManifest) => {
+    const warnings: Array = [];
+    const manifest = originalManifest.filter((entry) => {
+      if (entry.size <= maximumFileSizeToCacheInBytes) {
+        return true;
+      }
+
+      warnings.push(
+        `${entry.url} is ${prettyBytes(entry.size)}, and won't ` +
+          `be precached. Configure maximumFileSizeToCacheInBytes to change ` +
+          `this limit.`,
+      );
+      return false;
+    });
+
+    return {manifest, warnings};
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/modify-url-prefix-transform.ts b/tools/ui/node_modules/workbox-build/src/lib/modify-url-prefix-transform.ts
new file mode 100644
index 0000000000000000000000000000000000000000..25b710de83198baafa7483c944c62a663ff743f9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/modify-url-prefix-transform.ts
@@ -0,0 +1,61 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {errors} from './errors';
+import {escapeRegExp} from './escape-regexp';
+import {ManifestTransform} from '../types';
+
+export function modifyURLPrefixTransform(modifyURLPrefix: {
+  [key: string]: string;
+}): ManifestTransform {
+  if (
+    !modifyURLPrefix ||
+    typeof modifyURLPrefix !== 'object' ||
+    Array.isArray(modifyURLPrefix)
+  ) {
+    throw new Error(errors['modify-url-prefix-bad-prefixes']);
+  }
+
+  // If there are no entries in modifyURLPrefix, just return an identity
+  // function as a shortcut.
+  if (Object.keys(modifyURLPrefix).length === 0) {
+    return (manifest) => {
+      return {manifest};
+    };
+  }
+
+  for (const key of Object.keys(modifyURLPrefix)) {
+    if (typeof modifyURLPrefix[key] !== 'string') {
+      throw new Error(errors['modify-url-prefix-bad-prefixes']);
+    }
+  }
+
+  // Escape the user input so it's safe to use in a regex.
+  const safeModifyURLPrefixes = Object.keys(modifyURLPrefix).map(escapeRegExp);
+  // Join all the `modifyURLPrefix` keys so a single regex can be used.
+  const prefixMatchesStrings = safeModifyURLPrefixes.join('|');
+  // Add `^` to the front the prefix matches so it only matches the start of
+  // a string.
+  const modifyRegex = new RegExp(`^(${prefixMatchesStrings})`);
+
+  return (originalManifest) => {
+    const manifest = originalManifest.map((entry) => {
+      if (typeof entry.url !== 'string') {
+        throw new Error(errors['manifest-entry-bad-url']);
+      }
+
+      entry.url = entry.url.replace(modifyRegex, (match) => {
+        return modifyURLPrefix[match];
+      });
+
+      return entry;
+    });
+
+    return {manifest};
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/module-registry.ts b/tools/ui/node_modules/workbox-build/src/lib/module-registry.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b3dbb117402c91c7d7d38e0726fde397d2c6e44f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/module-registry.ts
@@ -0,0 +1,73 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {oneLine as ol} from 'common-tags';
+import upath from 'upath';
+
+/**
+ * Class for keeping track of which Workbox modules are used by the generated
+ * service worker script.
+ *
+ * @private
+ */
+export class ModuleRegistry {
+  private readonly _modulesUsed: Map;
+  /**
+   * @private
+   */
+  constructor() {
+    this._modulesUsed = new Map();
+  }
+
+  /**
+   * @return {Array} A list of all of the import statements that are
+   * needed for the modules being used.
+   * @private
+   */
+  getImportStatements(): Array {
+    const workboxModuleImports: Array = [];
+
+    for (const [localName, {moduleName, pkg}] of this._modulesUsed) {
+      // By default require.resolve returns the resolved path of the 'main'
+      // field, which might be deeper than the package root. To work around
+      // this, we can find the package's root by resolving its package.json and
+      // strip the '/package.json' from the resolved path.
+      const pkgJsonPath = require.resolve(`${pkg}/package.json`);
+      const pkgRoot = upath.dirname(pkgJsonPath);
+      const importStatement = ol`import {${moduleName} as ${localName}} from
+        '${pkgRoot}/${moduleName}.mjs';`;
+
+      workboxModuleImports.push(importStatement);
+    }
+
+    return workboxModuleImports;
+  }
+
+  /**
+   * @param {string} pkg The workbox package that the module belongs to.
+   * @param {string} moduleName The name of the module to import.
+   * @return {string} The local variable name that corresponds to that module.
+   * @private
+   */
+  getLocalName(pkg: string, moduleName: string): string {
+    return `${pkg.replace(/-/g, '_')}_${moduleName}`;
+  }
+
+  /**
+   * @param {string} pkg The workbox package that the module belongs to.
+   * @param {string} moduleName The name of the module to import.
+   * @return {string} The local variable name that corresponds to that module.
+   * @private
+   */
+  use(pkg: string, moduleName: string): string {
+    const localName = this.getLocalName(pkg, moduleName);
+    this._modulesUsed.set(localName, {moduleName, pkg});
+
+    return localName;
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/no-revision-for-urls-matching-transform.ts b/tools/ui/node_modules/workbox-build/src/lib/no-revision-for-urls-matching-transform.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0e14d67d2c61c5f3ee3b2ca897df14ba0595dd1c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/no-revision-for-urls-matching-transform.ts
@@ -0,0 +1,34 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {errors} from './errors';
+import {ManifestTransform} from '../types';
+
+export function noRevisionForURLsMatchingTransform(
+  regexp: RegExp,
+): ManifestTransform {
+  if (!(regexp instanceof RegExp)) {
+    throw new Error(errors['invalid-dont-cache-bust']);
+  }
+
+  return (originalManifest) => {
+    const manifest = originalManifest.map((entry) => {
+      if (typeof entry.url !== 'string') {
+        throw new Error(errors['manifest-entry-bad-url']);
+      }
+
+      if (entry.url.match(regexp)) {
+        entry.revision = null;
+      }
+
+      return entry;
+    });
+
+    return {manifest};
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/populate-sw-template.ts b/tools/ui/node_modules/workbox-build/src/lib/populate-sw-template.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dca8437376cebacb6069a0a97f756ad76ef32a86
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/populate-sw-template.ts
@@ -0,0 +1,110 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {Eta} from 'eta';
+
+import {errors} from './errors';
+import {GeneratePartial, ManifestEntry} from '../types';
+import {ModuleRegistry} from './module-registry';
+import {runtimeCachingConverter} from './runtime-caching-converter';
+import {stringifyWithoutComments} from './stringify-without-comments';
+import {swTemplate} from '../templates/sw-template';
+
+const eta = new Eta({
+  useWith: true,
+  autoEscape: false,
+})
+
+export function populateSWTemplate({
+  cacheId,
+  cleanupOutdatedCaches,
+  clientsClaim,
+  directoryIndex,
+  disableDevLogs,
+  ignoreURLParametersMatching,
+  importScripts,
+  manifestEntries = [],
+  navigateFallback,
+  navigateFallbackDenylist,
+  navigateFallbackAllowlist,
+  navigationPreload,
+  offlineGoogleAnalytics,
+  runtimeCaching = [],
+  skipWaiting,
+}: GeneratePartial & {manifestEntries?: Array}): string {
+  // There needs to be at least something to precache, or else runtime caching.
+  if (!(manifestEntries?.length > 0 || runtimeCaching.length > 0)) {
+    throw new Error(errors['no-manifest-entries-or-runtime-caching']);
+  }
+
+  // These are all options that can be passed to the precacheAndRoute() method.
+  const precacheOptions = {
+    directoryIndex,
+    // An array of RegExp objects can't be serialized by JSON.stringify()'s
+    // default behavior, so if it's given, convert it manually.
+    ignoreURLParametersMatching: ignoreURLParametersMatching
+      ? ([] as Array)
+      : undefined,
+  };
+
+  let precacheOptionsString = JSON.stringify(precacheOptions, null, 2);
+  if (ignoreURLParametersMatching) {
+    precacheOptionsString = precacheOptionsString.replace(
+      `"ignoreURLParametersMatching": []`,
+      `"ignoreURLParametersMatching": [` +
+        `${ignoreURLParametersMatching.join(', ')}]`,
+    );
+  }
+
+  let offlineAnalyticsConfigString: string | undefined = undefined;
+  if (offlineGoogleAnalytics) {
+    // If offlineGoogleAnalytics is a truthy value, we need to convert it to the
+    // format expected by the template.
+    offlineAnalyticsConfigString =
+      offlineGoogleAnalytics === true
+        ? // If it's the literal value true, then use an empty config string.
+          '{}'
+        : // Otherwise, convert the config object into a more complex string, taking
+          // into account the fact that functions might need to be stringified.
+          stringifyWithoutComments(offlineGoogleAnalytics);
+  }
+
+  const moduleRegistry = new ModuleRegistry();
+
+  try {
+    const populatedTemplate = eta.renderString(swTemplate, {
+      cacheId,
+      cleanupOutdatedCaches,
+      clientsClaim,
+      disableDevLogs,
+      importScripts,
+      manifestEntries,
+      navigateFallback,
+      navigateFallbackDenylist,
+      navigateFallbackAllowlist,
+      navigationPreload,
+      offlineAnalyticsConfigString,
+      precacheOptionsString,
+      runtimeCaching: runtimeCachingConverter(moduleRegistry, runtimeCaching),
+      skipWaiting,
+      use: moduleRegistry.use.bind(moduleRegistry),
+    });
+
+    const workboxImportStatements = moduleRegistry.getImportStatements();
+
+    // We need the import statements for all of the Workbox runtime modules
+    // prepended, so that the correct bundle can be created.
+    return workboxImportStatements.join('\n') + populatedTemplate;
+  } catch (error) {
+    throw new Error(
+      `${errors['populating-sw-tmpl-failed']} '${
+        error instanceof Error && error.message ? error.message : ''
+      }'`,
+    );
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/rebase-path.ts b/tools/ui/node_modules/workbox-build/src/lib/rebase-path.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6f36b282c06d08e59b453848491223f5e08b2141
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/rebase-path.ts
@@ -0,0 +1,28 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import upath from 'upath';
+
+export function rebasePath({
+  baseDirectory,
+  file,
+}: {
+  baseDirectory: string;
+  file: string;
+}): string {
+  // The initial path is relative to the current directory, so make it absolute.
+  const absolutePath = upath.resolve(file);
+
+  // Convert the absolute path so that it's relative to the baseDirectory.
+  const relativePath = upath.relative(baseDirectory, absolutePath);
+
+  // Remove any leading ./ as it won't work in a glob pattern.
+  const normalizedPath = upath.normalize(relativePath);
+
+  return normalizedPath;
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/replace-and-update-source-map.ts b/tools/ui/node_modules/workbox-build/src/lib/replace-and-update-source-map.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3b5a13b4749c786ac13d875cf2df67d5d671bbd7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/replace-and-update-source-map.ts
@@ -0,0 +1,122 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {RawSourceMap, SourceMapConsumer, SourceMapGenerator} from 'source-map';
+
+/**
+ * Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern
+ * JavaScript updates, along with additional properties copied from originalMap.
+ *
+ * @param {Object} options
+ * @param {string} options.jsFilename The name for the file whose contents
+ * correspond to originalSource.
+ * @param {Object} options.originalMap The sourcemap for originalSource,
+ * prior to any replacements.
+ * @param {string} options.originalSource The source code, prior to any
+ * replacements.
+ * @param {string} options.replaceString A string to swap in for searchString.
+ * @param {string} options.searchString A string in originalSource to replace.
+ * Only the first occurrence will be replaced.
+ * @return {{source: string, map: string}} An object containing both
+ * originalSource with the replacement applied, and the modified originalMap.
+ *
+ * @private
+ */
+export async function replaceAndUpdateSourceMap({
+  jsFilename,
+  originalMap,
+  originalSource,
+  replaceString,
+  searchString,
+}: {
+  jsFilename: string;
+  originalMap: RawSourceMap;
+  originalSource: string;
+  replaceString: string;
+  searchString: string;
+}): Promise<{map: string; source: string}> {
+  const generator = new SourceMapGenerator({
+    file: jsFilename,
+  });
+
+  const consumer = await new SourceMapConsumer(originalMap);
+
+  let pos: number;
+  let src = originalSource;
+  const replacements: Array<{line: number; column: number}> = [];
+  let lineNum = 0;
+  let filePos = 0;
+
+  const lines = src.split('\n');
+  for (let line of lines) {
+    lineNum++;
+    let searchPos = 0;
+    while ((pos = line.indexOf(searchString, searchPos)) !== -1) {
+      src =
+        src.substring(0, filePos + pos) +
+        replaceString +
+        src.substring(filePos + pos + searchString.length);
+      line =
+        line.substring(0, pos) +
+        replaceString +
+        line.substring(pos + searchString.length);
+      replacements.push({line: lineNum, column: pos});
+      searchPos = pos + replaceString.length;
+    }
+    filePos += line.length + 1;
+  }
+
+  replacements.reverse();
+
+  consumer.eachMapping((mapping) => {
+    for (const replacement of replacements) {
+      if (
+        replacement.line === mapping.generatedLine &&
+        mapping.generatedColumn > replacement.column
+      ) {
+        const offset = searchString.length - replaceString.length;
+        mapping.generatedColumn -= offset;
+      }
+    }
+
+    if (mapping.source) {
+      const newMapping = {
+        generated: {
+          line: mapping.generatedLine,
+          column: mapping.generatedColumn,
+        },
+        original: {
+          line: mapping.originalLine,
+          column: mapping.originalColumn,
+        },
+        source: mapping.source,
+      };
+      return generator.addMapping(newMapping);
+    }
+
+    return mapping;
+  });
+
+  consumer.destroy();
+  // JSON.parse returns any.
+  // eslint-disable-next-line  @typescript-eslint/no-unsafe-assignment
+  const updatedSourceMap: RawSourceMap = Object.assign(
+    JSON.parse(generator.toString()),
+    {
+      names: originalMap.names,
+      sourceRoot: originalMap.sourceRoot,
+      sources: originalMap.sources,
+      sourcesContent: originalMap.sourcesContent,
+    },
+  );
+
+  return {
+    map: JSON.stringify(updatedSourceMap),
+    source: src,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/runtime-caching-converter.ts b/tools/ui/node_modules/workbox-build/src/lib/runtime-caching-converter.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b235e9e293946b2d2b6008cbd739b715ce24ceb5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/runtime-caching-converter.ts
@@ -0,0 +1,215 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {oneLine as ol} from 'common-tags';
+
+import {errors} from './errors';
+import {ModuleRegistry} from './module-registry';
+import {RuntimeCaching} from '../types';
+import {stringifyWithoutComments} from './stringify-without-comments';
+
+/**
+ * Given a set of options that configures runtime caching behavior, convert it
+ * to the equivalent Workbox method calls.
+ *
+ * @param {ModuleRegistry} moduleRegistry
+ * @param {Object} options See
+ *        https://developers.google.com/web/tools/workbox/modules/workbox-build#generateSW-runtimeCaching
+ * @return {string} A JSON string representing the equivalent options.
+ *
+ * @private
+ */
+function getOptionsString(
+  moduleRegistry: ModuleRegistry,
+  options: RuntimeCaching['options'] = {},
+) {
+  const plugins: Array = [];
+  const handlerOptions: {[key in keyof typeof options]: any} = {};
+
+  for (const optionName of Object.keys(options) as Array<
+    keyof typeof options
+  >) {
+    if (options[optionName] === undefined) {
+      continue;
+    }
+
+    switch (optionName) {
+      // Using a library here because JSON.stringify won't handle functions.
+      case 'plugins': {
+        plugins.push(...options.plugins!.map(stringifyWithoutComments));
+        break;
+      }
+
+      // These are the option properties that we want to pull out, so that
+      // they're passed to the handler constructor.
+      case 'cacheName':
+      case 'networkTimeoutSeconds':
+      case 'fetchOptions':
+      case 'matchOptions': {
+        handlerOptions[optionName] = options[optionName];
+        break;
+      }
+
+      // The following cases are all shorthands for creating a plugin with a
+      // given configuration.
+      case 'backgroundSync': {
+        const name = options.backgroundSync!.name;
+        const plugin = moduleRegistry.use(
+          'workbox-background-sync',
+          'BackgroundSyncPlugin',
+        );
+
+        let pluginCode = `new ${plugin}(${JSON.stringify(name)}`;
+        if (options.backgroundSync!.options) {
+          pluginCode += `, ${stringifyWithoutComments(
+            options.backgroundSync!.options,
+          )}`;
+        }
+        pluginCode += `)`;
+
+        plugins.push(pluginCode);
+        break;
+      }
+
+      case 'broadcastUpdate': {
+        const channelName = options.broadcastUpdate!.channelName;
+        const opts = Object.assign(
+          {channelName},
+          options.broadcastUpdate!.options,
+        );
+        const plugin = moduleRegistry.use(
+          'workbox-broadcast-update',
+          'BroadcastUpdatePlugin',
+        );
+
+        plugins.push(`new ${plugin}(${stringifyWithoutComments(opts)})`);
+        break;
+      }
+
+      case 'cacheableResponse': {
+        const plugin = moduleRegistry.use(
+          'workbox-cacheable-response',
+          'CacheableResponsePlugin',
+        );
+
+        plugins.push(
+          `new ${plugin}(${stringifyWithoutComments(
+            options.cacheableResponse!,
+          )})`,
+        );
+        break;
+      }
+
+      case 'expiration': {
+        const plugin = moduleRegistry.use(
+          'workbox-expiration',
+          'ExpirationPlugin',
+        );
+
+        plugins.push(
+          `new ${plugin}(${stringifyWithoutComments(options.expiration!)})`,
+        );
+        break;
+      }
+
+      case 'precacheFallback': {
+        const plugin = moduleRegistry.use(
+          'workbox-precaching',
+          'PrecacheFallbackPlugin',
+        );
+
+        plugins.push(
+          `new ${plugin}(${stringifyWithoutComments(
+            options.precacheFallback!,
+          )})`,
+        );
+        break;
+      }
+
+      case 'rangeRequests': {
+        const plugin = moduleRegistry.use(
+          'workbox-range-requests',
+          'RangeRequestsPlugin',
+        );
+
+        // There are no configuration options for the constructor.
+        plugins.push(`new ${plugin}()`);
+        break;
+      }
+
+      default: {
+        throw new Error(
+          // In the default case optionName is typed as 'never'.
+          // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+          `${errors['bad-runtime-caching-config']} ${optionName}`,
+        );
+      }
+    }
+  }
+
+  if (Object.keys(handlerOptions).length > 0 || plugins.length > 0) {
+    const optionsString = JSON.stringify(handlerOptions).slice(1, -1);
+    return ol`{
+      ${optionsString ? optionsString + ',' : ''}
+      plugins: [${plugins.join(', ')}]
+    }`;
+  } else {
+    return '';
+  }
+}
+
+export function runtimeCachingConverter(
+  moduleRegistry: ModuleRegistry,
+  runtimeCaching: Array,
+): Array {
+  return runtimeCaching
+    .map((entry) => {
+      const method = entry.method || 'GET';
+
+      if (!entry.urlPattern) {
+        throw new Error(errors['urlPattern-is-required']);
+      }
+
+      if (!entry.handler) {
+        throw new Error(errors['handler-is-required']);
+      }
+
+      if (
+        entry.options &&
+        entry.options.networkTimeoutSeconds &&
+        entry.handler !== 'NetworkFirst'
+      ) {
+        throw new Error(errors['invalid-network-timeout-seconds']);
+      }
+
+      // urlPattern might be a string, a RegExp object, or a function.
+      // If it's a string, it needs to be quoted.
+      const matcher =
+        typeof entry.urlPattern === 'string'
+          ? JSON.stringify(entry.urlPattern)
+          : entry.urlPattern;
+
+      const registerRoute = moduleRegistry.use(
+        'workbox-routing',
+        'registerRoute',
+      );
+      if (typeof entry.handler === 'string') {
+        const optionsString = getOptionsString(moduleRegistry, entry.options);
+        const handler = moduleRegistry.use('workbox-strategies', entry.handler);
+        const strategyString = `new ${handler}(${optionsString})`;
+
+        return `${registerRoute}(${matcher.toString()}, ${strategyString}, '${method}');\n`;
+      } else if (typeof entry.handler === 'function') {
+        return `${registerRoute}(${matcher.toString()}, ${entry.handler.toString()}, '${method}');\n`;
+      }
+
+      // '' will be filtered out.
+      return '';
+    })
+    .filter((entry) => Boolean(entry));
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/stringify-without-comments.ts b/tools/ui/node_modules/workbox-build/src/lib/stringify-without-comments.ts
new file mode 100644
index 0000000000000000000000000000000000000000..60b803d45835d689ec97211a86c73e8824ce26a7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/stringify-without-comments.ts
@@ -0,0 +1,23 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import objectStringify from 'stringify-object';
+import stripComments from 'strip-comments';
+
+export function stringifyWithoutComments(obj: {[key: string]: any}): string {
+  return objectStringify(obj, {
+    // See https://github.com/yeoman/stringify-object#transformobject-property-originalresult
+    transform: (_obj: {[key: string]: any}, _prop, str) => {
+      if (typeof _prop !== 'symbol' && typeof _obj[_prop] === 'function') {
+        // Can't typify correctly stripComments
+        return stripComments(str); // eslint-disable-line
+      }
+      return str;
+    },
+  });
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/transform-manifest.ts b/tools/ui/node_modules/workbox-build/src/lib/transform-manifest.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9ab81029198ea4c9990fe487be570bf3a8b0da22
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/transform-manifest.ts
@@ -0,0 +1,162 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {
+  BasePartial,
+  FileDetails,
+  ManifestEntry,
+  ManifestTransform,
+} from '../types';
+import {additionalManifestEntriesTransform} from './additional-manifest-entries-transform';
+import {errors} from './errors';
+import {maximumSizeTransform} from './maximum-size-transform';
+import {modifyURLPrefixTransform} from './modify-url-prefix-transform';
+import {noRevisionForURLsMatchingTransform} from './no-revision-for-urls-matching-transform';
+
+/**
+ * A `ManifestTransform` function can be used to modify the modify the `url` or
+ * `revision` properties of some or all of the
+ * {@link workbox-build.ManifestEntry} in the manifest.
+ *
+ * Deleting the `revision` property of an entry will cause
+ * the corresponding `url` to be precached without cache-busting parameters
+ * applied, which is to say, it implies that the URL itself contains
+ * proper versioning info. If the `revision` property is present, it must be
+ * set to a string.
+ *
+ * @example A transformation that prepended the origin of a CDN for any
+ * URL starting with '/assets/' could be implemented as:
+ *
+ * const cdnTransform = async (manifestEntries) => {
+ *   const manifest = manifestEntries.map(entry => {
+ *     const cdnOrigin = 'https://example.com';
+ *     if (entry.url.startsWith('/assets/')) {
+ *       entry.url = cdnOrigin + entry.url;
+ *     }
+ *     return entry;
+ *   });
+ *   return {manifest, warnings: []};
+ * };
+ *
+ * @example A transformation that nulls the revision field when the
+ * URL contains an 8-character hash surrounded by '.', indicating that it
+ * already contains revision information:
+ *
+ * const removeRevisionTransform = async (manifestEntries) => {
+ *   const manifest = manifestEntries.map(entry => {
+ *     const hashRegExp = /\.\w{8}\./;
+ *     if (entry.url.match(hashRegExp)) {
+ *       entry.revision = null;
+ *     }
+ *     return entry;
+ *   });
+ *   return {manifest, warnings: []};
+ * };
+ *
+ * @callback ManifestTransform
+ * @param {Array} manifestEntries The full
+ * array of entries, prior to the current transformation.
+ * @param {Object} [compilation] When used in the webpack plugins, this param
+ * will be set to the current `compilation`.
+ * @return {Promise}
+ * The array of entries with the transformation applied, and optionally, any
+ * warnings that should be reported back to the build tool.
+ *
+ * @memberof workbox-build
+ */
+
+interface ManifestTransformResultWithWarnings {
+  count: number;
+  size: number;
+  manifestEntries: ManifestEntry[];
+  warnings: string[];
+}
+export async function transformManifest({
+  additionalManifestEntries,
+  dontCacheBustURLsMatching,
+  fileDetails,
+  manifestTransforms,
+  maximumFileSizeToCacheInBytes,
+  modifyURLPrefix,
+  transformParam,
+}: BasePartial & {
+  fileDetails: Array;
+  // When this is called by the webpack plugin, transformParam will be the
+  // current webpack compilation.
+  transformParam?: unknown;
+}): Promise {
+  const allWarnings: Array = [];
+
+  // Take the array of fileDetail objects and convert it into an array of
+  // {url, revision, size} objects, with \ replaced with /.
+  const normalizedManifest = fileDetails.map((fileDetails) => {
+    return {
+      url: fileDetails.file.replace(/\\/g, '/'),
+      revision: fileDetails.hash,
+      size: fileDetails.size,
+    };
+  });
+
+  const transformsToApply: Array = [];
+
+  if (maximumFileSizeToCacheInBytes) {
+    transformsToApply.push(maximumSizeTransform(maximumFileSizeToCacheInBytes));
+  }
+
+  if (modifyURLPrefix) {
+    transformsToApply.push(modifyURLPrefixTransform(modifyURLPrefix));
+  }
+
+  if (dontCacheBustURLsMatching) {
+    transformsToApply.push(
+      noRevisionForURLsMatchingTransform(dontCacheBustURLsMatching),
+    );
+  }
+
+  // Run any manifestTransforms functions second-to-last.
+  if (manifestTransforms) {
+    transformsToApply.push(...manifestTransforms);
+  }
+
+  // Run additionalManifestEntriesTransform last.
+  if (additionalManifestEntries) {
+    transformsToApply.push(
+      additionalManifestEntriesTransform(additionalManifestEntries),
+    );
+  }
+
+  let transformedManifest: Array =
+    normalizedManifest;
+  for (const transform of transformsToApply) {
+    const result = await transform(transformedManifest, transformParam);
+    if (!('manifest' in result)) {
+      throw new Error(errors['bad-manifest-transforms-return-value']);
+    }
+
+    transformedManifest = result.manifest;
+    allWarnings.push(...(result.warnings || []));
+  }
+
+  // Generate some metadata about the manifest before we clear out the size
+  // properties from each entry.
+  const count = transformedManifest.length;
+  let size = 0;
+  for (const manifestEntry of transformedManifest as Array<
+    ManifestEntry & {size?: number}
+  >) {
+    size += manifestEntry.size || 0;
+    delete manifestEntry.size;
+  }
+
+  return {
+    count,
+    size,
+    manifestEntries: transformedManifest as Array,
+    warnings: allWarnings,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/translate-url-to-sourcemap-paths.ts b/tools/ui/node_modules/workbox-build/src/lib/translate-url-to-sourcemap-paths.ts
new file mode 100644
index 0000000000000000000000000000000000000000..072eac40d4ef5d095a01cb7f7e392a9e034853bd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/translate-url-to-sourcemap-paths.ts
@@ -0,0 +1,38 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import fse from 'fs-extra';
+import upath from 'upath';
+
+import {errors} from './errors';
+
+export function translateURLToSourcemapPaths(
+  url: string | null,
+  swSrc: string,
+  swDest: string,
+): {
+  destPath: string | undefined;
+  srcPath: string | undefined;
+  warning: string | undefined;
+} {
+  let destPath: string | undefined = undefined;
+  let srcPath: string | undefined = undefined;
+  let warning: string | undefined = undefined;
+
+  if (url && !url.startsWith('data:')) {
+    const possibleSrcPath = upath.resolve(upath.dirname(swSrc), url);
+    if (fse.existsSync(possibleSrcPath)) {
+      srcPath = possibleSrcPath;
+      destPath = upath.resolve(upath.dirname(swDest), url);
+    } else {
+      warning = `${errors['cant-find-sourcemap']} ${possibleSrcPath}`;
+    }
+  }
+
+  return {destPath, srcPath, warning};
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/validate-options.ts b/tools/ui/node_modules/workbox-build/src/lib/validate-options.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6b05487b457a9c12da5dad7b9809ec8d23541761
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/validate-options.ts
@@ -0,0 +1,235 @@
+/*
+  Copyright 2021 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {betterAjvErrors} from '@apideck/better-ajv-errors';
+import {oneLine as ol} from 'common-tags';
+import Ajv, {JSONSchemaType} from 'ajv';
+
+import {errors} from './errors';
+
+import {
+  GenerateSWOptions,
+  GetManifestOptions,
+  InjectManifestOptions,
+  WebpackGenerateSWOptions,
+  WebpackInjectManifestOptions,
+} from '../types';
+
+type MethodNames =
+  | 'GenerateSW'
+  | 'GetManifest'
+  | 'InjectManifest'
+  | 'WebpackGenerateSW'
+  | 'WebpackInjectManifest';
+
+const ajv = new Ajv({
+  useDefaults: true,
+});
+
+const DEFAULT_EXCLUDE_VALUE = [/\.map$/, /^manifest.*\.js$/];
+
+export class WorkboxConfigError extends Error {
+  constructor(message?: string) {
+    super(message);
+    Object.setPrototypeOf(this, new.target.prototype);
+  }
+}
+
+// Some methods need to do follow-up validation using the JSON schema,
+// so return both the validated options and then schema.
+function validate(
+  input: unknown,
+  methodName: MethodNames,
+): [T, JSONSchemaType] {
+  // Don't mutate input: https://github.com/GoogleChrome/workbox/issues/2158
+  const inputCopy = Object.assign({}, input);
+  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+  const jsonSchema: JSONSchemaType = require(`../schema/${methodName}Options.json`);
+  const validate = ajv.compile(jsonSchema);
+  if (validate(inputCopy)) {
+    // All methods support manifestTransforms, so validate it here.
+    ensureValidManifestTransforms(inputCopy);
+    return [inputCopy, jsonSchema];
+  }
+
+  const betterErrors = betterAjvErrors({
+    basePath: methodName,
+    data: input,
+    errors: validate.errors,
+    // This is needed as JSONSchema6 is expected, but JSONSchemaType works.
+    // eslint-disable-next-line  @typescript-eslint/no-unsafe-assignment
+    schema: jsonSchema as any,
+  });
+  const messages = betterErrors.map(
+    (err) => ol`[${err.path}] ${err.message}.
+    ${err.suggestion ? err.suggestion : ''}`,
+  );
+
+  throw new WorkboxConfigError(messages.join('\n\n'));
+}
+
+function ensureValidManifestTransforms(
+  options:
+    | GenerateSWOptions
+    | GetManifestOptions
+    | InjectManifestOptions
+    | WebpackGenerateSWOptions
+    | WebpackInjectManifestOptions,
+): void {
+  if (
+    'manifestTransforms' in options &&
+    !(
+      Array.isArray(options.manifestTransforms) &&
+      options.manifestTransforms.every((item) => typeof item === 'function')
+    )
+  ) {
+    throw new WorkboxConfigError(errors['manifest-transforms']);
+  }
+}
+
+function ensureValidNavigationPreloadConfig(
+  options: GenerateSWOptions | WebpackGenerateSWOptions,
+): void {
+  if (
+    options.navigationPreload &&
+    (!Array.isArray(options.runtimeCaching) ||
+      options.runtimeCaching.length === 0)
+  ) {
+    throw new WorkboxConfigError(errors['nav-preload-runtime-caching']);
+  }
+}
+
+function ensureValidCacheExpiration(
+  options: GenerateSWOptions | WebpackGenerateSWOptions,
+): void {
+  for (const runtimeCaching of options.runtimeCaching || []) {
+    if (
+      runtimeCaching.options?.expiration &&
+      !runtimeCaching.options?.cacheName
+    ) {
+      throw new WorkboxConfigError(errors['cache-name-required']);
+    }
+  }
+}
+
+function ensureValidRuntimeCachingOrGlobDirectory(
+  options: GenerateSWOptions,
+): void {
+  if (
+    !options.globDirectory &&
+    (!Array.isArray(options.runtimeCaching) ||
+      options.runtimeCaching.length === 0)
+  ) {
+    throw new WorkboxConfigError(
+      errors['no-manifest-entries-or-runtime-caching'],
+    );
+  }
+}
+
+// This is... messy, because we can't rely on the built-in ajv validation for
+// runtimeCaching.handler, as it needs to accept {} (i.e. any) due to
+// https://github.com/GoogleChrome/workbox/pull/2899
+// So we need to perform validation when a string (not a function) is used.
+function ensureValidStringHandler(
+  options: GenerateSWOptions | WebpackGenerateSWOptions,
+  jsonSchema: JSONSchemaType,
+): void {
+  let validHandlers: Array = [];
+  /* eslint-disable */
+  for (const handler of jsonSchema.definitions?.RuntimeCaching?.properties
+    ?.handler?.anyOf || []) {
+    if ('enum' in handler) {
+      validHandlers = handler.enum;
+      break;
+    }
+  }
+  /* eslint-enable */
+
+  for (const runtimeCaching of options.runtimeCaching || []) {
+    if (
+      typeof runtimeCaching.handler === 'string' &&
+      !validHandlers.includes(runtimeCaching.handler)
+    ) {
+      throw new WorkboxConfigError(
+        errors['invalid-handler-string'] + runtimeCaching.handler,
+      );
+    }
+  }
+}
+
+export function validateGenerateSWOptions(input: unknown): GenerateSWOptions {
+  const [validatedOptions, jsonSchema] = validate(
+    input,
+    'GenerateSW',
+  );
+  ensureValidNavigationPreloadConfig(validatedOptions);
+  ensureValidCacheExpiration(validatedOptions);
+  ensureValidRuntimeCachingOrGlobDirectory(validatedOptions);
+  ensureValidStringHandler(validatedOptions, jsonSchema);
+
+  return validatedOptions;
+}
+
+export function validateGetManifestOptions(input: unknown): GetManifestOptions {
+  const [validatedOptions] = validate(input, 'GetManifest');
+
+  return validatedOptions;
+}
+
+export function validateInjectManifestOptions(
+  input: unknown,
+): InjectManifestOptions {
+  const [validatedOptions] = validate(
+    input,
+    'InjectManifest',
+  );
+
+  return validatedOptions;
+}
+
+// The default `exclude: [/\.map$/, /^manifest.*\.js$/]` value can't be
+// represented in the JSON schema, so manually set it for the webpack options.
+export function validateWebpackGenerateSWOptions(
+  input: unknown,
+): WebpackGenerateSWOptions {
+  const inputWithExcludeDefault = Object.assign(
+    {
+      // Make a copy, as exclude can be mutated when used.
+      exclude: Array.from(DEFAULT_EXCLUDE_VALUE),
+    },
+    input,
+  );
+  const [validatedOptions, jsonSchema] = validate(
+    inputWithExcludeDefault,
+    'WebpackGenerateSW',
+  );
+
+  ensureValidNavigationPreloadConfig(validatedOptions);
+  ensureValidCacheExpiration(validatedOptions);
+  ensureValidStringHandler(validatedOptions, jsonSchema);
+
+  return validatedOptions;
+}
+
+export function validateWebpackInjectManifestOptions(
+  input: unknown,
+): WebpackInjectManifestOptions {
+  const inputWithExcludeDefault = Object.assign(
+    {
+      // Make a copy, as exclude can be mutated when used.
+      exclude: Array.from(DEFAULT_EXCLUDE_VALUE),
+    },
+    input,
+  );
+  const [validatedOptions] = validate(
+    inputWithExcludeDefault,
+    'WebpackInjectManifest',
+  );
+
+  return validatedOptions;
+}
diff --git a/tools/ui/node_modules/workbox-build/src/lib/write-sw-using-default-template.ts b/tools/ui/node_modules/workbox-build/src/lib/write-sw-using-default-template.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cd89917129661240c720e8b2c95e5ae6e2ba7202
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/lib/write-sw-using-default-template.ts
@@ -0,0 +1,96 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import fse from 'fs-extra';
+import upath from 'upath';
+
+import {bundle} from './bundle';
+import {errors} from './errors';
+import {GenerateSWOptions, ManifestEntry} from '../types';
+import {populateSWTemplate} from './populate-sw-template';
+
+export async function writeSWUsingDefaultTemplate({
+  babelPresetEnvTargets,
+  cacheId,
+  cleanupOutdatedCaches,
+  clientsClaim,
+  directoryIndex,
+  disableDevLogs,
+  ignoreURLParametersMatching,
+  importScripts,
+  inlineWorkboxRuntime,
+  manifestEntries,
+  mode,
+  navigateFallback,
+  navigateFallbackDenylist,
+  navigateFallbackAllowlist,
+  navigationPreload,
+  offlineGoogleAnalytics,
+  runtimeCaching,
+  skipWaiting,
+  sourcemap,
+  swDest,
+}: GenerateSWOptions & {manifestEntries: Array}): Promise<
+  Array
+> {
+  const outputDir = upath.dirname(swDest);
+  try {
+    await fse.mkdirp(outputDir);
+  } catch (error) {
+    throw new Error(
+      `${errors['unable-to-make-sw-directory']}. ` +
+        `'${error instanceof Error && error.message ? error.message : ''}'`,
+    );
+  }
+
+  const unbundledCode = populateSWTemplate({
+    cacheId,
+    cleanupOutdatedCaches,
+    clientsClaim,
+    directoryIndex,
+    disableDevLogs,
+    ignoreURLParametersMatching,
+    importScripts,
+    manifestEntries,
+    navigateFallback,
+    navigateFallbackDenylist,
+    navigateFallbackAllowlist,
+    navigationPreload,
+    offlineGoogleAnalytics,
+    runtimeCaching,
+    skipWaiting,
+  });
+
+  try {
+    const files = await bundle({
+      babelPresetEnvTargets,
+      inlineWorkboxRuntime,
+      mode,
+      sourcemap,
+      swDest,
+      unbundledCode,
+    });
+
+    const filePaths: Array = [];
+
+    for (const file of files) {
+      const filePath = upath.resolve(file.name);
+      filePaths.push(filePath);
+      await fse.writeFile(filePath, file.contents);
+    }
+
+    return filePaths;
+  } catch (error) {
+    const err = error as NodeJS.ErrnoException;
+    if (err.code === 'EISDIR') {
+      // See https://github.com/GoogleChrome/workbox/issues/612
+      throw new Error(errors['sw-write-failure-directory']);
+    }
+    throw new Error(`${errors['sw-write-failure']} '${err.message}'`);
+  }
+}
diff --git a/tools/ui/node_modules/workbox-build/src/rollup-plugin-off-main-thread.d.ts b/tools/ui/node_modules/workbox-build/src/rollup-plugin-off-main-thread.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..80bc49cdc2768b1087a8a022434a7c271b6ac60b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/rollup-plugin-off-main-thread.d.ts
@@ -0,0 +1 @@
+declare module '@trickfilm400/rollup-plugin-off-main-thread';
diff --git a/tools/ui/node_modules/workbox-build/src/schema/GenerateSWOptions.json b/tools/ui/node_modules/workbox-build/src/schema/GenerateSWOptions.json
new file mode 100644
index 0000000000000000000000000000000000000000..6817de451d0207f7f725ce7dbc5a72885f1127f1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/schema/GenerateSWOptions.json
@@ -0,0 +1,878 @@
+{
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "additionalManifestEntries": {
+      "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
+      "type": "array",
+      "items": {
+        "anyOf": [
+          {
+            "$ref": "#/definitions/ManifestEntry"
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "dontCacheBustURLsMatching": {
+      "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
+      "$ref": "#/definitions/RegExp"
+    },
+    "manifestTransforms": {
+      "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
+      "type": "array",
+      "items": {}
+    },
+    "maximumFileSizeToCacheInBytes": {
+      "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
+      "default": 2097152,
+      "type": "number"
+    },
+    "modifyURLPrefix": {
+      "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n  '/dist/': '/',\n  '': '/static',\n}\n```",
+      "type": "object",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
+    "globFollow": {
+      "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": true,
+      "type": "boolean"
+    },
+    "globIgnores": {
+      "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": [
+        "**/node_modules/**/*"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "globPatterns": {
+      "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).",
+      "default": [
+        "**/*.{js,wasm,css,html}"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "templatedURLs": {
+      "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.",
+      "type": "object",
+      "additionalProperties": {
+        "anyOf": [
+          {
+            "type": "array",
+            "items": {
+              "type": "string"
+            }
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "babelPresetEnvTargets": {
+      "description": "The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass\nto `babel-preset-env` when transpiling the service worker bundle.",
+      "default": [
+        "chrome >= 56"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "cacheId": {
+      "description": "An optional ID to be prepended to cache names. This is primarily useful for\nlocal development where multiple sites may be served from the same\n`http://localhost:port` origin.",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "cleanupOutdatedCaches": {
+      "description": "Whether or not Workbox should attempt to identify and delete any precaches\ncreated by older, incompatible versions.",
+      "default": false,
+      "type": "boolean"
+    },
+    "clientsClaim": {
+      "description": "Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)\nany existing clients as soon as it activates.",
+      "default": false,
+      "type": "boolean"
+    },
+    "directoryIndex": {
+      "description": "If a navigation request for a URL ending in `/` fails to match a precached\nURL, this value will be appended to the URL and that will be checked for a\nprecache match. This should be set to what your web server is using for its\ndirectory index.",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "disableDevLogs": {
+      "default": false,
+      "type": "boolean"
+    },
+    "ignoreURLParametersMatching": {
+      "description": "Any search parameter names that match against one of the RegExp in this\narray will be removed before looking for a precache match. This is useful\nif your users might request URLs that contain, for example, URL parameters\nused to track the source of the traffic. If not provided, the default value\nis `[/^utm_/, /^fbclid$/]`.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "importScripts": {
+      "description": "A list of JavaScript files that should be passed to\n[`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)\ninside the generated service worker file. This is  useful when you want to\nlet Workbox create your top-level service worker file, but want to include\nsome additional code, such as a push event listener.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "inlineWorkboxRuntime": {
+      "description": "Whether the runtime code for the Workbox library should be included in the\ntop-level service worker, or split into a separate file that needs to be\ndeployed alongside the service worker. Keeping the runtime separate means\nthat users will not have to re-download the Workbox code each time your\ntop-level service worker changes.",
+      "default": false,
+      "type": "boolean"
+    },
+    "mode": {
+      "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `process.env.NODE_ENV` value will be used, and failing that, it\nwill fall back to `'production'`.",
+      "default": "production",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "navigateFallback": {
+      "description": "If specified, all\n[navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)\nfor URLs that aren't precached will be fulfilled with the HTML at the URL\nprovided. You must pass in the URL of an HTML document that is listed in\nyour precache manifest. This is meant to be used in a Single Page App\nscenario, in which you want all navigations to use common\n[App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).",
+      "default": null,
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "navigateFallbackAllowlist": {
+      "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedent.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "navigateFallbackDenylist": {
+      "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedence.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "navigationPreload": {
+      "description": "Whether or not to enable\n[navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)\nin the generated service worker. When set to true, you must also use\n`runtimeCaching` to set up an appropriate response strategy that will match\nnavigation requests, and make use of the preloaded response.",
+      "default": false,
+      "type": "boolean"
+    },
+    "offlineGoogleAnalytics": {
+      "description": "Controls whether or not to include support for\n[offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).\nWhen `true`, the call to `workbox-google-analytics`'s `initialize()` will\nbe added to your generated service worker. When set to an `Object`, that\nobject will be passed in to the `initialize()` call, allowing you to\ncustomize the behavior.",
+      "default": false,
+      "anyOf": [
+        {
+          "$ref": "#/definitions/GoogleAnalyticsInitializeOptions"
+        },
+        {
+          "type": "boolean"
+        }
+      ]
+    },
+    "runtimeCaching": {
+      "description": "When using Workbox's build tools to generate your service worker, you can\nspecify one or more runtime caching configurations. These are then\ntranslated to {@link workbox-routing.registerRoute} calls using the match\nand handler configuration you define.\n\nFor all of the options, see the {@link workbox-build.RuntimeCaching}\ndocumentation. The example below shows a typical configuration, with two\nruntime routes defined:",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RuntimeCaching"
+      }
+    },
+    "skipWaiting": {
+      "description": "Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)\nto the generated service worker. If `false`, then a `message` listener will\nbe added instead, allowing client pages to trigger `skipWaiting()` by\ncalling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.",
+      "default": false,
+      "type": "boolean"
+    },
+    "sourcemap": {
+      "description": "Whether to create a sourcemap for the generated service worker files.",
+      "default": true,
+      "type": "boolean"
+    },
+    "swDest": {
+      "description": "The path and filename of the service worker file that will be created by\nthe build process, relative to the current working directory. It must end\nin '.js'.",
+      "type": "string"
+    },
+    "globDirectory": {
+      "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.",
+      "type": "string"
+    }
+  },
+  "required": [
+    "swDest"
+  ],
+  "definitions": {
+    "ManifestEntry": {
+      "type": "object",
+      "properties": {
+        "integrity": {
+          "type": "string"
+        },
+        "revision": {
+          "type": [
+            "null",
+            "string"
+          ]
+        },
+        "url": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "revision",
+        "url"
+      ]
+    },
+    "RegExp": {
+      "type": "object",
+      "properties": {
+        "source": {
+          "type": "string"
+        },
+        "global": {
+          "type": "boolean"
+        },
+        "ignoreCase": {
+          "type": "boolean"
+        },
+        "multiline": {
+          "type": "boolean"
+        },
+        "lastIndex": {
+          "type": "number"
+        },
+        "flags": {
+          "type": "string"
+        },
+        "sticky": {
+          "type": "boolean"
+        },
+        "unicode": {
+          "type": "boolean"
+        },
+        "dotAll": {
+          "type": "boolean"
+        },
+        "hasIndices": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "dotAll",
+        "flags",
+        "global",
+        "hasIndices",
+        "ignoreCase",
+        "lastIndex",
+        "multiline",
+        "source",
+        "sticky",
+        "unicode"
+      ]
+    },
+    "GoogleAnalyticsInitializeOptions": {
+      "type": "object",
+      "properties": {
+        "cacheName": {
+          "type": "string"
+        },
+        "parameterOverrides": {
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "hitFilter": {
+          "type": "object",
+          "additionalProperties": false
+        }
+      },
+      "additionalProperties": false
+    },
+    "RuntimeCaching": {
+      "type": "object",
+      "properties": {
+        "handler": {
+          "description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
+          "anyOf": [
+            {
+              "$ref": "#/definitions/RouteHandlerCallback"
+            },
+            {
+              "$ref": "#/definitions/RouteHandlerObject"
+            },
+            {
+              "enum": [
+                "CacheFirst",
+                "CacheOnly",
+                "NetworkFirst",
+                "NetworkOnly",
+                "StaleWhileRevalidate"
+              ],
+              "type": "string"
+            }
+          ]
+        },
+        "method": {
+          "description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
+          "default": "GET",
+          "enum": [
+            "DELETE",
+            "GET",
+            "HEAD",
+            "PATCH",
+            "POST",
+            "PUT"
+          ],
+          "type": "string"
+        },
+        "options": {
+          "type": "object",
+          "properties": {
+            "backgroundSync": {
+              "description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "name": {
+                  "type": "string"
+                },
+                "options": {
+                  "$ref": "#/definitions/QueueOptions"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "name"
+              ]
+            },
+            "broadcastUpdate": {
+              "description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "channelName": {
+                  "type": "string"
+                },
+                "options": {
+                  "$ref": "#/definitions/BroadcastCacheUpdateOptions"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "options"
+              ]
+            },
+            "cacheableResponse": {
+              "description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/CacheableResponseOptions"
+            },
+            "cacheName": {
+              "description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
+              "type": [
+                "null",
+                "string"
+              ]
+            },
+            "expiration": {
+              "description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/ExpirationPluginOptions"
+            },
+            "networkTimeoutSeconds": {
+              "description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
+              "type": "number"
+            },
+            "plugins": {
+              "description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/WorkboxPlugin"
+              }
+            },
+            "precacheFallback": {
+              "description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "fallbackURL": {
+                  "type": "string"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "fallbackURL"
+              ]
+            },
+            "rangeRequests": {
+              "description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "type": "boolean"
+            },
+            "fetchOptions": {
+              "description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/RequestInit"
+            },
+            "matchOptions": {
+              "description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/CacheQueryOptions"
+            }
+          },
+          "additionalProperties": false
+        },
+        "urlPattern": {
+          "description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
+          "anyOf": [
+            {
+              "$ref": "#/definitions/RegExp"
+            },
+            {
+              "$ref": "#/definitions/RouteMatchCallback"
+            },
+            {
+              "type": "string"
+            }
+          ]
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "handler",
+        "urlPattern"
+      ]
+    },
+    "RouteHandlerCallback": {},
+    "RouteHandlerObject": {
+      "description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
+      "type": "object",
+      "properties": {
+        "handle": {
+          "$ref": "#/definitions/RouteHandlerCallback"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "handle"
+      ]
+    },
+    "QueueOptions": {
+      "type": "object",
+      "properties": {
+        "forceSyncFallback": {
+          "type": "boolean"
+        },
+        "maxRetentionTime": {
+          "type": "number"
+        },
+        "onSync": {
+          "$ref": "#/definitions/OnSyncCallback"
+        }
+      },
+      "additionalProperties": false
+    },
+    "OnSyncCallback": {},
+    "BroadcastCacheUpdateOptions": {
+      "type": "object",
+      "properties": {
+        "headersToCheck": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        },
+        "generatePayload": {
+          "type": "object",
+          "additionalProperties": false
+        },
+        "notifyAllClients": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "CacheableResponseOptions": {
+      "type": "object",
+      "properties": {
+        "statuses": {
+          "type": "array",
+          "items": {
+            "type": "number"
+          }
+        },
+        "headers": {
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        }
+      },
+      "additionalProperties": false
+    },
+    "ExpirationPluginOptions": {
+      "type": "object",
+      "properties": {
+        "maxEntries": {
+          "type": "number"
+        },
+        "maxAgeSeconds": {
+          "type": "number"
+        },
+        "matchOptions": {
+          "$ref": "#/definitions/CacheQueryOptions"
+        },
+        "purgeOnQuotaError": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "CacheQueryOptions": {
+      "type": "object",
+      "properties": {
+        "ignoreMethod": {
+          "type": "boolean"
+        },
+        "ignoreSearch": {
+          "type": "boolean"
+        },
+        "ignoreVary": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "WorkboxPlugin": {
+      "description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
+      "type": "object",
+      "properties": {
+        "cacheDidUpdate": {},
+        "cachedResponseWillBeUsed": {},
+        "cacheKeyWillBeUsed": {},
+        "cacheWillUpdate": {},
+        "fetchDidFail": {},
+        "fetchDidSucceed": {},
+        "handlerDidComplete": {},
+        "handlerDidError": {},
+        "handlerDidRespond": {},
+        "handlerWillRespond": {},
+        "handlerWillStart": {},
+        "requestWillFetch": {}
+      },
+      "additionalProperties": false
+    },
+    "CacheDidUpdateCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CachedResponseWillBeUsedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CacheKeyWillBeUsedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CacheWillUpdateCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "FetchDidFailCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "FetchDidSucceedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidCompleteCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidErrorCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidRespondCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerWillRespondCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerWillStartCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "RequestWillFetchCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "RequestInit": {
+      "type": "object",
+      "properties": {
+        "body": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/ArrayBuffer"
+            },
+            {
+              "$ref": "#/definitions/ArrayBufferView"
+            },
+            {
+              "$ref": "#/definitions/ReadableStream"
+            },
+            {
+              "$ref": "#/definitions/Blob"
+            },
+            {
+              "$ref": "#/definitions/FormData"
+            },
+            {
+              "$ref": "#/definitions/URLSearchParams"
+            },
+            {
+              "type": [
+                "null",
+                "string"
+              ]
+            }
+          ]
+        },
+        "cache": {
+          "enum": [
+            "default",
+            "force-cache",
+            "no-cache",
+            "no-store",
+            "only-if-cached",
+            "reload"
+          ],
+          "type": "string"
+        },
+        "credentials": {
+          "enum": [
+            "include",
+            "omit",
+            "same-origin"
+          ],
+          "type": "string"
+        },
+        "headers": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/Record"
+            },
+            {
+              "type": "array",
+              "items": {
+                "type": "array",
+                "items": [
+                  {
+                    "type": "string"
+                  },
+                  {
+                    "type": "string"
+                  }
+                ],
+                "minItems": 2,
+                "maxItems": 2
+              }
+            },
+            {
+              "$ref": "#/definitions/Headers"
+            }
+          ]
+        },
+        "integrity": {
+          "type": "string"
+        },
+        "keepalive": {
+          "type": "boolean"
+        },
+        "method": {
+          "type": "string"
+        },
+        "mode": {
+          "enum": [
+            "cors",
+            "navigate",
+            "no-cors",
+            "same-origin"
+          ],
+          "type": "string"
+        },
+        "redirect": {
+          "enum": [
+            "error",
+            "follow",
+            "manual"
+          ],
+          "type": "string"
+        },
+        "referrer": {
+          "type": "string"
+        },
+        "referrerPolicy": {
+          "enum": [
+            "",
+            "no-referrer",
+            "no-referrer-when-downgrade",
+            "origin",
+            "origin-when-cross-origin",
+            "same-origin",
+            "strict-origin",
+            "strict-origin-when-cross-origin",
+            "unsafe-url"
+          ],
+          "type": "string"
+        },
+        "signal": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/AbortSignal"
+            },
+            {
+              "type": "null"
+            }
+          ]
+        },
+        "window": {
+          "type": "null"
+        }
+      },
+      "additionalProperties": false
+    },
+    "ArrayBuffer": {
+      "type": "object",
+      "properties": {
+        "byteLength": {
+          "type": "number"
+        },
+        "__@toStringTag@32": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "__@toStringTag@32",
+        "byteLength"
+      ]
+    },
+    "ArrayBufferView": {
+      "type": "object",
+      "properties": {
+        "buffer": {
+          "$ref": "#/definitions/ArrayBufferLike"
+        },
+        "byteLength": {
+          "type": "number"
+        },
+        "byteOffset": {
+          "type": "number"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "buffer",
+        "byteLength",
+        "byteOffset"
+      ]
+    },
+    "ArrayBufferLike": {
+      "anyOf": [
+        {
+          "$ref": "#/definitions/ArrayBuffer"
+        },
+        {
+          "$ref": "#/definitions/SharedArrayBuffer"
+        }
+      ]
+    },
+    "SharedArrayBuffer": {
+      "type": "object",
+      "properties": {
+        "byteLength": {
+          "type": "number"
+        },
+        "__@species@492": {
+          "$ref": "#/definitions/SharedArrayBuffer"
+        },
+        "__@toStringTag@32": {
+          "type": "string",
+          "const": "SharedArrayBuffer"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "__@species@492",
+        "__@toStringTag@32",
+        "byteLength"
+      ]
+    },
+    "ReadableStream": {
+      "type": "object",
+      "properties": {
+        "locked": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "locked"
+      ]
+    },
+    "Blob": {
+      "type": "object",
+      "properties": {
+        "size": {
+          "type": "number"
+        },
+        "type": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "size",
+        "type"
+      ]
+    },
+    "FormData": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "URLSearchParams": {
+      "type": "object",
+      "properties": {
+        "size": {
+          "description": "The total number of parameter entries.",
+          "type": "number"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "size"
+      ]
+    },
+    "Record": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "Headers": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "AbortSignal": {},
+    "RouteMatchCallback": {}
+  },
+  "$schema": "http://json-schema.org/draft-07/schema#"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/schema/GetManifestOptions.json b/tools/ui/node_modules/workbox-build/src/schema/GetManifestOptions.json
new file mode 100644
index 0000000000000000000000000000000000000000..d072599350b1011e38e0b6ded48ab26c903d4e8e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/schema/GetManifestOptions.json
@@ -0,0 +1,163 @@
+{
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "additionalManifestEntries": {
+      "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
+      "type": "array",
+      "items": {
+        "anyOf": [
+          {
+            "$ref": "#/definitions/ManifestEntry"
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "dontCacheBustURLsMatching": {
+      "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
+      "$ref": "#/definitions/RegExp"
+    },
+    "manifestTransforms": {
+      "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
+      "type": "array",
+      "items": {}
+    },
+    "maximumFileSizeToCacheInBytes": {
+      "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
+      "default": 2097152,
+      "type": "number"
+    },
+    "modifyURLPrefix": {
+      "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n  '/dist/': '/',\n  '': '/static',\n}\n```",
+      "type": "object",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
+    "globFollow": {
+      "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": true,
+      "type": "boolean"
+    },
+    "globIgnores": {
+      "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": [
+        "**/node_modules/**/*"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "globPatterns": {
+      "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).",
+      "default": [
+        "**/*.{js,wasm,css,html}"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "templatedURLs": {
+      "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.",
+      "type": "object",
+      "additionalProperties": {
+        "anyOf": [
+          {
+            "type": "array",
+            "items": {
+              "type": "string"
+            }
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "globDirectory": {
+      "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.",
+      "type": "string"
+    }
+  },
+  "required": [
+    "globDirectory"
+  ],
+  "definitions": {
+    "ManifestEntry": {
+      "type": "object",
+      "properties": {
+        "integrity": {
+          "type": "string"
+        },
+        "revision": {
+          "type": [
+            "null",
+            "string"
+          ]
+        },
+        "url": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "revision",
+        "url"
+      ]
+    },
+    "RegExp": {
+      "type": "object",
+      "properties": {
+        "source": {
+          "type": "string"
+        },
+        "global": {
+          "type": "boolean"
+        },
+        "ignoreCase": {
+          "type": "boolean"
+        },
+        "multiline": {
+          "type": "boolean"
+        },
+        "lastIndex": {
+          "type": "number"
+        },
+        "flags": {
+          "type": "string"
+        },
+        "sticky": {
+          "type": "boolean"
+        },
+        "unicode": {
+          "type": "boolean"
+        },
+        "dotAll": {
+          "type": "boolean"
+        },
+        "hasIndices": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "dotAll",
+        "flags",
+        "global",
+        "hasIndices",
+        "ignoreCase",
+        "lastIndex",
+        "multiline",
+        "source",
+        "sticky",
+        "unicode"
+      ]
+    }
+  },
+  "$schema": "http://json-schema.org/draft-07/schema#"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/schema/InjectManifestOptions.json b/tools/ui/node_modules/workbox-build/src/schema/InjectManifestOptions.json
new file mode 100644
index 0000000000000000000000000000000000000000..2e65506bf8151b1bdfaff3b2f58397dd2b90110d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/schema/InjectManifestOptions.json
@@ -0,0 +1,178 @@
+{
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "additionalManifestEntries": {
+      "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
+      "type": "array",
+      "items": {
+        "anyOf": [
+          {
+            "$ref": "#/definitions/ManifestEntry"
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "dontCacheBustURLsMatching": {
+      "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
+      "$ref": "#/definitions/RegExp"
+    },
+    "manifestTransforms": {
+      "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
+      "type": "array",
+      "items": {}
+    },
+    "maximumFileSizeToCacheInBytes": {
+      "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
+      "default": 2097152,
+      "type": "number"
+    },
+    "modifyURLPrefix": {
+      "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n  '/dist/': '/',\n  '': '/static',\n}\n```",
+      "type": "object",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
+    "globFollow": {
+      "description": "Determines whether or not symlinks are followed when generating the\nprecache manifest. For more information, see the definition of `follow` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": true,
+      "type": "boolean"
+    },
+    "globIgnores": {
+      "description": "A set of patterns matching files to always exclude when generating the\nprecache manifest. For more information, see the definition of `ignore` in\nthe `glob` [documentation](https://github.com/isaacs/node-glob#options).",
+      "default": [
+        "**/node_modules/**/*"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "globPatterns": {
+      "description": "Files matching any of these patterns will be included in the precache\nmanifest. For more information, see the\n[`glob` primer](https://github.com/isaacs/node-glob#glob-primer).",
+      "default": [
+        "**/*.{js,wasm,css,html}"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "templatedURLs": {
+      "description": "If a URL is rendered based on some server-side logic, its contents may\ndepend on multiple files or on some other unique string value. The keys in\nthis object are server-rendered URLs. If the values are an array of\nstrings, they will be interpreted as `glob` patterns, and the contents of\nany files matching the patterns will be used to uniquely version the URL.\nIf used with a single string, it will be interpreted as unique versioning\ninformation that you've generated for a given URL.",
+      "type": "object",
+      "additionalProperties": {
+        "anyOf": [
+          {
+            "type": "array",
+            "items": {
+              "type": "string"
+            }
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "injectionPoint": {
+      "description": "The string to find inside of the `swSrc` file. Once found, it will be\nreplaced by the generated precache manifest.",
+      "default": "self.__WB_MANIFEST",
+      "type": "string"
+    },
+    "swSrc": {
+      "description": "The path and filename of the service worker file that will be read during\nthe build process, relative to the current working directory.",
+      "type": "string"
+    },
+    "swDest": {
+      "description": "The path and filename of the service worker file that will be created by\nthe build process, relative to the current working directory. It must end\nin '.js'.",
+      "type": "string"
+    },
+    "globDirectory": {
+      "description": "The local directory you wish to match `globPatterns` against. The path is\nrelative to the current directory.",
+      "type": "string"
+    }
+  },
+  "required": [
+    "globDirectory",
+    "swDest",
+    "swSrc"
+  ],
+  "definitions": {
+    "ManifestEntry": {
+      "type": "object",
+      "properties": {
+        "integrity": {
+          "type": "string"
+        },
+        "revision": {
+          "type": [
+            "null",
+            "string"
+          ]
+        },
+        "url": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "revision",
+        "url"
+      ]
+    },
+    "RegExp": {
+      "type": "object",
+      "properties": {
+        "source": {
+          "type": "string"
+        },
+        "global": {
+          "type": "boolean"
+        },
+        "ignoreCase": {
+          "type": "boolean"
+        },
+        "multiline": {
+          "type": "boolean"
+        },
+        "lastIndex": {
+          "type": "number"
+        },
+        "flags": {
+          "type": "string"
+        },
+        "sticky": {
+          "type": "boolean"
+        },
+        "unicode": {
+          "type": "boolean"
+        },
+        "dotAll": {
+          "type": "boolean"
+        },
+        "hasIndices": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "dotAll",
+        "flags",
+        "global",
+        "hasIndices",
+        "ignoreCase",
+        "lastIndex",
+        "multiline",
+        "source",
+        "sticky",
+        "unicode"
+      ]
+    }
+  },
+  "$schema": "http://json-schema.org/draft-07/schema#"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/schema/WebpackGenerateSWOptions.json b/tools/ui/node_modules/workbox-build/src/schema/WebpackGenerateSWOptions.json
new file mode 100644
index 0000000000000000000000000000000000000000..818f57e7be7a06d5bee3e6eb9747e42fb36d1a8b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/schema/WebpackGenerateSWOptions.json
@@ -0,0 +1,861 @@
+{
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "additionalManifestEntries": {
+      "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
+      "type": "array",
+      "items": {
+        "anyOf": [
+          {
+            "$ref": "#/definitions/ManifestEntry"
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "dontCacheBustURLsMatching": {
+      "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
+      "$ref": "#/definitions/RegExp"
+    },
+    "manifestTransforms": {
+      "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
+      "type": "array",
+      "items": {}
+    },
+    "maximumFileSizeToCacheInBytes": {
+      "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
+      "default": 2097152,
+      "type": "number"
+    },
+    "modifyURLPrefix": {
+      "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n  '/dist/': '/',\n  '': '/static',\n}\n```",
+      "type": "object",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
+    "chunks": {
+      "description": "One or more chunk names whose corresponding output files should be included\nin the precache manifest.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "exclude": {
+      "description": "One or more specifiers used to exclude assets from the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `exclude` option.\nIf not provided, the default value is `[/\\.map$/, /^manifest.*\\.js$]`.",
+      "type": "array",
+      "items": {}
+    },
+    "excludeChunks": {
+      "description": "One or more chunk names whose corresponding output files should be excluded\nfrom the precache manifest.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "include": {
+      "description": "One or more specifiers used to include assets in the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `include` option.",
+      "type": "array",
+      "items": {}
+    },
+    "mode": {
+      "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `process.env.NODE_ENV` value will be used, and failing that, it\nwill fall back to `'production'`.",
+      "default": "production",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "babelPresetEnvTargets": {
+      "description": "The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass\nto `babel-preset-env` when transpiling the service worker bundle.",
+      "default": [
+        "chrome >= 56"
+      ],
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "cacheId": {
+      "description": "An optional ID to be prepended to cache names. This is primarily useful for\nlocal development where multiple sites may be served from the same\n`http://localhost:port` origin.",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "cleanupOutdatedCaches": {
+      "description": "Whether or not Workbox should attempt to identify and delete any precaches\ncreated by older, incompatible versions.",
+      "default": false,
+      "type": "boolean"
+    },
+    "clientsClaim": {
+      "description": "Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)\nany existing clients as soon as it activates.",
+      "default": false,
+      "type": "boolean"
+    },
+    "directoryIndex": {
+      "description": "If a navigation request for a URL ending in `/` fails to match a precached\nURL, this value will be appended to the URL and that will be checked for a\nprecache match. This should be set to what your web server is using for its\ndirectory index.",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "disableDevLogs": {
+      "default": false,
+      "type": "boolean"
+    },
+    "ignoreURLParametersMatching": {
+      "description": "Any search parameter names that match against one of the RegExp in this\narray will be removed before looking for a precache match. This is useful\nif your users might request URLs that contain, for example, URL parameters\nused to track the source of the traffic. If not provided, the default value\nis `[/^utm_/, /^fbclid$/]`.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "importScripts": {
+      "description": "A list of JavaScript files that should be passed to\n[`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)\ninside the generated service worker file. This is  useful when you want to\nlet Workbox create your top-level service worker file, but want to include\nsome additional code, such as a push event listener.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "inlineWorkboxRuntime": {
+      "description": "Whether the runtime code for the Workbox library should be included in the\ntop-level service worker, or split into a separate file that needs to be\ndeployed alongside the service worker. Keeping the runtime separate means\nthat users will not have to re-download the Workbox code each time your\ntop-level service worker changes.",
+      "default": false,
+      "type": "boolean"
+    },
+    "navigateFallback": {
+      "description": "If specified, all\n[navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)\nfor URLs that aren't precached will be fulfilled with the HTML at the URL\nprovided. You must pass in the URL of an HTML document that is listed in\nyour precache manifest. This is meant to be used in a Single Page App\nscenario, in which you want all navigations to use common\n[App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).",
+      "default": null,
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "navigateFallbackAllowlist": {
+      "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedent.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "navigateFallbackDenylist": {
+      "description": "An optional array of regular expressions that restricts which URLs the\nconfigured `navigateFallback` behavior applies to. This is useful if only a\nsubset of your site's URLs should be treated as being part of a\n[Single Page App](https://en.wikipedia.org/wiki/Single-page_application).\nIf both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are\nconfigured, the denylist takes precedence.\n\n*Note*: These RegExps may be evaluated against every destination URL during\na navigation. Avoid using\n[complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\nor else your users may see delays when navigating your site.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RegExp"
+      }
+    },
+    "navigationPreload": {
+      "description": "Whether or not to enable\n[navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)\nin the generated service worker. When set to true, you must also use\n`runtimeCaching` to set up an appropriate response strategy that will match\nnavigation requests, and make use of the preloaded response.",
+      "default": false,
+      "type": "boolean"
+    },
+    "offlineGoogleAnalytics": {
+      "description": "Controls whether or not to include support for\n[offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).\nWhen `true`, the call to `workbox-google-analytics`'s `initialize()` will\nbe added to your generated service worker. When set to an `Object`, that\nobject will be passed in to the `initialize()` call, allowing you to\ncustomize the behavior.",
+      "default": false,
+      "anyOf": [
+        {
+          "$ref": "#/definitions/GoogleAnalyticsInitializeOptions"
+        },
+        {
+          "type": "boolean"
+        }
+      ]
+    },
+    "runtimeCaching": {
+      "description": "When using Workbox's build tools to generate your service worker, you can\nspecify one or more runtime caching configurations. These are then\ntranslated to {@link workbox-routing.registerRoute} calls using the match\nand handler configuration you define.\n\nFor all of the options, see the {@link workbox-build.RuntimeCaching}\ndocumentation. The example below shows a typical configuration, with two\nruntime routes defined:",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/RuntimeCaching"
+      }
+    },
+    "skipWaiting": {
+      "description": "Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)\nto the generated service worker. If `false`, then a `message` listener will\nbe added instead, allowing client pages to trigger `skipWaiting()` by\ncalling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.",
+      "default": false,
+      "type": "boolean"
+    },
+    "sourcemap": {
+      "description": "Whether to create a sourcemap for the generated service worker files.",
+      "default": true,
+      "type": "boolean"
+    },
+    "importScriptsViaChunks": {
+      "description": "One or more names of webpack chunks. The content of those chunks will be\nincluded in the generated service worker, via a call to `importScripts()`.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "swDest": {
+      "description": "The asset name of the service worker file created by this plugin.",
+      "default": "service-worker.js",
+      "type": "string"
+    }
+  },
+  "definitions": {
+    "ManifestEntry": {
+      "type": "object",
+      "properties": {
+        "integrity": {
+          "type": "string"
+        },
+        "revision": {
+          "type": [
+            "null",
+            "string"
+          ]
+        },
+        "url": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "revision",
+        "url"
+      ]
+    },
+    "RegExp": {
+      "type": "object",
+      "properties": {
+        "source": {
+          "type": "string"
+        },
+        "global": {
+          "type": "boolean"
+        },
+        "ignoreCase": {
+          "type": "boolean"
+        },
+        "multiline": {
+          "type": "boolean"
+        },
+        "lastIndex": {
+          "type": "number"
+        },
+        "flags": {
+          "type": "string"
+        },
+        "sticky": {
+          "type": "boolean"
+        },
+        "unicode": {
+          "type": "boolean"
+        },
+        "dotAll": {
+          "type": "boolean"
+        },
+        "hasIndices": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "dotAll",
+        "flags",
+        "global",
+        "hasIndices",
+        "ignoreCase",
+        "lastIndex",
+        "multiline",
+        "source",
+        "sticky",
+        "unicode"
+      ]
+    },
+    "GoogleAnalyticsInitializeOptions": {
+      "type": "object",
+      "properties": {
+        "cacheName": {
+          "type": "string"
+        },
+        "parameterOverrides": {
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "hitFilter": {
+          "type": "object",
+          "additionalProperties": false
+        }
+      },
+      "additionalProperties": false
+    },
+    "RuntimeCaching": {
+      "type": "object",
+      "properties": {
+        "handler": {
+          "description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
+          "anyOf": [
+            {
+              "$ref": "#/definitions/RouteHandlerCallback"
+            },
+            {
+              "$ref": "#/definitions/RouteHandlerObject"
+            },
+            {
+              "enum": [
+                "CacheFirst",
+                "CacheOnly",
+                "NetworkFirst",
+                "NetworkOnly",
+                "StaleWhileRevalidate"
+              ],
+              "type": "string"
+            }
+          ]
+        },
+        "method": {
+          "description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
+          "default": "GET",
+          "enum": [
+            "DELETE",
+            "GET",
+            "HEAD",
+            "PATCH",
+            "POST",
+            "PUT"
+          ],
+          "type": "string"
+        },
+        "options": {
+          "type": "object",
+          "properties": {
+            "backgroundSync": {
+              "description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "name": {
+                  "type": "string"
+                },
+                "options": {
+                  "$ref": "#/definitions/QueueOptions"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "name"
+              ]
+            },
+            "broadcastUpdate": {
+              "description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "channelName": {
+                  "type": "string"
+                },
+                "options": {
+                  "$ref": "#/definitions/BroadcastCacheUpdateOptions"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "options"
+              ]
+            },
+            "cacheableResponse": {
+              "description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/CacheableResponseOptions"
+            },
+            "cacheName": {
+              "description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
+              "type": [
+                "null",
+                "string"
+              ]
+            },
+            "expiration": {
+              "description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/ExpirationPluginOptions"
+            },
+            "networkTimeoutSeconds": {
+              "description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
+              "type": "number"
+            },
+            "plugins": {
+              "description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/WorkboxPlugin"
+              }
+            },
+            "precacheFallback": {
+              "description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "type": "object",
+              "properties": {
+                "fallbackURL": {
+                  "type": "string"
+                }
+              },
+              "additionalProperties": false,
+              "required": [
+                "fallbackURL"
+              ]
+            },
+            "rangeRequests": {
+              "description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
+              "type": "boolean"
+            },
+            "fetchOptions": {
+              "description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/RequestInit"
+            },
+            "matchOptions": {
+              "description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
+              "$ref": "#/definitions/CacheQueryOptions"
+            }
+          },
+          "additionalProperties": false
+        },
+        "urlPattern": {
+          "description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
+          "anyOf": [
+            {
+              "$ref": "#/definitions/RegExp"
+            },
+            {
+              "$ref": "#/definitions/RouteMatchCallback"
+            },
+            {
+              "type": "string"
+            }
+          ]
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "handler",
+        "urlPattern"
+      ]
+    },
+    "RouteHandlerCallback": {},
+    "RouteHandlerObject": {
+      "description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
+      "type": "object",
+      "properties": {
+        "handle": {
+          "$ref": "#/definitions/RouteHandlerCallback"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "handle"
+      ]
+    },
+    "QueueOptions": {
+      "type": "object",
+      "properties": {
+        "forceSyncFallback": {
+          "type": "boolean"
+        },
+        "maxRetentionTime": {
+          "type": "number"
+        },
+        "onSync": {
+          "$ref": "#/definitions/OnSyncCallback"
+        }
+      },
+      "additionalProperties": false
+    },
+    "OnSyncCallback": {},
+    "BroadcastCacheUpdateOptions": {
+      "type": "object",
+      "properties": {
+        "headersToCheck": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        },
+        "generatePayload": {
+          "type": "object",
+          "additionalProperties": false
+        },
+        "notifyAllClients": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "CacheableResponseOptions": {
+      "type": "object",
+      "properties": {
+        "statuses": {
+          "type": "array",
+          "items": {
+            "type": "number"
+          }
+        },
+        "headers": {
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        }
+      },
+      "additionalProperties": false
+    },
+    "ExpirationPluginOptions": {
+      "type": "object",
+      "properties": {
+        "maxEntries": {
+          "type": "number"
+        },
+        "maxAgeSeconds": {
+          "type": "number"
+        },
+        "matchOptions": {
+          "$ref": "#/definitions/CacheQueryOptions"
+        },
+        "purgeOnQuotaError": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "CacheQueryOptions": {
+      "type": "object",
+      "properties": {
+        "ignoreMethod": {
+          "type": "boolean"
+        },
+        "ignoreSearch": {
+          "type": "boolean"
+        },
+        "ignoreVary": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false
+    },
+    "WorkboxPlugin": {
+      "description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
+      "type": "object",
+      "properties": {
+        "cacheDidUpdate": {},
+        "cachedResponseWillBeUsed": {},
+        "cacheKeyWillBeUsed": {},
+        "cacheWillUpdate": {},
+        "fetchDidFail": {},
+        "fetchDidSucceed": {},
+        "handlerDidComplete": {},
+        "handlerDidError": {},
+        "handlerDidRespond": {},
+        "handlerWillRespond": {},
+        "handlerWillStart": {},
+        "requestWillFetch": {}
+      },
+      "additionalProperties": false
+    },
+    "CacheDidUpdateCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CachedResponseWillBeUsedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CacheKeyWillBeUsedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "CacheWillUpdateCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "FetchDidFailCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "FetchDidSucceedCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidCompleteCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidErrorCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerDidRespondCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerWillRespondCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "HandlerWillStartCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "RequestWillFetchCallback": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "RequestInit": {
+      "type": "object",
+      "properties": {
+        "body": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/ArrayBuffer"
+            },
+            {
+              "$ref": "#/definitions/ArrayBufferView"
+            },
+            {
+              "$ref": "#/definitions/ReadableStream"
+            },
+            {
+              "$ref": "#/definitions/Blob"
+            },
+            {
+              "$ref": "#/definitions/FormData"
+            },
+            {
+              "$ref": "#/definitions/URLSearchParams"
+            },
+            {
+              "type": [
+                "null",
+                "string"
+              ]
+            }
+          ]
+        },
+        "cache": {
+          "enum": [
+            "default",
+            "force-cache",
+            "no-cache",
+            "no-store",
+            "only-if-cached",
+            "reload"
+          ],
+          "type": "string"
+        },
+        "credentials": {
+          "enum": [
+            "include",
+            "omit",
+            "same-origin"
+          ],
+          "type": "string"
+        },
+        "headers": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/Record"
+            },
+            {
+              "type": "array",
+              "items": {
+                "type": "array",
+                "items": [
+                  {
+                    "type": "string"
+                  },
+                  {
+                    "type": "string"
+                  }
+                ],
+                "minItems": 2,
+                "maxItems": 2
+              }
+            },
+            {
+              "$ref": "#/definitions/Headers"
+            }
+          ]
+        },
+        "integrity": {
+          "type": "string"
+        },
+        "keepalive": {
+          "type": "boolean"
+        },
+        "method": {
+          "type": "string"
+        },
+        "mode": {
+          "enum": [
+            "cors",
+            "navigate",
+            "no-cors",
+            "same-origin"
+          ],
+          "type": "string"
+        },
+        "redirect": {
+          "enum": [
+            "error",
+            "follow",
+            "manual"
+          ],
+          "type": "string"
+        },
+        "referrer": {
+          "type": "string"
+        },
+        "referrerPolicy": {
+          "enum": [
+            "",
+            "no-referrer",
+            "no-referrer-when-downgrade",
+            "origin",
+            "origin-when-cross-origin",
+            "same-origin",
+            "strict-origin",
+            "strict-origin-when-cross-origin",
+            "unsafe-url"
+          ],
+          "type": "string"
+        },
+        "signal": {
+          "anyOf": [
+            {
+              "$ref": "#/definitions/AbortSignal"
+            },
+            {
+              "type": "null"
+            }
+          ]
+        },
+        "window": {
+          "type": "null"
+        }
+      },
+      "additionalProperties": false
+    },
+    "ArrayBuffer": {
+      "type": "object",
+      "properties": {
+        "byteLength": {
+          "type": "number"
+        },
+        "__@toStringTag@32": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "__@toStringTag@32",
+        "byteLength"
+      ]
+    },
+    "ArrayBufferView": {
+      "type": "object",
+      "properties": {
+        "buffer": {
+          "$ref": "#/definitions/ArrayBufferLike"
+        },
+        "byteLength": {
+          "type": "number"
+        },
+        "byteOffset": {
+          "type": "number"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "buffer",
+        "byteLength",
+        "byteOffset"
+      ]
+    },
+    "ArrayBufferLike": {
+      "anyOf": [
+        {
+          "$ref": "#/definitions/ArrayBuffer"
+        },
+        {
+          "$ref": "#/definitions/SharedArrayBuffer"
+        }
+      ]
+    },
+    "SharedArrayBuffer": {
+      "type": "object",
+      "properties": {
+        "byteLength": {
+          "type": "number"
+        },
+        "__@species@492": {
+          "$ref": "#/definitions/SharedArrayBuffer"
+        },
+        "__@toStringTag@32": {
+          "type": "string",
+          "const": "SharedArrayBuffer"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "__@species@492",
+        "__@toStringTag@32",
+        "byteLength"
+      ]
+    },
+    "ReadableStream": {
+      "type": "object",
+      "properties": {
+        "locked": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "locked"
+      ]
+    },
+    "Blob": {
+      "type": "object",
+      "properties": {
+        "size": {
+          "type": "number"
+        },
+        "type": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "size",
+        "type"
+      ]
+    },
+    "FormData": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "URLSearchParams": {
+      "type": "object",
+      "properties": {
+        "size": {
+          "description": "The total number of parameter entries.",
+          "type": "number"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "size"
+      ]
+    },
+    "Record": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "Headers": {
+      "type": "object",
+      "additionalProperties": false
+    },
+    "AbortSignal": {},
+    "RouteMatchCallback": {}
+  },
+  "$schema": "http://json-schema.org/draft-07/schema#"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/schema/WebpackInjectManifestOptions.json b/tools/ui/node_modules/workbox-build/src/schema/WebpackInjectManifestOptions.json
new file mode 100644
index 0000000000000000000000000000000000000000..01c6967335c2a8e98e5b09afea0f2f4d886a6e1b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/schema/WebpackInjectManifestOptions.json
@@ -0,0 +1,171 @@
+{
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "additionalManifestEntries": {
+      "description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
+      "type": "array",
+      "items": {
+        "anyOf": [
+          {
+            "$ref": "#/definitions/ManifestEntry"
+          },
+          {
+            "type": "string"
+          }
+        ]
+      }
+    },
+    "dontCacheBustURLsMatching": {
+      "description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
+      "$ref": "#/definitions/RegExp"
+    },
+    "manifestTransforms": {
+      "description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
+      "type": "array",
+      "items": {}
+    },
+    "maximumFileSizeToCacheInBytes": {
+      "description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
+      "default": 2097152,
+      "type": "number"
+    },
+    "modifyURLPrefix": {
+      "description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n  '/dist/': '/',\n  '': '/static',\n}\n```",
+      "type": "object",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
+    "chunks": {
+      "description": "One or more chunk names whose corresponding output files should be included\nin the precache manifest.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "exclude": {
+      "description": "One or more specifiers used to exclude assets from the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `exclude` option.\nIf not provided, the default value is `[/\\.map$/, /^manifest.*\\.js$]`.",
+      "type": "array",
+      "items": {}
+    },
+    "excludeChunks": {
+      "description": "One or more chunk names whose corresponding output files should be excluded\nfrom the precache manifest.",
+      "type": "array",
+      "items": {
+        "type": "string"
+      }
+    },
+    "include": {
+      "description": "One or more specifiers used to include assets in the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `include` option.",
+      "type": "array",
+      "items": {}
+    },
+    "mode": {
+      "description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `mode` value configured in the current `webpack` compilation\nwill be used.",
+      "type": [
+        "null",
+        "string"
+      ]
+    },
+    "injectionPoint": {
+      "description": "The string to find inside of the `swSrc` file. Once found, it will be\nreplaced by the generated precache manifest.",
+      "default": "self.__WB_MANIFEST",
+      "type": "string"
+    },
+    "swSrc": {
+      "description": "The path and filename of the service worker file that will be read during\nthe build process, relative to the current working directory.",
+      "type": "string"
+    },
+    "compileSrc": {
+      "description": "When `true` (the default), the `swSrc` file will be compiled by webpack.\nWhen `false`, compilation will not occur (and `webpackCompilationPlugins`\ncan't be used.) Set to `false` if you want to inject the manifest into,\ne.g., a JSON file.",
+      "default": true,
+      "type": "boolean"
+    },
+    "swDest": {
+      "description": "The asset name of the service worker file that will be created by this\nplugin. If omitted, the name will be based on the `swSrc` name.",
+      "type": "string"
+    },
+    "webpackCompilationPlugins": {
+      "description": "Optional `webpack` plugins that will be used when compiling the `swSrc`\ninput file. Only valid if `compileSrc` is `true`.",
+      "type": "array",
+      "items": {}
+    }
+  },
+  "required": [
+    "swSrc"
+  ],
+  "definitions": {
+    "ManifestEntry": {
+      "type": "object",
+      "properties": {
+        "integrity": {
+          "type": "string"
+        },
+        "revision": {
+          "type": [
+            "null",
+            "string"
+          ]
+        },
+        "url": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "revision",
+        "url"
+      ]
+    },
+    "RegExp": {
+      "type": "object",
+      "properties": {
+        "source": {
+          "type": "string"
+        },
+        "global": {
+          "type": "boolean"
+        },
+        "ignoreCase": {
+          "type": "boolean"
+        },
+        "multiline": {
+          "type": "boolean"
+        },
+        "lastIndex": {
+          "type": "number"
+        },
+        "flags": {
+          "type": "string"
+        },
+        "sticky": {
+          "type": "boolean"
+        },
+        "unicode": {
+          "type": "boolean"
+        },
+        "dotAll": {
+          "type": "boolean"
+        },
+        "hasIndices": {
+          "type": "boolean"
+        }
+      },
+      "additionalProperties": false,
+      "required": [
+        "dotAll",
+        "flags",
+        "global",
+        "hasIndices",
+        "ignoreCase",
+        "lastIndex",
+        "multiline",
+        "source",
+        "sticky",
+        "unicode"
+      ]
+    }
+  },
+  "$schema": "http://json-schema.org/draft-07/schema#"
+}
diff --git a/tools/ui/node_modules/workbox-build/src/strip-comments.d.ts b/tools/ui/node_modules/workbox-build/src/strip-comments.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3d681f453c5d460d4771e9036a21ab8a233da9f8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/strip-comments.d.ts
@@ -0,0 +1 @@
+declare module 'strip-comments';
diff --git a/tools/ui/node_modules/workbox-build/src/templates/sw-template.ts b/tools/ui/node_modules/workbox-build/src/templates/sw-template.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dacfaef89be7cc0405526bd5f93271ca91a3aa81
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/templates/sw-template.ts
@@ -0,0 +1,60 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+export const swTemplate = `/**
+ * Welcome to your Workbox-powered service worker!
+ *
+ * You'll need to register this file in your web app.
+ * See https://goo.gl/nhQhGp
+ *
+ * The rest of the code is auto-generated. Please don't update this file
+ * directly; instead, make changes to your Workbox build configuration
+ * and re-run your build process.
+ * See https://goo.gl/2aRDsh
+ */
+
+<% if (importScripts) { %>
+importScripts(
+  <%= importScripts.map(JSON.stringify).join(',\\n  ') %>
+);
+<% } %>
+
+<% if (navigationPreload) { %><%= use('workbox-navigation-preload', 'enable') %>();<% } %>
+
+<% if (cacheId) { %><%= use('workbox-core', 'setCacheNameDetails') %>({prefix: <%= JSON.stringify(cacheId) %>});<% } %>
+
+<% if (skipWaiting) { %>
+self.skipWaiting();
+<% } else { %>
+self.addEventListener('message', (event) => {
+  if (event.data && event.data.type === 'SKIP_WAITING') {
+    self.skipWaiting();
+  }
+});
+<% } %>
+<% if (clientsClaim) { %><%= use('workbox-core', 'clientsClaim') %>();<% } %>
+
+<% if (Array.isArray(manifestEntries) && manifestEntries.length > 0) {%>
+/**
+ * The precacheAndRoute() method efficiently caches and responds to
+ * requests for URLs in the manifest.
+ * See https://goo.gl/S9QRab
+ */
+<%= use('workbox-precaching', 'precacheAndRoute') %>(<%= JSON.stringify(manifestEntries, null, 2) %>, <%= precacheOptionsString %>);
+<% if (cleanupOutdatedCaches) { %><%= use('workbox-precaching', 'cleanupOutdatedCaches') %>();<% } %>
+<% if (navigateFallback) { %><%= use('workbox-routing', 'registerRoute') %>(new <%= use('workbox-routing', 'NavigationRoute') %>(<%= use('workbox-precaching', 'createHandlerBoundToURL') %>(<%= JSON.stringify(navigateFallback) %>)<% if (navigateFallbackAllowlist || navigateFallbackDenylist) { %>, {
+  <% if (navigateFallbackAllowlist) { %>allowlist: [<%= navigateFallbackAllowlist %>],<% } %>
+  <% if (navigateFallbackDenylist) { %>denylist: [<%= navigateFallbackDenylist %>],<% } %>
+}<% } %>));<% } %>
+<% } %>
+
+<% if (runtimeCaching) { runtimeCaching.forEach(runtimeCachingString => {%><%= runtimeCachingString %><% });} %>
+
+<% if (offlineAnalyticsConfigString) { %><%= use('workbox-google-analytics', 'initialize') %>(<%= offlineAnalyticsConfigString %>);<% } %>
+
+<% if (disableDevLogs) { %>self.__WB_DISABLE_DEV_LOGS = true;<% } %>`;
diff --git a/tools/ui/node_modules/workbox-build/src/types.ts b/tools/ui/node_modules/workbox-build/src/types.ts
new file mode 100644
index 0000000000000000000000000000000000000000..36e9d4800fdacf52da1759a68d8db47dfa8cac65
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/src/types.ts
@@ -0,0 +1,584 @@
+import {PackageJson} from 'type-fest';
+
+import {BroadcastCacheUpdateOptions} from 'workbox-broadcast-update/BroadcastCacheUpdate';
+import {GoogleAnalyticsInitializeOptions} from 'workbox-google-analytics/initialize';
+import {HTTPMethod} from 'workbox-routing/utils/constants';
+import {QueueOptions} from 'workbox-background-sync/Queue';
+import {RouteHandler, RouteMatchCallback} from 'workbox-core/types';
+import {CacheableResponseOptions} from 'workbox-cacheable-response/CacheableResponse';
+import {ExpirationPluginOptions} from 'workbox-expiration/ExpirationPlugin';
+import {WorkboxPlugin} from 'workbox-core/types';
+
+export interface ManifestEntry {
+  integrity?: string;
+  revision: string | null;
+  url: string;
+}
+
+export type StrategyName =
+  | 'CacheFirst'
+  | 'CacheOnly'
+  | 'NetworkFirst'
+  | 'NetworkOnly'
+  | 'StaleWhileRevalidate';
+
+export interface RuntimeCaching {
+  /**
+   * This determines how the runtime route will generate a response.
+   * To use one of the built-in {@link workbox-strategies}, provide its name,
+   * like `'NetworkFirst'`.
+   * Alternatively, this can be a {@link workbox-core.RouteHandler} callback
+   * function with custom response logic.
+   */
+  handler: RouteHandler | StrategyName;
+  /**
+   * The HTTP method to match against. The default value of `'GET'` is normally
+   * sufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or
+   * another type of request.
+   * @default "GET"
+   */
+  method?: HTTPMethod;
+  options?: {
+    /**
+     * Configuring this will add a
+     * {@link workbox-background-sync.BackgroundSyncPlugin} instance to the
+     * {@link workbox-strategies} configured in `handler`.
+     */
+    backgroundSync?: {
+      name: string;
+      options?: QueueOptions;
+    };
+    /**
+     * Configuring this will add a
+     * {@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the
+     * {@link workbox-strategies} configured in `handler`.
+     */
+    broadcastUpdate?: {
+      // TODO: This option is ignored since we switched to using postMessage().
+      // Remove it in the next major release.
+      channelName?: string;
+      options: BroadcastCacheUpdateOptions;
+    };
+    /**
+     * Configuring this will add a
+     * {@link workbox-cacheable-response.CacheableResponsePlugin} instance to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    cacheableResponse?: CacheableResponseOptions;
+    /**
+     * If provided, this will set the `cacheName` property of the
+     * {@link workbox-strategies} configured in `handler`.
+     */
+    cacheName?: string | null;
+    /**
+     * Configuring this will add a
+     * {@link workbox-expiration.ExpirationPlugin} instance to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    expiration?: ExpirationPluginOptions;
+    /**
+     * If provided, this will set the `networkTimeoutSeconds` property of the
+     * {@link workbox-strategies} configured in `handler`. Note that only
+     * `'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.
+     */
+    networkTimeoutSeconds?: number;
+    /**
+     * Configuring this allows the use of one or more Workbox plugins that
+     * don't have "shortcut" options (like `expiration` for
+     * {@link workbox-expiration.ExpirationPlugin}). The plugins provided here
+     * will be added to the {@link workbox-strategies} configured in `handler`.
+     */
+    plugins?: Array;
+    /**
+     * Configuring this will add a
+     * {@link workbox-precaching.PrecacheFallbackPlugin} instance to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    precacheFallback?: {
+      fallbackURL: string;
+    };
+    /**
+     * Enabling this will add a
+     * {@link workbox-range-requests.RangeRequestsPlugin} instance to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    rangeRequests?: boolean;
+    /**
+     * Configuring this will pass along the `fetchOptions` value to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    fetchOptions?: RequestInit;
+    /**
+     * Configuring this will pass along the `matchOptions` value to
+     * the {@link workbox-strategies} configured in `handler`.
+     */
+    matchOptions?: CacheQueryOptions;
+  };
+  /**
+   * This match criteria determines whether the configured handler will
+   * generate a response for any requests that don't match one of the precached
+   * URLs. If multiple `RuntimeCaching` routes are defined, then the first one
+   * whose `urlPattern` matches will be the one that responds.
+   *
+   * This value directly maps to the first parameter passed to
+   * {@link workbox-routing.registerRoute}. It's recommended to use a
+   * {@link workbox-core.RouteMatchCallback} function for greatest flexibility.
+   */
+  urlPattern: RegExp | string | RouteMatchCallback;
+}
+
+export interface ManifestTransformResult {
+  manifest: Array;
+  warnings?: Array;
+}
+
+export type ManifestTransform = (
+  manifestEntries: Array,
+  compilation?: unknown,
+) => Promise | ManifestTransformResult;
+
+export interface BasePartial {
+  /**
+   * A list of entries to be precached, in addition to any entries that are
+   * generated as part of the build configuration.
+   */
+  additionalManifestEntries?: Array;
+  /**
+   * Assets that match this will be assumed to be uniquely versioned via their
+   * URL, and exempted from the normal HTTP cache-busting that's done when
+   * populating the precache. While not required, it's recommended that if your
+   * existing build process already inserts a `[hash]` value into each filename,
+   * you provide a RegExp that will detect that, as it will reduce the bandwidth
+   * consumed when precaching.
+   */
+  dontCacheBustURLsMatching?: RegExp;
+  /**
+   * One or more functions which will be applied sequentially against the
+   * generated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are
+   * also specified, their corresponding transformations will be applied first.
+   */
+  manifestTransforms?: Array;
+  /**
+   * This value can be used to determine the maximum size of files that will be
+   * precached. This prevents you from inadvertently precaching very large files
+   * that might have accidentally matched one of your patterns.
+   * @default 2097152
+   */
+  maximumFileSizeToCacheInBytes?: number;
+  /**
+   * An object mapping string prefixes to replacement string values. This can be
+   * used to, e.g., remove or add a path prefix from a manifest entry if your
+   * web hosting setup doesn't match your local filesystem setup. As an
+   * alternative with more flexibility, you can use the `manifestTransforms`
+   * option and provide a function that modifies the entries in the manifest
+   * using whatever logic you provide.
+   *
+   * Example usage:
+   *
+   * ```
+   * // Replace a '/dist/' prefix with '/', and also prepend
+   * // '/static' to every URL.
+   * modifyURLPrefix: {
+   *   '/dist/': '/',
+   *   '': '/static',
+   * }
+   * ```
+   */
+  modifyURLPrefix?: {
+    [key: string]: string;
+  };
+}
+
+export interface GeneratePartial {
+  /**
+   * The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass
+   * to `babel-preset-env` when transpiling the service worker bundle.
+   * @default ["chrome >= 56"]
+   */
+  babelPresetEnvTargets?: Array;
+  /**
+   * An optional ID to be prepended to cache names. This is primarily useful for
+   * local development where multiple sites may be served from the same
+   * `http://localhost:port` origin.
+   */
+  cacheId?: string | null;
+  /**
+   * Whether or not Workbox should attempt to identify and delete any precaches
+   * created by older, incompatible versions.
+   * @default false
+   */
+  cleanupOutdatedCaches?: boolean;
+  /**
+   * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)
+   * any existing clients as soon as it activates.
+   * @default false
+   */
+  clientsClaim?: boolean;
+  /**
+   * If a navigation request for a URL ending in `/` fails to match a precached
+   * URL, this value will be appended to the URL and that will be checked for a
+   * precache match. This should be set to what your web server is using for its
+   * directory index.
+   */
+  directoryIndex?: string | null;
+  /**
+   * @default false
+   */
+  disableDevLogs?: boolean;
+  // We can't use the @default annotation here to assign the value via AJV, as
+  // an Array can't be serialized into JSON.
+  /**
+   * Any search parameter names that match against one of the RegExp in this
+   * array will be removed before looking for a precache match. This is useful
+   * if your users might request URLs that contain, for example, URL parameters
+   * used to track the source of the traffic. If not provided, the default value
+   * is `[/^utm_/, /^fbclid$/]`.
+   *
+   */
+  ignoreURLParametersMatching?: Array;
+  /**
+   * A list of JavaScript files that should be passed to
+   * [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)
+   * inside the generated service worker file. This is  useful when you want to
+   * let Workbox create your top-level service worker file, but want to include
+   * some additional code, such as a push event listener.
+   */
+  importScripts?: Array;
+  /**
+   * Whether the runtime code for the Workbox library should be included in the
+   * top-level service worker, or split into a separate file that needs to be
+   * deployed alongside the service worker. Keeping the runtime separate means
+   * that users will not have to re-download the Workbox code each time your
+   * top-level service worker changes.
+   * @default false
+   */
+  inlineWorkboxRuntime?: boolean;
+  /**
+   * If set to 'production', then an optimized service worker bundle that
+   * excludes debugging info will be produced. If not explicitly configured
+   * here, the `process.env.NODE_ENV` value will be used, and failing that, it
+   * will fall back to `'production'`.
+   * @default "production"
+   */
+  mode?: string | null;
+  /**
+   * If specified, all
+   * [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)
+   * for URLs that aren't precached will be fulfilled with the HTML at the URL
+   * provided. You must pass in the URL of an HTML document that is listed in
+   * your precache manifest. This is meant to be used in a Single Page App
+   * scenario, in which you want all navigations to use common
+   * [App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).
+   * @default null
+   */
+  navigateFallback?: string | null;
+  /**
+   * An optional array of regular expressions that restricts which URLs the
+   * configured `navigateFallback` behavior applies to. This is useful if only a
+   * subset of your site's URLs should be treated as being part of a
+   * [Single Page App](https://en.wikipedia.org/wiki/Single-page_application).
+   * If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are
+   * configured, the denylist takes precedent.
+   *
+   * *Note*: These RegExps may be evaluated against every destination URL during
+   * a navigation. Avoid using
+   * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+   * or else your users may see delays when navigating your site.
+   */
+  navigateFallbackAllowlist?: Array;
+  /**
+   * An optional array of regular expressions that restricts which URLs the
+   * configured `navigateFallback` behavior applies to. This is useful if only a
+   * subset of your site's URLs should be treated as being part of a
+   * [Single Page App](https://en.wikipedia.org/wiki/Single-page_application).
+   * If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are
+   * configured, the denylist takes precedence.
+   *
+   * *Note*: These RegExps may be evaluated against every destination URL during
+   * a navigation. Avoid using
+   * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+   * or else your users may see delays when navigating your site.
+   */
+  navigateFallbackDenylist?: Array;
+  /**
+   * Whether or not to enable
+   * [navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)
+   * in the generated service worker. When set to true, you must also use
+   * `runtimeCaching` to set up an appropriate response strategy that will match
+   * navigation requests, and make use of the preloaded response.
+   * @default false
+   */
+  navigationPreload?: boolean;
+  /**
+   * Controls whether or not to include support for
+   * [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).
+   * When `true`, the call to `workbox-google-analytics`'s `initialize()` will
+   * be added to your generated service worker. When set to an `Object`, that
+   * object will be passed in to the `initialize()` call, allowing you to
+   * customize the behavior.
+   * @default false
+   */
+  offlineGoogleAnalytics?: boolean | GoogleAnalyticsInitializeOptions;
+  /**
+   * When using Workbox's build tools to generate your service worker, you can
+   * specify one or more runtime caching configurations. These are then
+   * translated to {@link workbox-routing.registerRoute} calls using the match
+   * and handler configuration you define.
+   *
+   * For all of the options, see the {@link workbox-build.RuntimeCaching}
+   * documentation. The example below shows a typical configuration, with two
+   * runtime routes defined:
+   *
+   * @example
+   * runtimeCaching: [{
+   *   urlPattern: ({url}) => url.origin === 'https://api.example.com',
+   *   handler: 'NetworkFirst',
+   *   options: {
+   *     cacheName: 'api-cache',
+   *   },
+   * }, {
+   *   urlPattern: ({request}) => request.destination === 'image',
+   *   handler: 'StaleWhileRevalidate',
+   *   options: {
+   *     cacheName: 'images-cache',
+   *     expiration: {
+   *       maxEntries: 10,
+   *     },
+   *   },
+   * }]
+   */
+  runtimeCaching?: Array;
+  /**
+   * Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)
+   * to the generated service worker. If `false`, then a `message` listener will
+   * be added instead, allowing client pages to trigger `skipWaiting()` by
+   * calling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.
+   * @default false
+   */
+  skipWaiting?: boolean;
+  /**
+   * Whether to create a sourcemap for the generated service worker files.
+   * @default true
+   */
+  sourcemap?: boolean;
+}
+
+// This needs to be set when using GetManifest or InjectManifest, but is
+// optional when using GenerateSW if runtimeCaching is also used. This is
+// enforced via runtime validation, and needs to be documented.
+export interface RequiredGlobDirectoryPartial {
+  /**
+   * The local directory you wish to match `globPatterns` against. The path is
+   * relative to the current directory.
+   */
+  globDirectory: string;
+}
+
+export interface OptionalGlobDirectoryPartial {
+  /**
+   * The local directory you wish to match `globPatterns` against. The path is
+   * relative to the current directory.
+   */
+  globDirectory?: string;
+}
+
+export interface GlobPartial {
+  /**
+   * Determines whether or not symlinks are followed when generating the
+   * precache manifest. For more information, see the definition of `follow` in
+   * the `glob` [documentation](https://github.com/isaacs/node-glob#options).
+   * @default true
+   */
+  globFollow?: boolean;
+  /**
+   * A set of patterns matching files to always exclude when generating the
+   * precache manifest. For more information, see the definition of `ignore` in
+   * the `glob` [documentation](https://github.com/isaacs/node-glob#options).
+   * @default ["**\/node_modules\/**\/*"]
+   */
+  globIgnores?: Array;
+  /**
+   * Files matching any of these patterns will be included in the precache
+   * manifest. For more information, see the
+   * [`glob` primer](https://github.com/isaacs/node-glob#glob-primer).
+   * @default ["**\/*.{js,wasm,css,html}"]
+   */
+  globPatterns?: Array;
+  /**
+   * If a URL is rendered based on some server-side logic, its contents may
+   * depend on multiple files or on some other unique string value. The keys in
+   * this object are server-rendered URLs. If the values are an array of
+   * strings, they will be interpreted as `glob` patterns, and the contents of
+   * any files matching the patterns will be used to uniquely version the URL.
+   * If used with a single string, it will be interpreted as unique versioning
+   * information that you've generated for a given URL.
+   */
+  templatedURLs?: {
+    [key: string]: string | Array;
+  };
+}
+
+export interface InjectPartial {
+  /**
+   * The string to find inside of the `swSrc` file. Once found, it will be
+   * replaced by the generated precache manifest.
+   * @default "self.__WB_MANIFEST"
+   */
+  injectionPoint?: string;
+  /**
+   * The path and filename of the service worker file that will be read during
+   * the build process, relative to the current working directory.
+   */
+  swSrc: string;
+}
+
+export interface WebpackPartial {
+  /**
+   * One or more chunk names whose corresponding output files should be included
+   * in the precache manifest.
+   */
+  chunks?: Array;
+  // We can't use the @default annotation here to assign the value via AJV, as
+  // an Array can't be serialized into JSON.
+  // The default value of [/\.map$/, /^manifest.*\.js$/] will be assigned by
+  // the validation function, and we need to reflect that in the docs.
+  /**
+   * One or more specifiers used to exclude assets from the precache manifest.
+   * This is interpreted following
+   * [the same rules](https://webpack.js.org/configuration/module/#condition)
+   * as `webpack`'s standard `exclude` option.
+   * If not provided, the default value is `[/\.map$/, /^manifest.*\.js$]`.
+   */
+  //eslint-disable-next-line @typescript-eslint/ban-types
+  exclude?: Array boolean)>;
+  /**
+   * One or more chunk names whose corresponding output files should be excluded
+   * from the precache manifest.
+   */
+  excludeChunks?: Array;
+  /**
+   * One or more specifiers used to include assets in the precache manifest.
+   * This is interpreted following
+   * [the same rules](https://webpack.js.org/configuration/module/#condition)
+   * as `webpack`'s standard `include` option.
+   */
+  //eslint-disable-next-line @typescript-eslint/ban-types
+  include?: Array boolean)>;
+  /**
+   * If set to 'production', then an optimized service worker bundle that
+   * excludes debugging info will be produced. If not explicitly configured
+   * here, the `mode` value configured in the current `webpack` compilation
+   * will be used.
+   */
+  mode?: string | null;
+}
+
+export interface RequiredSWDestPartial {
+  /**
+   * The path and filename of the service worker file that will be created by
+   * the build process, relative to the current working directory. It must end
+   * in '.js'.
+   */
+  swDest: string;
+}
+
+export interface WebpackGenerateSWPartial {
+  /**
+   * One or more names of webpack chunks. The content of those chunks will be
+   * included in the generated service worker, via a call to `importScripts()`.
+   */
+  importScriptsViaChunks?: Array;
+  /**
+   * The asset name of the service worker file created by this plugin.
+   * @default "service-worker.js"
+   */
+  swDest?: string;
+}
+
+export interface WebpackInjectManifestPartial {
+  /**
+   * When `true` (the default), the `swSrc` file will be compiled by webpack.
+   * When `false`, compilation will not occur (and `webpackCompilationPlugins`
+   * can't be used.) Set to `false` if you want to inject the manifest into,
+   * e.g., a JSON file.
+   * @default true
+   */
+  compileSrc?: boolean;
+  // This doesn't have a hardcoded default value; instead, the default will be
+  // set at runtime to the swSrc basename, with the hardcoded extension .js.
+  /**
+   * The asset name of the service worker file that will be created by this
+   * plugin. If omitted, the name will be based on the `swSrc` name.
+   */
+  swDest?: string;
+  // This can only be set if compileSrc is true, but that restriction can't be
+  // represented in TypeScript. It's enforced via custom runtime validation
+  // logic and needs to be documented.
+  /**
+   * Optional `webpack` plugins that will be used when compiling the `swSrc`
+   * input file. Only valid if `compileSrc` is `true`.
+   */
+  webpackCompilationPlugins?: Array;
+}
+
+export type GenerateSWOptions = BasePartial &
+  GlobPartial &
+  GeneratePartial &
+  RequiredSWDestPartial &
+  OptionalGlobDirectoryPartial;
+
+export type GetManifestOptions = BasePartial &
+  GlobPartial &
+  RequiredGlobDirectoryPartial;
+
+export type InjectManifestOptions = BasePartial &
+  GlobPartial &
+  InjectPartial &
+  RequiredSWDestPartial &
+  RequiredGlobDirectoryPartial;
+
+export type WebpackGenerateSWOptions = BasePartial &
+  WebpackPartial &
+  GeneratePartial &
+  WebpackGenerateSWPartial;
+
+export type WebpackInjectManifestOptions = BasePartial &
+  WebpackPartial &
+  InjectPartial &
+  WebpackInjectManifestPartial;
+
+export interface GetManifestResult {
+  count: number;
+  manifestEntries: Array;
+  size: number;
+  warnings: Array;
+}
+
+export type BuildResult = Omit & {
+  filePaths: Array;
+};
+
+/**
+ * @private
+ */
+export interface FileDetails {
+  file: string;
+  hash: string;
+  size: number;
+}
+
+/**
+ * @private
+ */
+export type BuildType = 'dev' | 'prod';
+
+/**
+ * @private
+ */
+export interface WorkboxPackageJSON extends PackageJson {
+  workbox?: {
+    browserNamespace?: string;
+    packageType?: string;
+    prodOnly?: boolean;
+  };
+}
diff --git a/tools/ui/node_modules/workbox-build/tsconfig.json b/tools/ui/node_modules/workbox-build/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..ade16ea7c704f07d278ba0660671f7de1f00e489
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/tsconfig.json
@@ -0,0 +1,23 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "esModuleInterop": true,
+    "module": "CommonJS",
+    "outDir": "./build",
+    "resolveJsonModule": true,
+    "rootDir": "./src",
+    "target": "ES2018",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "files": ["src/cdn-details.json"],
+  "include": ["src/**/*.ts", "src/schema/*.json"],
+  "references": [
+    {"path": "../workbox-background-sync/"},
+    {"path": "../workbox-broadcast-update/"},
+    {"path": "../workbox-cacheable-response/"},
+    {"path": "../workbox-core/"},
+    {"path": "../workbox-expiration/"},
+    {"path": "../workbox-google-analytics/"}
+  ]
+}
diff --git a/tools/ui/node_modules/workbox-build/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-build/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..ee9a407c20ac90659b102b0e088d805039cd7ac0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-build/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/cdn-details.json","./node_modules/upath/upath.d.ts","./node_modules/type-fest/source/basic.d.ts","./node_modules/type-fest/source/except.d.ts","./node_modules/type-fest/source/mutable.d.ts","./node_modules/type-fest/source/merge.d.ts","./node_modules/type-fest/source/merge-exclusive.d.ts","./node_modules/type-fest/source/require-at-least-one.d.ts","./node_modules/type-fest/source/require-exactly-one.d.ts","./node_modules/type-fest/source/partial-deep.d.ts","./node_modules/type-fest/source/readonly-deep.d.ts","./node_modules/type-fest/source/literal-union.d.ts","./node_modules/type-fest/source/promisable.d.ts","./node_modules/type-fest/source/opaque.d.ts","./node_modules/type-fest/source/set-optional.d.ts","./node_modules/type-fest/source/set-required.d.ts","./node_modules/type-fest/source/value-of.d.ts","./node_modules/type-fest/source/promise-value.d.ts","./node_modules/type-fest/source/async-return-type.d.ts","./node_modules/type-fest/source/conditional-keys.d.ts","./node_modules/type-fest/source/conditional-except.d.ts","./node_modules/type-fest/source/conditional-pick.d.ts","./node_modules/type-fest/source/union-to-intersection.d.ts","./node_modules/type-fest/source/stringified.d.ts","./node_modules/type-fest/source/fixed-length-array.d.ts","./node_modules/type-fest/source/package-json.d.ts","./node_modules/type-fest/source/tsconfig-json.d.ts","./node_modules/type-fest/index.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-broadcast-update/_version.d.ts","../workbox-broadcast-update/broadcastcacheupdate.d.ts","../workbox-google-analytics/_version.d.ts","../workbox-google-analytics/initialize.d.ts","../workbox-routing/_version.d.ts","../workbox-routing/utils/constants.d.ts","../workbox-background-sync/_version.d.ts","../workbox-background-sync/queue.d.ts","../workbox-cacheable-response/_version.d.ts","../workbox-cacheable-response/cacheableresponse.d.ts","../workbox-expiration/_version.d.ts","../workbox-expiration/expirationplugin.d.ts","./src/types.ts","../../node_modules/@types/common-tags/index.d.ts","./src/lib/errors.ts","./src/lib/get-composite-details.ts","./node_modules/@types/node/compatibility/disposable.d.ts","./node_modules/@types/node/compatibility/indexable.d.ts","./node_modules/@types/node/compatibility/iterators.d.ts","./node_modules/@types/node/compatibility/index.d.ts","./node_modules/@types/node/ts5.6/globals.typedarray.d.ts","./node_modules/@types/node/ts5.6/buffer.buffer.d.ts","./node_modules/undici-types/header.d.ts","./node_modules/undici-types/readable.d.ts","./node_modules/undici-types/file.d.ts","./node_modules/undici-types/fetch.d.ts","./node_modules/undici-types/formdata.d.ts","./node_modules/undici-types/connector.d.ts","./node_modules/undici-types/client.d.ts","./node_modules/undici-types/errors.d.ts","./node_modules/undici-types/dispatcher.d.ts","./node_modules/undici-types/global-dispatcher.d.ts","./node_modules/undici-types/global-origin.d.ts","./node_modules/undici-types/pool-stats.d.ts","./node_modules/undici-types/pool.d.ts","./node_modules/undici-types/handlers.d.ts","./node_modules/undici-types/balanced-pool.d.ts","./node_modules/undici-types/agent.d.ts","./node_modules/undici-types/mock-interceptor.d.ts","./node_modules/undici-types/mock-agent.d.ts","./node_modules/undici-types/mock-client.d.ts","./node_modules/undici-types/mock-pool.d.ts","./node_modules/undici-types/mock-errors.d.ts","./node_modules/undici-types/proxy-agent.d.ts","./node_modules/undici-types/env-http-proxy-agent.d.ts","./node_modules/undici-types/retry-handler.d.ts","./node_modules/undici-types/retry-agent.d.ts","./node_modules/undici-types/api.d.ts","./node_modules/undici-types/interceptors.d.ts","./node_modules/undici-types/util.d.ts","./node_modules/undici-types/cookies.d.ts","./node_modules/undici-types/patch.d.ts","./node_modules/undici-types/websocket.d.ts","./node_modules/undici-types/eventsource.d.ts","./node_modules/undici-types/filereader.d.ts","./node_modules/undici-types/diagnostics-channel.d.ts","./node_modules/undici-types/content-type.d.ts","./node_modules/undici-types/cache.d.ts","./node_modules/undici-types/index.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/sea.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/ts5.6/index.d.ts","./node_modules/minipass/dist/commonjs/index.d.ts","./node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts","./node_modules/path-scurry/dist/commonjs/index.d.ts","./node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","./node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","./node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","./node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","./node_modules/glob/dist/commonjs/pattern.d.ts","./node_modules/glob/dist/commonjs/processor.d.ts","./node_modules/glob/dist/commonjs/walker.d.ts","./node_modules/glob/dist/commonjs/ignore.d.ts","./node_modules/glob/dist/commonjs/glob.d.ts","./node_modules/glob/dist/commonjs/has-magic.d.ts","./node_modules/glob/dist/commonjs/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","./src/lib/get-file-size.ts","./src/lib/get-string-hash.ts","./src/lib/get-file-hash.ts","./src/lib/get-file-details.ts","./src/lib/get-string-details.ts","./src/lib/additional-manifest-entries-transform.ts","./node_modules/pretty-bytes/index.d.ts","./src/lib/maximum-size-transform.ts","./src/lib/escape-regexp.ts","./src/lib/modify-url-prefix-transform.ts","./src/lib/no-revision-for-urls-matching-transform.ts","./src/lib/transform-manifest.ts","./src/lib/get-file-manifest-entries.ts","./src/lib/rebase-path.ts","./node_modules/fast-uri/types/index.d.ts","./node_modules/ajv/dist/compile/codegen/code.d.ts","./node_modules/ajv/dist/compile/codegen/scope.d.ts","./node_modules/ajv/dist/compile/codegen/index.d.ts","./node_modules/ajv/dist/compile/rules.d.ts","./node_modules/ajv/dist/compile/util.d.ts","./node_modules/ajv/dist/compile/validate/subschema.d.ts","./node_modules/ajv/dist/compile/errors.d.ts","./node_modules/ajv/dist/compile/validate/index.d.ts","./node_modules/ajv/dist/compile/validate/datatype.d.ts","./node_modules/ajv/dist/vocabularies/applicator/additionalitems.d.ts","./node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts","./node_modules/ajv/dist/vocabularies/applicator/contains.d.ts","./node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts","./node_modules/ajv/dist/vocabularies/applicator/propertynames.d.ts","./node_modules/ajv/dist/vocabularies/applicator/additionalproperties.d.ts","./node_modules/ajv/dist/vocabularies/applicator/not.d.ts","./node_modules/ajv/dist/vocabularies/applicator/anyof.d.ts","./node_modules/ajv/dist/vocabularies/applicator/oneof.d.ts","./node_modules/ajv/dist/vocabularies/applicator/if.d.ts","./node_modules/ajv/dist/vocabularies/applicator/index.d.ts","./node_modules/ajv/dist/vocabularies/validation/limitnumber.d.ts","./node_modules/ajv/dist/vocabularies/validation/multipleof.d.ts","./node_modules/ajv/dist/vocabularies/validation/pattern.d.ts","./node_modules/ajv/dist/vocabularies/validation/required.d.ts","./node_modules/ajv/dist/vocabularies/validation/uniqueitems.d.ts","./node_modules/ajv/dist/vocabularies/validation/const.d.ts","./node_modules/ajv/dist/vocabularies/validation/enum.d.ts","./node_modules/ajv/dist/vocabularies/validation/index.d.ts","./node_modules/ajv/dist/vocabularies/format/format.d.ts","./node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedproperties.d.ts","./node_modules/ajv/dist/vocabularies/unevaluated/unevaluateditems.d.ts","./node_modules/ajv/dist/vocabularies/validation/dependentrequired.d.ts","./node_modules/ajv/dist/vocabularies/discriminator/types.d.ts","./node_modules/ajv/dist/vocabularies/discriminator/index.d.ts","./node_modules/ajv/dist/vocabularies/errors.d.ts","./node_modules/ajv/dist/types/json-schema.d.ts","./node_modules/ajv/dist/types/jtd-schema.d.ts","./node_modules/ajv/dist/runtime/validation_error.d.ts","./node_modules/ajv/dist/compile/ref_error.d.ts","./node_modules/ajv/dist/core.d.ts","./node_modules/ajv/dist/compile/resolve.d.ts","./node_modules/ajv/dist/compile/index.d.ts","./node_modules/ajv/dist/types/index.d.ts","./node_modules/ajv/dist/ajv.d.ts","./node_modules/@apideck/better-ajv-errors/dist/types/validationerror.d.ts","./node_modules/@apideck/better-ajv-errors/dist/index.d.ts","./src/lib/validate-options.ts","./node_modules/@types/estree/index.d.ts","./node_modules/rollup/dist/rollup.d.ts","./node_modules/@rollup/pluginutils/types/index.d.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","./node_modules/@rollup/plugin-babel/types/index.d.ts","./node_modules/@rollup/plugin-node-resolve/types/index.d.ts","./node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts","./node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts","./node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts","./node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts","./node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts","./node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts","./node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts","./node_modules/@jridgewell/source-map/dist/types/source-map.d.ts","./node_modules/terser/tools/terser.d.ts","./node_modules/@rollup/plugin-terser/types/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","./node_modules/@rollup/plugin-replace/types/index.d.ts","./node_modules/tempy/index.d.ts","./src/lib/bundle.ts","./node_modules/eta/dist/index.d.mts","./src/lib/module-registry.ts","../../node_modules/@types/stringify-object/index.d.ts","./src/lib/stringify-without-comments.ts","./src/lib/runtime-caching-converter.ts","./src/templates/sw-template.ts","./src/lib/populate-sw-template.ts","./src/lib/write-sw-using-default-template.ts","./src/generate-sw.ts","./src/get-manifest.ts","./src/lib/copy-workbox-libraries.ts","./src/lib/cdn-utils.ts","./node_modules/source-map/source-map.d.ts","./node_modules/fast-json-stable-stringify/index.d.ts","./src/lib/get-source-map-url.ts","./src/lib/replace-and-update-source-map.ts","./src/lib/translate-url-to-sourcemap-paths.ts","./src/inject-manifest.ts","./src/index.ts","./src/rollup-plugin-off-main-thread.d.ts","./src/strip-comments.d.ts","./src/schema/generateswoptions.json","./src/schema/getmanifestoptions.json","./src/schema/injectmanifestoptions.json","./src/schema/webpackgenerateswoptions.json","./src/schema/webpackinjectmanifestoptions.json","./node_modules/@types/resolve/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},{"version":"deea2d82459b061fbce1c000ae4a2e2070096a5d03259e1b0b6ab87a58d0eb53","signature":"8ac11d028c089b8fea17b52cb9b2c695723fd4f160105804a0d6edd8b17d7229"},"40391fabf54c15c70c44c538a98ca9fe751a06adae84adc9a9c2da765452a538",{"version":"f20c9c09c8a0fea4784952305a937bdb092417908bad669dc789d3e54d8a5386","affectsGlobalScope":true},"c58be3e560989a877531d3ff7c9e5db41c5dd9282480ccf197abfcc708a95b8d","91f23ddc3971b1c8938c638fb55601a339483953e1eb800675fa5b5e8113db72","50d22844db90a0dcd359afeb59dd1e9a384d977b4b363c880b4e65047237a29e","d33782b82eea0ee17b99ca563bd19b38259a3aaf096d306ceaf59cd4422629be","7f7f1420c69806e268ab7820cbe31a2dcb2f836f28b3d09132a2a95b4a454b80","2d14198b25428b7b8010a895085add8edfaae476ab863c0c15fe2867fc214fe4","61046f12c3cfafd353d2d03febc96b441c1a0e3bb82a5a88de78cc1be9e10520","f4e7f5824ac7b35539efc3bef36b3e6be89603b88224cb5c0ad3526a454fc895","091af8276fbc70609a00e296840bd284a2fe29df282f0e8dae2de9f0a706685f","537aff717746703d2157ec563b5de4f6393ce9f69a84ae62b49e9b6c80b6e587","d4220a16027ddf0cc7d105d80cbb01f5070ca7ddd8b2d007cfb024b27e22b912","fb3aa3fb5f4fcd0d57d389a566c962e92dbfdaea3c38e3eaf27d466e168871c6","0af1485d84516c1a080c1f4569fea672caac8051e29f33733bf8d01df718d213","69630ad0e50189fb7a6b8f138c5492450394cb45424a903c8b53b2d5dd1dbce2","c585e44fdf120eba5f6b12c874966f152792af727115570b21cb23574f465ce1","8e067d3c170e56dfe3502fc8ebd092ae76a5235baad6f825726f3bbcc8a3836a","ae7f57067310d6c4acbc4862b91b5799e88831f4ab77f865443a9bc5057b540a","955d0c60502897e9735fcd08d2c1ad484b6166786328b89386074aebcd735776","2fa69d202a513f2a6553f263d473cba85d598ce250261715d78e8aab42df6b93","55480aa69f3984607fa60b3862b5cd24c2ee7bdd4edaed1eef6a8b46554e947f","3c19e77a05c092cab5f4fd57f6864aa2657f3ad524882f917a05fdb025905199","708350608d7483a4c585233b95d2dc86d992d36e7da312d5802e9a8837b5829d","75ff90ce3a6a52fbecc41c369de5082d8918f1e856bfce3651be2bfca4c2b91d","8e358d80ac052e9f4e5cc16d06c946628834b47718a4bd101ef2087603b8e5c7","aa6b17a3d65d7ac911240711b2fc885bf3e14af9025c38fcc9371b9ea586aeb6","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","46b907ed13bd5023adeb5446ad96e9680b1a40d4e4288344d0d0e31d9034d20a","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","ea689c41691ac977c4cf2cfe7fc7de5136851730c9d4dbc97d76eb65df8ee461","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","8d0f0aa989374cc6c7bc141649a9ca7d76b221a39375c8b98b844c3ad8c9b090","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","72c62b406af19eca8080ea63f90f4c907ee5b8348152b75ba106395cd7514f54","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","be3d53a4a6cc2e67e4b4b09c46bffce6282585fe504f77839863c53cb378a47f","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","3199d552cbbbac5a3c6e1499c09acf672ae8c8c8687cf2a3dbfa7c8902cc7054",{"version":"2242c4cf9706739ea0452e8d054ae1ca6e3d775702bdf5ad6db43b988dd12c0c","signature":"c82377c9ebc4d9788c743b6fba0661d1c34f39a7955476ac780039e120dc41fd"},"0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"9770457df47bea50f10698136dcd314c217e8e0df9b11f4e07934cd1a1e1e650","signature":"b4fa390044851a48984578a5db97e00a62e72b34be6e236d645b5260a7d737d1"},{"version":"d51914fe2890abc7d2c06a9fdcd88a320a31f24774d2f3c7478d94dc29e4e2be","signature":"b39a3a9582240b13bdb2613e93b047b21742926e3e60c5fa71202c9473ab378b"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","a37850c470c78826bc3d4f58a97803c3de03a8b6dcc7c53aec53826d96571988","9317d2eeb002d4bdaaf9f353e28fa66c22685d3eb84c567f7a859aa7a96f7731","de323e6e2d30c548683c4c0a44f46f06f1f38d361a4c58c0e36bf7db3caa4e30","1ef34600dcdf3c557836be168982275ba6ea91a6dc27b81a3342c76226bf0dff","4b1d652e9f1969df3732ff101565a28a315dd4186dfee46e5ca7a1540ba2b7c5","f891cf2e8a5299d0ee6b25e8b8100f868e0e08b8c6d0121d5c7b31963988751f","ca1f26cd4eacb23a25defaf92f5d28f41075f693c74838f5e3afc05c290b64a4","c3e973bb170cda56b3add0962b78ab5859c38b6791f55b46506ee642bba6ea09","5d20853a892f76d9c0c01f7a38c428f48f8fca89c33426320826d1f0090a7dac","c3ab91e697053ab728b5621722040feb03b57d64aa91267e7fca7b2f9dd1ee55","d840bff80b305e555ce81588219586207da31317649256fa021ad293de9a3d1a","96fa15def3f33000f48435e2d420d4b2c9028c8fcd598a8935e54dcf548026ca","4dc19c0c00dc6aecbc60ccbde00e5c6302197593bb47cd481294d3f78a386b93","b0287d4e1952363942bc3925344293dda6411afc2791c5421b20df03353751bb","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae",{"version":"f222e0423a35386f7d242562ed302fbf5563bbda610a00defb5b8ee5522df077","signature":"61171d75fb05641d59beb27c9d2345b394731178da72514d588986bd1132ce72"},{"version":"c27881b84a1253053c874ccbe0357b4bb5770c5f3658d759bacd05734fd01ffa","signature":"53cb8bf3a5143cbccacc17fd39e78c2cf21447aefda865164269304ca4c668a2"},{"version":"dc39dec950323f07c76c2e0940f8b1c25f3bea9f89211e66edf7ccab87441d40","signature":"e5d84c00bbf6a050590284398e75f2f0f08c6b460bacc1ec0d78756242b81f5d"},{"version":"c67452255a62a7ec120dba68e2ed817fa2dc3a6455be9bccf17869620392faf3","signature":"09abc155c675c165d9e214b66bca1b5ba74f4fc85e549bf70485bbd9d12c55af"},{"version":"f6e4c776c4f41fb8be5c9561979309634485c41dc68d3dc47d54f50de34ec459","signature":"1e788981070b78df0aec08df1624c283ca258cf82366623e4d42f486dee5d2e7"},{"version":"80623117c92970d555b6b5d78f88709187912a3ee2b912f307ad6353587fbbbb","signature":"279c887bcbf191c1640d4e2b35a4c79845cd46b0ed2beda4537abca51b5ae71b"},"17182fd66dcad4b02a5d8387322c42b8656b7ed9a91f6e13a09802130826748c",{"version":"360c0aea3c2e3fd07b1c1d12ca53a79f6f21fc962f21609492cbf98f08dee20d","signature":"2444ae0dc294650087c2503078df1ebd3270f7b7b3152854ccd8ec14e03d2b82"},{"version":"20b54a7dd0defe050cda1fbc41c97be534257a052bd42bd51cff6a92d9ab4313","signature":"87020a697465bc7154d50280cca2309590d138083f45c0cb934c9301a053d702"},{"version":"f96c3dec0fb1d67ca5038c5acc56f5669a573d4dbaa23c46f8a15cf908055a82","signature":"bdd7524ef37d05dad519f3147ac6739ce35dd44cf39d0441abc4000c5f804a79"},{"version":"3b190966070ee54de52bfd113ecc16cfefb5377a81e94421017a09b174f40be3","signature":"fac958f06c34bd4852471e0663a09309f4944f13348e96dbb395c4bc066173a0"},{"version":"80cc8a25ce920d3dff00fc2b1c5cf336f9d372fefac07f0067359bef7c36062d","signature":"a045198c726f9de64f0e185f870d1a0e56ca032f30e3bea5e9e3a1749347d60a"},{"version":"345f0108108dfeac4cb3028d957b931fbc8f4d1206845c5a9f2f0cba7e3d6bd6","signature":"c5e73a861be7643687c93f06b0a75d2b86fe0603d96130490e919c47fde80227"},{"version":"a4ca31146f1be5cfde4a69b6bf21da776f0e19acca0dc8731c084292f0273582","signature":"047cb6347a8ed50f5c07675ed71e3156d81a6f9217d5181a6960ba6f60e91109"},"84bcc7c6b06f4d643a55dc63b56be0c81d990f8d549b66ea615c553268774dc3","2d225e7bda2871c066a7079c88174340950fb604f624f2586d3ea27bb9e5f4ff","6a785f84e63234035e511817dd48ada756d984dd8f9344e56eb8b2bdcd8fd001","c1422d016f7df2ccd3594c06f2923199acd09898f2c42f50ea8159f1f856f618","2973b1b7857ca144251375b97f98474e9847a890331e27132d5a8b3aea9350a8","0eb6152d37c84d6119295493dfcc20c331c6fda1304a513d159cdaa599dcb78b","237df26f8c326ca00cd9d2deb40214a079749062156386b6d75bdcecc6988a6b","cd44995ee13d5d23df17a10213fed7b483fabfd5ea08f267ab52c07ce0b6b4da","58ce1486f851942bd2d3056b399079bc9cb978ec933fe9833ea417e33eab676e","7557d4d7f19f94341f4413575a3453ba7f6039c9591015bcf4282a8e75414043","a3b2cc16f3ce2d882eca44e1066f57a24751545f2a5e4a153d4de31b4cac9bb5","ac2b3b377d3068bfb6e1cb8889c99098f2c875955e2325315991882a74d92cc8","8deb39d89095469957f73bd194d11f01d9894b8c1f1e27fbf3f6e8122576b336","a38a9c41f433b608a0d37e645a31eecf7233ef3d3fffeb626988d3219f80e32f","8e1428dcba6a984489863935049893631170a37f9584c0479f06e1a5b1f04332","1fce9ecb87a2d3898941c60df617e52e50fb0c03c9b7b2ba8381972448327285","5ef0597b8238443908b2c4bf69149ed3894ac0ddd0515ac583d38c7595b151f1","ac52b775a80badff5f4ac329c5725a26bd5aaadd57afa7ad9e98b4844767312a","6ae5b4a63010c82bf2522b4ecfc29ffe6a8b0c5eea6b2b35120077e9ac54d7a1","dd7109c49f416f218915921d44f0f28975df78e04e437c62e1e1eb3be5e18a35","eee181112e420b345fc78422a6cc32385ede3d27e2eaf8b8c4ad8b2c29e3e52e","25fbe57c8ee3079e2201fe580578fab4f3a78881c98865b7c96233af00bf9624","62cc8477858487b4c4de7d7ae5e745a8ce0015c1592f398b63ee05d6e64ca295","cc2a9ec3cb10e4c0b8738b02c31798fad312d21ef20b6a2f5be1d077e9f5409d","4b4fadcda7d34034737598c07e2dca5d7e1e633cb3ba8dd4d2e6a7782b30b296","360fdc8829a51c5428636f1f83e7db36fef6c5a15ed4411b582d00a1c2bd6e97","1cf0d15e6ab1ecabbf329b906ae8543e6b8955133b7f6655f04d433e3a0597ab","7c9f98fe812643141502b30fb2b5ec56d16aaf94f98580276ae37b7924dd44a4","b3547893f24f59d0a644c52f55901b15a3fa1a115bc5ea9a582911469b9348b7","596e5b88b6ca8399076afcc22af6e6e0c4700c7cd1f420a78d637c3fb44a885e","adddf736e08132c7059ee572b128fdacb1c2650ace80d0f582e93d097ed4fbaf","d4cad9dc13e9c5348637170ddd5d95f7ed5fdfc856ddca40234fa55518bc99a6","d70675ba7ba7d02e52b7070a369957a70827e4b2bca2c1680c38a832e87b61fd","3be71f4ce8988a01e2f5368bdd58e1d60236baf511e4510ee9291c7b3729a27e","423d2ccc38e369a7527988d682fafc40267bcd6688a7473e59c5eea20a29b64f","2f9fde0868ed030277c678b435f63fcf03d27c04301299580a4017963cc04ce6","feeb73d48cc41c6dd23d17473521b0af877751504c30c18dc84267c8eeea429a","25f1159094dc0bf3a71313a74e0885426af21c5d6564a254004f2cadf9c5b052","cde493e09daad4bb29922fe633f760be9f0e8e2f39cdca999cce3b8690b5e13a","3d7f9eb12aface876f7b535cc89dcd416daf77f0b3573333f16ec0a70bcf902a","4304f640f7cb4724ea82441accb7c7607fa7207541182470d625adda99b2900b","e0205f04611bea8b5b82168065b8ef1476a8e96236201494eb8c785331c43118","62d26d8ba4fa15ab425c1b57a050ed76c5b0ecbffaa53f182110aa3a02405a07","9941cbf7ca695e95d588f5f1692ab040b078d44a95d231fa9a8f828186b7b77d","41b8775befd7ded7245a627e9f4de6110236688ce4c124d2d40c37bc1a3bfe05","596ecafe6779b4b096957345c7be8554a33d492539399babc05f53ea099221ff","c898277637bf4d686291cb925786e1aae127b0767b00a3f5f42eb4bafb483eb8",{"version":"d6ef543b4ce4c0f35db35fd03c7d43d9f6448299892c82de43669e3eba84ccac","signature":"8b4f51d5114d99cf4016acab54122c9c35a40c9c70a014440da1c553f3bf94ab"},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d",{"version":"ee70b8037ecdf0de6c04f35277f253663a536d7e38f1539d270e4e916d225a3f","affectsGlobalScope":true},"58eb22ce690f7941a952f307d51a210195798c9fbc381470fe7e0adb228d4c92","c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d8f0c3d878be96d77b6c51bf77ecd29f4f239520d1d9fd5604317fb14fac1783","1f80c9199cf76a9ccdabff0de44dd6936a11ec224ea2fba0e1b678c8edeca7ba","971f12a5fc236419ced0b7b9f23a53c1758233713f565635bbf4b85e2b23f55a","9d670bb3be18ea59cea824e3bb07d576b55c9542f5bc24aacc2a3c1ebd889de6","695b586df2d8c78b78cdd7cc6943594f3f4bc52948f13b31cdedfa3ce8d97c31","0771a93ef5e3b2a29f929c20f7ad232829341a671c9d1e96e93ef3fc42ef7bc2","cadb68b67b80b14a9a5bb64cce3093168fb2bfe2c7b10096d230df5203218de1","0b3c75be13f930b46117e205d900ee9c4f2ad6c7317655bca5364958ba1e34f0","5af161220fdf46730477706e8c431ccbd1b4ff50223cb32450bc20513f50bfbd","693015483017a74f286180d19da286d238a328b98595e6e3d37d556538b03bd4","55142d0b448290753e52571fd27c50922357902c710665d26687ba0c203ec96d","bce230ef494da5b08091a96455b738ba41ee6f25d3577edd7e4e771bdf78c218","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","e845a811620d0600bd0d63e0ff7414d962ddc6def10845106e066a470209ef41","07e4c9a12b6879a767145157bb4189fd519fdc1f88e0e4baebd4934718a1ade4",{"version":"563519707923eca72d55ec1f1e91a930906733cc0be05e2ab195499465febc0c","signature":"f60f4c8999c1b6b1c4a2496d911d743669ecbb82bad7612c875af63c2efd8f66"},"345cf305210fa63f48be6af1af46ab0ff230b634f8fe239bcdc308c42a2a5049",{"version":"498d64bf31a169e1028e9535a5f4554405e789ccc822f9e36dc1b0ac2def8700","signature":"33441dac69cfad0dfcca2db91c02b2f3c721e18cc54027803ef7e143f5ee4ab3"},"2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1",{"version":"97d6ab6501d2dfe11c3c6a1442e13afb84d62c33305f7e55396f7db9d5d111a6","signature":"adbda6537f6bd2d61c4c2b3d605741f91f76b9eb1a1aa5f3138113ecd1f15097"},{"version":"a96330d5ea6c2a665caae8a50a18e00e292df6a2b5a01254aea4d9d68520222c","signature":"19c73f631d2bb15466ca96dc65be29c791d780552017cee0c258d4e8db1ddd73"},{"version":"fe43b0ac99d0a98d1c35400c051e34e5a25fd9f8ebea3c7aa14a2d59dbb4aeee","signature":"bd75b1d878b4252a69219b47d6b2a7ee2cfaf9ed3111a38d609eef96cbe6bdba"},{"version":"975bbbd4ab6f744cd67bc539a66cdb51b4b9bd51d11103d8712581c8aebe6e84","signature":"2db48754d31d9655751c701fa52789637f24aa80ba6ce3cee3377d835f6ca3dc"},{"version":"668d749954cf0d115860d1eba112ea84843ac86c499de3795391450b2b88cd28","signature":"63838d7280a3ca63cf6485099c86dcb032e387c3cd9817bad676058bcab9595e"},{"version":"f87ab8ca7e43c0ac46e6767160d7e4298628515c7d623a3423894a6c1d6bbdfc","signature":"3b0951ca295694b8d7b8139c1d69c1e6c2085e65fd86c8968eae8224f3bf5bfe"},{"version":"c33d8c3b2c39517e1498c9d598498d27afe23ab70483ff6537a9e059a051929f","signature":"f2393e9e894511d174544b3319d5ed107753cc76548e590454024ccf2dedc881"},{"version":"0b5506be021021a4e9b18c04a2b3793fca6023399bc1955e053ed0e7ef23fe56","signature":"cd21651ff2dc71a2d2386cecd16eca9eed55064b792564c2ff09e9465f974521"},{"version":"d1b225dfdb1c44617c5bb0c2aadd64618ddfc19d5f30d629e7cdb4ac3067d998","signature":"e3bf0a5aa199a4fc9f478808c7ffc2aa01411944594c2b305a43ede96e4a521d"},"b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","6c360ff81ea615810619342d67cea417bb971ada8961ac1aa86c23aff366c58f",{"version":"91d7f56e0bb7ccd913cdf0ee31a2fd121150331a01bc547ce4d7f7b405156b5f","signature":"c948227e78d122dc9dd4b57c316bf5e205b6b6c900b0b9ccc16ddbd37e7b5ba6"},{"version":"ef4e5ccce5ac4140b5a6ae94faa67dbdcce644abd39486bae38aace6539714ce","signature":"b0d879cd528c0d3674e95692ee147239193dfe349f0f41fbc60b8524543edbac"},{"version":"fce6d86a23c8735aa500ccef1fe7acbd93cb244779502a21a8a3c45d01d3b8b6","signature":"86df4d13002d8709ea2ae1a2b569fddaa60d36082f529df42ed1589fac5a9454"},{"version":"71da3d2fcff0e090848ed2e58749abb8936575c004336e1daeda8c42258d56fa","signature":"83af0534774218e8d8205fb55df878c77e2471708a9d1435778aa69dabc24839"},{"version":"0dd1997b1410d02a521f62ea1b82dcd838e9ac49a21f4c572284a2329eda6f35","signature":"0013a72eaf0d971739705e72d2334e90973516c348f3b42a070ea5ec5563f502"},"a0dd2b414d4b483ea100c97281c6eedec822bf44d9055f1d9dbe3434988fa507","17df081ff23d594b8df26254565a337809b4000f1e3f93c53b139b63e11b7072",{"version":"e001fb23f54e627e65e64fd0a2893cf6c2158358a27efa739322e97efd48ba26","signature":"ce7b173303dd24a8b18fc3aad6021d4e6d525048a50057939dd84a59c2512585"},"fb0437b68ddc17329a0256675dd2e07173d95b7acbe514c3d77fba7fc1525b7f","68845e34033880b44f7b9212d52a6f96cc2dddab2a412b491036c832b8d1edfa",{"version":"ac3d986e65e60f61ef04bc9b58e87b524b252693406e074e612c3f9687422001","signature":"272e78d1356b06824575c719cf5e1d0ff4f617e401fbc6fcee55cd107eda8cfc"},"29f6992e9c7e29a45bd14d27e571aa54f0fab04fea93ae4ff9ee05e60d52081f","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./build","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":5,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[107,149,279],[107,149],[107,149,279,280,281,282,283],[107,149,279,281],[107,149,276,277,331],[107,149,276,277,328,330],[107,149,162,198],[107,149,161,198,333],[107,149,356],[107,149,341],[107,149,345,346,347],[107,149,344],[107,149,346],[107,149,336,342,343,348,351,353,354,355],[107,149,343,349,350,356],[107,149,349,352],[107,149,343,344,349,356],[107,149,343,356],[107,149,337,338,339,340],[107,149,361,400],[107,149,361,385,400],[107,149,400],[107,149,361],[107,149,361,386,400],[107,149,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399],[107,149,386,400],[107,149,403],[107,149,198,406,407,408,409,410,411,412,413,414,415,416],[107,149,405,406,415],[107,149,406,415],[107,149,401,405,406,415],[107,149,405,406,407,408,409,410,411,412,413,414,416],[107,149,406],[107,149,154,405,415],[85,107,149],[107,149,272,273],[107,149,272],[107,149,290,292],[107,149,291],[107,149,290,293],[107,149,288,290],[107,149,287,288,289],[107,149,287,290],[107,149,277,278,284],[107,149,277],[107,149,277,278],[107,149,277,295],[107,149,276,277],[107,146,149],[107,148,149],[107,149,154,183],[107,149,150,155,161,162,169,180,191],[107,149,150,151,161,169],[102,103,104,107,149],[107,149,152,192],[107,149,153,154,162,170],[107,149,154,180,188],[107,149,155,157,161,169],[107,148,149,156],[107,149,157,158],[107,149,161],[107,149,159,161],[107,148,149,161],[107,149,161,162,163,180,191],[107,149,161,162,163,176,180,183],[107,144,149,196],[107,149,157,161,164,169,180,191],[107,149,161,162,164,165,169,180,188,191],[107,149,164,166,180,188,191],[107,149,161,167],[107,149,168,191,196],[107,149,157,161,169,180],[107,149,170],[107,149,171],[107,148,149,172],[107,146,147,148,149,150,151,152,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[107,149,174],[107,149,175],[107,149,161,176,177],[107,149,176,178,192,194],[107,149,161,180,181,183],[107,149,182,183],[107,149,180,181],[107,149,183],[107,149,184],[107,146,149,180],[107,149,161,186,187],[107,149,186,187],[107,149,154,169,180,188],[107,149,189],[149],[105,106,107,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[107,149,169,190],[107,149,164,175,191],[107,149,154,192],[107,149,180,193],[107,149,168,194],[107,149,195],[107,149,154,161,163,172,180,191,194,196],[107,149,180,197],[107,149,231,232,236,263,264,266,267,268,270,271],[107,149,229,230],[107,149,229],[107,149,231,271],[107,149,231,232,268,269,271],[107,149,271],[107,149,228,271,272],[107,149,231,232,270,271],[107,149,231,232,234,235,270,271],[107,149,231,232,233,270,271],[107,149,231,232,236,263,264,265,266,267,270,271],[107,149,228,231,232,236,268,270],[107,149,236,271],[107,149,238,239,240,241,242,243,244,245,246,247,271],[107,149,261,271],[107,149,237,248,256,257,258,259,260,262],[107,149,241,271],[107,149,249,250,251,252,253,254,255,271],[107,149,199,201,205,206,209],[107,149,210],[107,149,201,205,208],[107,149,199,201,205,208,209,210,211],[107,149,205],[107,149,201,205,206,208],[107,149,199,201,206,207,209],[107,149,202,203,204],[107,149,161,184,198],[107,149,162,171,199,200],[83,107,149,198],[107,149,294],[58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,107,149],[73,107,149],[59,75,107,149],[75,107,149],[58,107,149],[59,107,149],[67,107,149],[107,116,120,149,191],[107,116,149,180,191],[107,111,149],[107,113,116,149,188,191],[107,149,169,188],[107,149,198],[107,111,149,198],[107,113,116,149,169,191],[107,108,109,112,115,149,161,180,191],[107,116,123,149],[107,108,114,149],[107,116,137,138,149],[107,112,116,149,183,191,198],[107,137,149,198],[107,110,111,149,198],[107,116,149],[107,110,111,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,138,139,140,141,142,143,149],[107,116,131,149],[107,116,123,124,149],[107,114,116,124,125,149],[107,115,149],[107,108,111,116,149],[107,116,120,124,125,149],[107,120,149],[107,114,116,119,149,191],[107,108,113,116,123,149],[107,149,180],[107,111,116,137,149,196,198],[57,98,107,149,226,227,275,308],[98,107,149,226,275],[98,107,149,309,310,311,312,318],[57,98,100,107,146,149,213,222,226,227,275,313,314,315,316,317],[98,100,107,149],[57,98,107,149,213,277,285,286,296,297,298,299,320],[56,98,100,107,146,149],[57,98,100,107,149,213],[99,107,149],[98,107,149,154],[57,98,100,107,149,212,214,216],[100,107,149,213,215],[98,100,101,107,146,149,217,218,225],[100,107,149,213],[98,107,149,215],[107,149,154],[98,107,149,220],[98,100,107,149,222],[57,99,107,149],[98,100,107,149,301,302,304,305,306],[57,107,149],[107,149,313],[98,99,100,107,149,302,304],[107,149,303,321],[98,100,107,149,219,221,223,224],[57,100,107,149,213],[98,99,100,107,149,272,274],[57,98,100,107,149,213,300,307],[83,85,87,89,91,93,95,97,107,149],[98],[98,309,310,311,312,318],[154],[313],[98,302],[83,85,87,89,91,93,95,97]],"referencedMap":[[281,1],[279,2],[284,3],[280,1],[297,2],[282,4],[283,1],[99,2],[332,5],[328,2],[331,6],[329,2],[213,7],[334,8],[335,2],[330,2],[336,2],[357,9],[342,10],[348,11],[346,2],[345,12],[347,13],[356,14],[351,15],[353,16],[354,17],[355,18],[349,2],[350,18],[352,18],[344,18],[343,2],[338,2],[337,2],[340,10],[341,19],[339,10],[333,2],[358,2],[359,2],[360,2],[385,20],[386,21],[361,22],[364,22],[383,20],[384,20],[374,20],[373,23],[371,20],[366,20],[379,20],[377,20],[381,20],[365,20],[378,20],[382,20],[367,20],[368,20],[380,20],[362,20],[369,20],[370,20],[372,20],[376,20],[387,24],[375,20],[363,20],[400,25],[399,2],[394,24],[396,26],[395,24],[388,24],[389,24],[391,24],[393,24],[397,26],[398,26],[390,26],[392,26],[401,2],[303,2],[402,2],[404,27],[403,2],[417,28],[416,29],[407,30],[408,31],[415,32],[409,31],[410,30],[411,30],[412,30],[413,33],[406,34],[414,29],[405,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[8,2],[48,2],[45,2],[46,2],[47,2],[49,2],[9,2],[50,2],[51,2],[52,2],[53,2],[54,2],[1,2],[10,2],[55,2],[11,2],[92,2],[93,2],[86,2],[87,35],[274,36],[273,37],[293,38],[291,2],[292,39],[294,40],[289,41],[287,2],[290,42],[288,43],[285,44],[286,45],[298,46],[296,47],[278,48],[276,2],[146,49],[147,49],[148,50],[149,51],[150,52],[151,53],[102,2],[105,54],[103,2],[104,2],[152,55],[153,56],[154,57],[155,58],[156,59],[157,60],[158,60],[160,61],[159,62],[161,63],[162,64],[163,65],[145,66],[164,67],[165,68],[166,69],[167,70],[168,71],[169,72],[170,73],[171,74],[172,75],[173,76],[174,77],[175,78],[176,79],[177,79],[178,80],[179,2],[180,81],[182,82],[181,83],[183,84],[184,85],[185,86],[186,87],[187,88],[188,89],[189,90],[107,91],[106,2],[198,92],[190,93],[191,94],[192,95],[193,96],[194,97],[195,98],[196,99],[197,100],[327,2],[272,101],[229,2],[231,102],[230,103],[235,104],[270,105],[267,106],[269,107],[232,106],[233,108],[237,108],[236,109],[234,110],[268,111],[266,106],[271,112],[264,2],[265,2],[238,113],[243,106],[245,106],[240,106],[241,113],[247,106],[248,114],[239,106],[244,106],[246,106],[242,106],[262,115],[261,106],[263,116],[257,106],[259,106],[258,106],[254,106],[260,117],[255,106],[256,118],[249,106],[250,106],[251,106],[252,106],[253,106],[301,2],[314,2],[228,2],[210,119],[211,120],[209,121],[212,122],[206,123],[207,124],[208,125],[202,123],[203,123],[205,126],[204,123],[199,127],[201,128],[200,2],[220,2],[277,48],[313,2],[299,129],[295,130],[83,131],[74,132],[58,2],[76,133],[75,2],[77,134],[59,2],[80,2],[67,135],[62,2],[61,136],[60,2],[69,2],[81,137],[65,135],[68,2],[73,2],[66,135],[63,136],[64,2],[70,136],[71,136],[79,2],[82,2],[78,2],[72,2],[123,138],[133,139],[122,138],[143,140],[114,141],[113,142],[142,143],[136,144],[141,145],[116,146],[130,147],[115,148],[139,149],[111,150],[110,143],[140,151],[112,152],[117,153],[118,2],[121,153],[108,2],[144,154],[134,155],[125,156],[126,157],[128,158],[124,159],[127,160],[137,143],[119,161],[120,162],[129,163],[109,164],[132,155],[131,153],[135,2],[138,165],[57,2],[56,2],[309,166],[310,167],[319,168],[318,169],[219,170],[300,171],[312,172],[311,173],[100,174],[222,2],[101,175],[217,176],[216,177],[226,178],[214,179],[315,2],[218,180],[215,181],[221,182],[223,183],[302,184],[224,170],[307,185],[227,186],[316,187],[305,188],[304,189],[225,190],[317,191],[275,192],[308,193],[320,2],[322,2],[323,2],[324,2],[325,2],[326,2],[321,2],[306,2],[98,194],[94,2],[95,2],[84,2],[85,2],[96,2],[97,35],[88,2],[89,2],[90,2],[91,2]],"exportedModulesMap":[[281,1],[279,2],[284,3],[280,1],[297,2],[282,4],[283,1],[99,2],[332,5],[328,2],[331,6],[329,2],[213,7],[334,8],[335,2],[330,2],[336,2],[357,9],[342,10],[348,11],[346,2],[345,12],[347,13],[356,14],[351,15],[353,16],[354,17],[355,18],[349,2],[350,18],[352,18],[344,18],[343,2],[338,2],[337,2],[340,10],[341,19],[339,10],[333,2],[358,2],[359,2],[360,2],[385,20],[386,21],[361,22],[364,22],[383,20],[384,20],[374,20],[373,23],[371,20],[366,20],[379,20],[377,20],[381,20],[365,20],[378,20],[382,20],[367,20],[368,20],[380,20],[362,20],[369,20],[370,20],[372,20],[376,20],[387,24],[375,20],[363,20],[400,25],[399,2],[394,24],[396,26],[395,24],[388,24],[389,24],[391,24],[393,24],[397,26],[398,26],[390,26],[392,26],[401,2],[303,2],[402,2],[404,27],[403,2],[417,28],[416,29],[407,30],[408,31],[415,32],[409,31],[410,30],[411,30],[412,30],[413,33],[406,34],[414,29],[405,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[8,2],[48,2],[45,2],[46,2],[47,2],[49,2],[9,2],[50,2],[51,2],[52,2],[53,2],[54,2],[1,2],[10,2],[55,2],[11,2],[92,2],[93,2],[86,2],[87,35],[274,36],[273,37],[293,38],[291,2],[292,39],[294,40],[289,41],[287,2],[290,42],[288,43],[285,44],[286,45],[298,46],[296,47],[278,48],[276,2],[146,49],[147,49],[148,50],[149,51],[150,52],[151,53],[102,2],[105,54],[103,2],[104,2],[152,55],[153,56],[154,57],[155,58],[156,59],[157,60],[158,60],[160,61],[159,62],[161,63],[162,64],[163,65],[145,66],[164,67],[165,68],[166,69],[167,70],[168,71],[169,72],[170,73],[171,74],[172,75],[173,76],[174,77],[175,78],[176,79],[177,79],[178,80],[179,2],[180,81],[182,82],[181,83],[183,84],[184,85],[185,86],[186,87],[187,88],[188,89],[189,90],[107,91],[106,2],[198,92],[190,93],[191,94],[192,95],[193,96],[194,97],[195,98],[196,99],[197,100],[327,2],[272,101],[229,2],[231,102],[230,103],[235,104],[270,105],[267,106],[269,107],[232,106],[233,108],[237,108],[236,109],[234,110],[268,111],[266,106],[271,112],[264,2],[265,2],[238,113],[243,106],[245,106],[240,106],[241,113],[247,106],[248,114],[239,106],[244,106],[246,106],[242,106],[262,115],[261,106],[263,116],[257,106],[259,106],[258,106],[254,106],[260,117],[255,106],[256,118],[249,106],[250,106],[251,106],[252,106],[253,106],[301,2],[314,2],[228,2],[210,119],[211,120],[209,121],[212,122],[206,123],[207,124],[208,125],[202,123],[203,123],[205,126],[204,123],[199,127],[201,128],[200,2],[220,2],[277,48],[313,2],[299,129],[295,130],[83,131],[74,132],[58,2],[76,133],[75,2],[77,134],[59,2],[80,2],[67,135],[62,2],[61,136],[60,2],[69,2],[81,137],[65,135],[68,2],[73,2],[66,135],[63,136],[64,2],[70,136],[71,136],[79,2],[82,2],[78,2],[72,2],[123,138],[133,139],[122,138],[143,140],[114,141],[113,142],[142,143],[136,144],[141,145],[116,146],[130,147],[115,148],[139,149],[111,150],[110,143],[140,151],[112,152],[117,153],[118,2],[121,153],[108,2],[144,154],[134,155],[125,156],[126,157],[128,158],[124,159],[127,160],[137,143],[119,161],[120,162],[129,163],[109,164],[132,155],[131,153],[135,2],[138,165],[57,2],[309,195],[310,195],[319,196],[318,195],[219,195],[300,195],[312,195],[101,195],[217,195],[226,195],[218,195],[215,197],[221,195],[223,195],[224,195],[307,195],[316,198],[305,199],[225,195],[275,195],[308,195],[320,2],[323,2],[324,2],[326,2],[321,2],[98,200],[94,2],[95,2],[84,2],[85,2],[96,2],[97,35],[88,2],[89,2],[90,2],[91,2]],"semanticDiagnosticsPerFile":[281,279,284,280,297,282,283,99,332,328,331,329,213,334,335,330,336,357,342,348,346,345,347,356,351,353,354,355,349,350,352,344,343,338,337,340,341,339,333,358,359,360,385,386,361,364,383,384,374,373,371,366,379,377,381,365,378,382,367,368,380,362,369,370,372,376,387,375,363,400,399,394,396,395,388,389,391,393,397,398,390,392,401,303,402,404,403,417,416,407,408,415,409,410,411,412,413,406,414,405,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,54,1,10,55,11,92,93,86,87,274,273,293,291,292,294,289,287,290,288,285,286,298,296,278,276,146,147,148,149,150,151,102,105,103,104,152,153,154,155,156,157,158,160,159,161,162,163,145,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,181,183,184,185,186,187,188,189,107,106,198,190,191,192,193,194,195,196,197,327,272,229,231,230,235,270,267,269,232,233,237,236,234,268,266,271,264,265,238,243,245,240,241,247,248,239,244,246,242,262,261,263,257,259,258,254,260,255,256,249,250,251,252,253,301,314,228,210,211,209,212,206,207,208,202,203,205,204,199,201,200,220,277,313,299,295,83,74,58,76,75,77,59,80,67,62,61,60,69,81,65,68,73,66,63,64,70,71,79,82,78,72,123,133,122,143,114,113,142,136,141,116,130,115,139,111,110,140,112,117,118,121,108,144,134,125,126,128,124,127,137,119,120,129,109,132,131,135,138,57,56,309,310,319,318,219,300,312,311,100,222,101,217,216,226,214,315,218,215,221,223,302,224,307,227,316,305,304,225,317,275,308,320,322,323,324,325,326,321,306,98,94,95,84,85,96,97,88,89,90,91],"latestChangedDtsFile":"./build/index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.d.ts b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a08cb13b53013702dd1cdd87535748cca23487bb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.d.ts
@@ -0,0 +1,45 @@
+import './_version.js';
+export interface CacheableResponseOptions {
+    statuses?: number[];
+    headers?: {
+        [headerName: string]: string;
+    };
+}
+/**
+ * This class allows you to set up rules determining what
+ * status codes and/or headers need to be present in order for a
+ * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
+ * to be considered cacheable.
+ *
+ * @memberof workbox-cacheable-response
+ */
+declare class CacheableResponse {
+    private readonly _statuses?;
+    private readonly _headers?;
+    /**
+     * To construct a new CacheableResponse instance you must provide at least
+     * one of the `config` properties.
+     *
+     * If both `statuses` and `headers` are specified, then both conditions must
+     * be met for the `Response` to be considered cacheable.
+     *
+     * @param {Object} config
+     * @param {Array} [config.statuses] One or more status codes that a
+     * `Response` can have and be considered cacheable.
+     * @param {Object} [config.headers] A mapping of header names
+     * and expected values that a `Response` can have and be considered cacheable.
+     * If multiple headers are provided, only one needs to be present.
+     */
+    constructor(config?: CacheableResponseOptions);
+    /**
+     * Checks a response to see whether it's cacheable or not, based on this
+     * object's configuration.
+     *
+     * @param {Response} response The response whose cacheability is being
+     * checked.
+     * @return {boolean} `true` if the `Response` is cacheable, and `false`
+     * otherwise.
+     */
+    isResponseCacheable(response: Response): boolean;
+}
+export { CacheableResponse };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.js b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcc3bfb6a2842b22d3fa42c79cf877d6c608873d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.js
@@ -0,0 +1,119 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import './_version.js';
+/**
+ * This class allows you to set up rules determining what
+ * status codes and/or headers need to be present in order for a
+ * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
+ * to be considered cacheable.
+ *
+ * @memberof workbox-cacheable-response
+ */
+class CacheableResponse {
+    /**
+     * To construct a new CacheableResponse instance you must provide at least
+     * one of the `config` properties.
+     *
+     * If both `statuses` and `headers` are specified, then both conditions must
+     * be met for the `Response` to be considered cacheable.
+     *
+     * @param {Object} config
+     * @param {Array} [config.statuses] One or more status codes that a
+     * `Response` can have and be considered cacheable.
+     * @param {Object} [config.headers] A mapping of header names
+     * and expected values that a `Response` can have and be considered cacheable.
+     * If multiple headers are provided, only one needs to be present.
+     */
+    constructor(config = {}) {
+        if (process.env.NODE_ENV !== 'production') {
+            if (!(config.statuses || config.headers)) {
+                throw new WorkboxError('statuses-or-headers-required', {
+                    moduleName: 'workbox-cacheable-response',
+                    className: 'CacheableResponse',
+                    funcName: 'constructor',
+                });
+            }
+            if (config.statuses) {
+                assert.isArray(config.statuses, {
+                    moduleName: 'workbox-cacheable-response',
+                    className: 'CacheableResponse',
+                    funcName: 'constructor',
+                    paramName: 'config.statuses',
+                });
+            }
+            if (config.headers) {
+                assert.isType(config.headers, 'object', {
+                    moduleName: 'workbox-cacheable-response',
+                    className: 'CacheableResponse',
+                    funcName: 'constructor',
+                    paramName: 'config.headers',
+                });
+            }
+        }
+        this._statuses = config.statuses;
+        this._headers = config.headers;
+    }
+    /**
+     * Checks a response to see whether it's cacheable or not, based on this
+     * object's configuration.
+     *
+     * @param {Response} response The response whose cacheability is being
+     * checked.
+     * @return {boolean} `true` if the `Response` is cacheable, and `false`
+     * otherwise.
+     */
+    isResponseCacheable(response) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(response, Response, {
+                moduleName: 'workbox-cacheable-response',
+                className: 'CacheableResponse',
+                funcName: 'isResponseCacheable',
+                paramName: 'response',
+            });
+        }
+        let cacheable = true;
+        if (this._statuses) {
+            cacheable = this._statuses.includes(response.status);
+        }
+        if (this._headers && cacheable) {
+            cacheable = Object.keys(this._headers).some((headerName) => {
+                return response.headers.get(headerName) === this._headers[headerName];
+            });
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            if (!cacheable) {
+                logger.groupCollapsed(`The request for ` +
+                    `'${getFriendlyURL(response.url)}' returned a response that does ` +
+                    `not meet the criteria for being cached.`);
+                logger.groupCollapsed(`View cacheability criteria here.`);
+                logger.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));
+                logger.log(`Cacheable headers: ` + JSON.stringify(this._headers, null, 2));
+                logger.groupEnd();
+                const logFriendlyHeaders = {};
+                response.headers.forEach((value, key) => {
+                    logFriendlyHeaders[key] = value;
+                });
+                logger.groupCollapsed(`View response status and headers here.`);
+                logger.log(`Response status: ${response.status}`);
+                logger.log(`Response headers: ` + JSON.stringify(logFriendlyHeaders, null, 2));
+                logger.groupEnd();
+                logger.groupCollapsed(`View full response details here.`);
+                logger.log(response.headers);
+                logger.log(response);
+                logger.groupEnd();
+                logger.groupEnd();
+            }
+        }
+        return cacheable;
+    }
+}
+export { CacheableResponse };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.mjs b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..ead6373906fc98b2201ea4b8eb7be62e4623e6d9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponse.mjs
@@ -0,0 +1 @@
+export * from './CacheableResponse.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.d.ts b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5eb998583cee482e936dae9919900906241daa76
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.d.ts
@@ -0,0 +1,36 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import { CacheableResponseOptions } from './CacheableResponse.js';
+import './_version.js';
+/**
+ * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it
+ * easier to add in cacheability checks to requests made via Workbox's built-in
+ * strategies.
+ *
+ * @memberof workbox-cacheable-response
+ */
+declare class CacheableResponsePlugin implements WorkboxPlugin {
+    private readonly _cacheableResponse;
+    /**
+     * To construct a new CacheableResponsePlugin instance you must provide at
+     * least one of the `config` properties.
+     *
+     * If both `statuses` and `headers` are specified, then both conditions must
+     * be met for the `Response` to be considered cacheable.
+     *
+     * @param {Object} config
+     * @param {Array} [config.statuses] One or more status codes that a
+     * `Response` can have and be considered cacheable.
+     * @param {Object} [config.headers] A mapping of header names
+     * and expected values that a `Response` can have and be considered cacheable.
+     * If multiple headers are provided, only one needs to be present.
+     */
+    constructor(config: CacheableResponseOptions);
+    /**
+     * @param {Object} options
+     * @param {Response} options.response
+     * @return {Response|null}
+     * @private
+     */
+    cacheWillUpdate: WorkboxPlugin['cacheWillUpdate'];
+}
+export { CacheableResponsePlugin };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.js b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..695f9fb3c2c9ae8f35c26742901a5a3b86f82aeb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.js
@@ -0,0 +1,48 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { CacheableResponse, } from './CacheableResponse.js';
+import './_version.js';
+/**
+ * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it
+ * easier to add in cacheability checks to requests made via Workbox's built-in
+ * strategies.
+ *
+ * @memberof workbox-cacheable-response
+ */
+class CacheableResponsePlugin {
+    /**
+     * To construct a new CacheableResponsePlugin instance you must provide at
+     * least one of the `config` properties.
+     *
+     * If both `statuses` and `headers` are specified, then both conditions must
+     * be met for the `Response` to be considered cacheable.
+     *
+     * @param {Object} config
+     * @param {Array} [config.statuses] One or more status codes that a
+     * `Response` can have and be considered cacheable.
+     * @param {Object} [config.headers] A mapping of header names
+     * and expected values that a `Response` can have and be considered cacheable.
+     * If multiple headers are provided, only one needs to be present.
+     */
+    constructor(config) {
+        /**
+         * @param {Object} options
+         * @param {Response} options.response
+         * @return {Response|null}
+         * @private
+         */
+        this.cacheWillUpdate = async ({ response }) => {
+            if (this._cacheableResponse.isResponseCacheable(response)) {
+                return response;
+            }
+            return null;
+        };
+        this._cacheableResponse = new CacheableResponse(config);
+    }
+}
+export { CacheableResponsePlugin };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.mjs b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..d2c521840125c45c2ea8d7cdea9a9f0e762b5f6c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/CacheableResponsePlugin.mjs
@@ -0,0 +1 @@
+export * from './CacheableResponsePlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/LICENSE b/tools/ui/node_modules/workbox-cacheable-response/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-cacheable-response/README.md b/tools/ui/node_modules/workbox-cacheable-response/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5a4dbdca7459d095c26fdeff2617579676c80b7f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-cacheable-response
diff --git a/tools/ui/node_modules/workbox-cacheable-response/_version.d.ts b/tools/ui/node_modules/workbox-cacheable-response/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-cacheable-response/_version.js b/tools/ui/node_modules/workbox-cacheable-response/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..9944ea576c398e3c9fa1c52b79feb9e93a923f79
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:cacheable-response:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-cacheable-response/_version.mjs b/tools/ui/node_modules/workbox-cacheable-response/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..c8b0398d8e01d84fa263140b895bed8ada45ab19
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:cacheable-response:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..f2d2f9ff81dbbf4a467ee371cf69ade3bdd81953
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js
@@ -0,0 +1,176 @@
+this.workbox = this.workbox || {};
+this.workbox.cacheableResponse = (function (exports, assert_js, WorkboxError_js, getFriendlyURL_js, logger_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:cacheable-response:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * This class allows you to set up rules determining what
+     * status codes and/or headers need to be present in order for a
+     * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
+     * to be considered cacheable.
+     *
+     * @memberof workbox-cacheable-response
+     */
+    class CacheableResponse {
+      /**
+       * To construct a new CacheableResponse instance you must provide at least
+       * one of the `config` properties.
+       *
+       * If both `statuses` and `headers` are specified, then both conditions must
+       * be met for the `Response` to be considered cacheable.
+       *
+       * @param {Object} config
+       * @param {Array} [config.statuses] One or more status codes that a
+       * `Response` can have and be considered cacheable.
+       * @param {Object} [config.headers] A mapping of header names
+       * and expected values that a `Response` can have and be considered cacheable.
+       * If multiple headers are provided, only one needs to be present.
+       */
+      constructor(config = {}) {
+        {
+          if (!(config.statuses || config.headers)) {
+            throw new WorkboxError_js.WorkboxError('statuses-or-headers-required', {
+              moduleName: 'workbox-cacheable-response',
+              className: 'CacheableResponse',
+              funcName: 'constructor'
+            });
+          }
+          if (config.statuses) {
+            assert_js.assert.isArray(config.statuses, {
+              moduleName: 'workbox-cacheable-response',
+              className: 'CacheableResponse',
+              funcName: 'constructor',
+              paramName: 'config.statuses'
+            });
+          }
+          if (config.headers) {
+            assert_js.assert.isType(config.headers, 'object', {
+              moduleName: 'workbox-cacheable-response',
+              className: 'CacheableResponse',
+              funcName: 'constructor',
+              paramName: 'config.headers'
+            });
+          }
+        }
+        this._statuses = config.statuses;
+        this._headers = config.headers;
+      }
+      /**
+       * Checks a response to see whether it's cacheable or not, based on this
+       * object's configuration.
+       *
+       * @param {Response} response The response whose cacheability is being
+       * checked.
+       * @return {boolean} `true` if the `Response` is cacheable, and `false`
+       * otherwise.
+       */
+      isResponseCacheable(response) {
+        {
+          assert_js.assert.isInstance(response, Response, {
+            moduleName: 'workbox-cacheable-response',
+            className: 'CacheableResponse',
+            funcName: 'isResponseCacheable',
+            paramName: 'response'
+          });
+        }
+        let cacheable = true;
+        if (this._statuses) {
+          cacheable = this._statuses.includes(response.status);
+        }
+        if (this._headers && cacheable) {
+          cacheable = Object.keys(this._headers).some(headerName => {
+            return response.headers.get(headerName) === this._headers[headerName];
+          });
+        }
+        {
+          if (!cacheable) {
+            logger_js.logger.groupCollapsed(`The request for ` + `'${getFriendlyURL_js.getFriendlyURL(response.url)}' returned a response that does ` + `not meet the criteria for being cached.`);
+            logger_js.logger.groupCollapsed(`View cacheability criteria here.`);
+            logger_js.logger.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));
+            logger_js.logger.log(`Cacheable headers: ` + JSON.stringify(this._headers, null, 2));
+            logger_js.logger.groupEnd();
+            const logFriendlyHeaders = {};
+            response.headers.forEach((value, key) => {
+              logFriendlyHeaders[key] = value;
+            });
+            logger_js.logger.groupCollapsed(`View response status and headers here.`);
+            logger_js.logger.log(`Response status: ${response.status}`);
+            logger_js.logger.log(`Response headers: ` + JSON.stringify(logFriendlyHeaders, null, 2));
+            logger_js.logger.groupEnd();
+            logger_js.logger.groupCollapsed(`View full response details here.`);
+            logger_js.logger.log(response.headers);
+            logger_js.logger.log(response);
+            logger_js.logger.groupEnd();
+            logger_js.logger.groupEnd();
+          }
+        }
+        return cacheable;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it
+     * easier to add in cacheability checks to requests made via Workbox's built-in
+     * strategies.
+     *
+     * @memberof workbox-cacheable-response
+     */
+    class CacheableResponsePlugin {
+      /**
+       * To construct a new CacheableResponsePlugin instance you must provide at
+       * least one of the `config` properties.
+       *
+       * If both `statuses` and `headers` are specified, then both conditions must
+       * be met for the `Response` to be considered cacheable.
+       *
+       * @param {Object} config
+       * @param {Array} [config.statuses] One or more status codes that a
+       * `Response` can have and be considered cacheable.
+       * @param {Object} [config.headers] A mapping of header names
+       * and expected values that a `Response` can have and be considered cacheable.
+       * If multiple headers are provided, only one needs to be present.
+       */
+      constructor(config) {
+        /**
+         * @param {Object} options
+         * @param {Response} options.response
+         * @return {Response|null}
+         * @private
+         */
+        this.cacheWillUpdate = async ({
+          response
+        }) => {
+          if (this._cacheableResponse.isResponseCacheable(response)) {
+            return response;
+          }
+          return null;
+        };
+        this._cacheableResponse = new CacheableResponse(config);
+      }
+    }
+
+    exports.CacheableResponse = CacheableResponse;
+    exports.CacheableResponsePlugin = CacheableResponsePlugin;
+
+    return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private);
+//# sourceMappingURL=workbox-cacheable-response.dev.js.map
diff --git a/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js.map b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..7c0b6516eb5f5c031bb8217f93b4195a6ebe76fd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-cacheable-response.dev.js","sources":["../_version.js","../CacheableResponse.js","../CacheableResponsePlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:cacheable-response:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof workbox-cacheable-response\n */\nclass CacheableResponse {\n    /**\n     * To construct a new CacheableResponse instance you must provide at least\n     * one of the `config` properties.\n     *\n     * If both `statuses` and `headers` are specified, then both conditions must\n     * be met for the `Response` to be considered cacheable.\n     *\n     * @param {Object} config\n     * @param {Array} [config.statuses] One or more status codes that a\n     * `Response` can have and be considered cacheable.\n     * @param {Object} [config.headers] A mapping of header names\n     * and expected values that a `Response` can have and be considered cacheable.\n     * If multiple headers are provided, only one needs to be present.\n     */\n    constructor(config = {}) {\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(config.statuses || config.headers)) {\n                throw new WorkboxError('statuses-or-headers-required', {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.statuses) {\n                assert.isArray(config.statuses, {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                    paramName: 'config.statuses',\n                });\n            }\n            if (config.headers) {\n                assert.isType(config.headers, 'object', {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                    paramName: 'config.headers',\n                });\n            }\n        }\n        this._statuses = config.statuses;\n        this._headers = config.headers;\n    }\n    /**\n     * Checks a response to see whether it's cacheable or not, based on this\n     * object's configuration.\n     *\n     * @param {Response} response The response whose cacheability is being\n     * checked.\n     * @return {boolean} `true` if the `Response` is cacheable, and `false`\n     * otherwise.\n     */\n    isResponseCacheable(response) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(response, Response, {\n                moduleName: 'workbox-cacheable-response',\n                className: 'CacheableResponse',\n                funcName: 'isResponseCacheable',\n                paramName: 'response',\n            });\n        }\n        let cacheable = true;\n        if (this._statuses) {\n            cacheable = this._statuses.includes(response.status);\n        }\n        if (this._headers && cacheable) {\n            cacheable = Object.keys(this._headers).some((headerName) => {\n                return response.headers.get(headerName) === this._headers[headerName];\n            });\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (!cacheable) {\n                logger.groupCollapsed(`The request for ` +\n                    `'${getFriendlyURL(response.url)}' returned a response that does ` +\n                    `not meet the criteria for being cached.`);\n                logger.groupCollapsed(`View cacheability criteria here.`);\n                logger.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));\n                logger.log(`Cacheable headers: ` + JSON.stringify(this._headers, null, 2));\n                logger.groupEnd();\n                const logFriendlyHeaders = {};\n                response.headers.forEach((value, key) => {\n                    logFriendlyHeaders[key] = value;\n                });\n                logger.groupCollapsed(`View response status and headers here.`);\n                logger.log(`Response status: ${response.status}`);\n                logger.log(`Response headers: ` + JSON.stringify(logFriendlyHeaders, null, 2));\n                logger.groupEnd();\n                logger.groupCollapsed(`View full response details here.`);\n                logger.log(response.headers);\n                logger.log(response);\n                logger.groupEnd();\n                logger.groupEnd();\n            }\n        }\n        return cacheable;\n    }\n}\nexport { CacheableResponse };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse, } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n    /**\n     * To construct a new CacheableResponsePlugin instance you must provide at\n     * least one of the `config` properties.\n     *\n     * If both `statuses` and `headers` are specified, then both conditions must\n     * be met for the `Response` to be considered cacheable.\n     *\n     * @param {Object} config\n     * @param {Array} [config.statuses] One or more status codes that a\n     * `Response` can have and be considered cacheable.\n     * @param {Object} [config.headers] A mapping of header names\n     * and expected values that a `Response` can have and be considered cacheable.\n     * If multiple headers are provided, only one needs to be present.\n     */\n    constructor(config) {\n        /**\n         * @param {Object} options\n         * @param {Response} options.response\n         * @return {Response|null}\n         * @private\n         */\n        this.cacheWillUpdate = async ({ response }) => {\n            if (this._cacheableResponse.isResponseCacheable(response)) {\n                return response;\n            }\n            return null;\n        };\n        this._cacheableResponse = new CacheableResponse(config);\n    }\n}\nexport { CacheableResponsePlugin };\n"],"names":["self","_","e","CacheableResponse","constructor","config","statuses","headers","WorkboxError","moduleName","className","funcName","assert","isArray","paramName","isType","_statuses","_headers","isResponseCacheable","response","isInstance","Response","cacheable","includes","status","Object","keys","some","headerName","get","logger","groupCollapsed","getFriendlyURL","url","log","JSON","stringify","groupEnd","logFriendlyHeaders","forEach","value","key","CacheableResponsePlugin","cacheWillUpdate","_cacheableResponse"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,kCAAkC,CAAC,IAAIC,CAAC,EAAE;IACnD,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAMA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,iBAAiB,CAAC;IACpB;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACIC,EAAAA,WAAWA,CAACC,MAAM,GAAG,EAAE,EAAE;IACrB,IAA2C;UACvC,IAAI,EAAEA,MAAM,CAACC,QAAQ,IAAID,MAAM,CAACE,OAAO,CAAC,EAAE;IACtC,QAAA,MAAM,IAAIC,4BAAY,CAAC,8BAA8B,EAAE;IACnDC,UAAAA,UAAU,EAAE,4BAA4B;IACxCC,UAAAA,SAAS,EAAE,mBAAmB;IAC9BC,UAAAA,QAAQ,EAAE;IACd,SAAC,CAAC;IACN,MAAA;UACA,IAAIN,MAAM,CAACC,QAAQ,EAAE;IACjBM,QAAAA,gBAAM,CAACC,OAAO,CAACR,MAAM,CAACC,QAAQ,EAAE;IAC5BG,UAAAA,UAAU,EAAE,4BAA4B;IACxC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,gCAAA,CAAiC,CAAC;IACzDD,QAAAA,gBAAM,CAACI,GAAG,CAACf,QAAQ,CAACZ,OAAO,CAAC;IAC5BuB,QAAAA,gBAAM,CAACI,GAAG,CAACf,QAAQ,CAAC;YACpBW,gBAAM,CAACO,QAAQ,EAAE;YACjBP,gBAAM,CAACO,QAAQ,EAAE;IACrB,MAAA;IACJ,IAAA;IACA,IAAA,OAAOf,SAAS;IACpB,EAAA;IACJ;;ICrHA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMoB,uBAAuB,CAAC;IAC1B;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACItC,WAAWA,CAACC,MAAM,EAAE;IAChB;IACR;IACA;IACA;IACA;IACA;QACQ,IAAI,CAACsC,eAAe,GAAG,OAAO;IAAExB,MAAAA;IAAS,KAAC,KAAK;UAC3C,IAAI,IAAI,CAACyB,kBAAkB,CAAC1B,mBAAmB,CAACC,QAAQ,CAAC,EAAE;IACvD,QAAA,OAAOA,QAAQ;IACnB,MAAA;IACA,MAAA,OAAO,IAAI;QACf,CAAC;IACD,IAAA,IAAI,CAACyB,kBAAkB,GAAG,IAAIzC,iBAAiB,CAACE,MAAM,CAAC;IAC3D,EAAA;IACJ;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..7cea515d24c0673498c93e3c4f2c0fe159de6594
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.cacheableResponse=function(s){"use strict";try{self["workbox:cacheable-response:7.4.0"]&&_()}catch(s){}class t{constructor(s={}){this.ss=s.statuses,this.ts=s.headers}isResponseCacheable(s){let t=!0;return this.ss&&(t=this.ss.includes(s.status)),this.ts&&t&&(t=Object.keys(this.ts).some((t=>s.headers.get(t)===this.ts[t]))),t}}return s.CacheableResponse=t,s.CacheableResponsePlugin=class{constructor(s){this.cacheWillUpdate=async({response:s})=>this.hs.isResponseCacheable(s)?s:null,this.hs=new t(s)}},s}({});
+//# sourceMappingURL=workbox-cacheable-response.prod.js.map
diff --git a/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js.map b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..d19f92b807165576a31145a1a4f136b476367b27
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/build/workbox-cacheable-response.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-cacheable-response.prod.js","sources":["../_version.js","../CacheableResponse.js","../CacheableResponsePlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:cacheable-response:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof workbox-cacheable-response\n */\nclass CacheableResponse {\n    /**\n     * To construct a new CacheableResponse instance you must provide at least\n     * one of the `config` properties.\n     *\n     * If both `statuses` and `headers` are specified, then both conditions must\n     * be met for the `Response` to be considered cacheable.\n     *\n     * @param {Object} config\n     * @param {Array} [config.statuses] One or more status codes that a\n     * `Response` can have and be considered cacheable.\n     * @param {Object} [config.headers] A mapping of header names\n     * and expected values that a `Response` can have and be considered cacheable.\n     * If multiple headers are provided, only one needs to be present.\n     */\n    constructor(config = {}) {\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(config.statuses || config.headers)) {\n                throw new WorkboxError('statuses-or-headers-required', {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.statuses) {\n                assert.isArray(config.statuses, {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                    paramName: 'config.statuses',\n                });\n            }\n            if (config.headers) {\n                assert.isType(config.headers, 'object', {\n                    moduleName: 'workbox-cacheable-response',\n                    className: 'CacheableResponse',\n                    funcName: 'constructor',\n                    paramName: 'config.headers',\n                });\n            }\n        }\n        this._statuses = config.statuses;\n        this._headers = config.headers;\n    }\n    /**\n     * Checks a response to see whether it's cacheable or not, based on this\n     * object's configuration.\n     *\n     * @param {Response} response The response whose cacheability is being\n     * checked.\n     * @return {boolean} `true` if the `Response` is cacheable, and `false`\n     * otherwise.\n     */\n    isResponseCacheable(response) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(response, Response, {\n                moduleName: 'workbox-cacheable-response',\n                className: 'CacheableResponse',\n                funcName: 'isResponseCacheable',\n                paramName: 'response',\n            });\n        }\n        let cacheable = true;\n        if (this._statuses) {\n            cacheable = this._statuses.includes(response.status);\n        }\n        if (this._headers && cacheable) {\n            cacheable = Object.keys(this._headers).some((headerName) => {\n                return response.headers.get(headerName) === this._headers[headerName];\n            });\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (!cacheable) {\n                logger.groupCollapsed(`The request for ` +\n                    `'${getFriendlyURL(response.url)}' returned a response that does ` +\n                    `not meet the criteria for being cached.`);\n                logger.groupCollapsed(`View cacheability criteria here.`);\n                logger.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));\n                logger.log(`Cacheable headers: ` + JSON.stringify(this._headers, null, 2));\n                logger.groupEnd();\n                const logFriendlyHeaders = {};\n                response.headers.forEach((value, key) => {\n                    logFriendlyHeaders[key] = value;\n                });\n                logger.groupCollapsed(`View response status and headers here.`);\n                logger.log(`Response status: ${response.status}`);\n                logger.log(`Response headers: ` + JSON.stringify(logFriendlyHeaders, null, 2));\n                logger.groupEnd();\n                logger.groupCollapsed(`View full response details here.`);\n                logger.log(response.headers);\n                logger.log(response);\n                logger.groupEnd();\n                logger.groupEnd();\n            }\n        }\n        return cacheable;\n    }\n}\nexport { CacheableResponse };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse, } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n    /**\n     * To construct a new CacheableResponsePlugin instance you must provide at\n     * least one of the `config` properties.\n     *\n     * If both `statuses` and `headers` are specified, then both conditions must\n     * be met for the `Response` to be considered cacheable.\n     *\n     * @param {Object} config\n     * @param {Array} [config.statuses] One or more status codes that a\n     * `Response` can have and be considered cacheable.\n     * @param {Object} [config.headers] A mapping of header names\n     * and expected values that a `Response` can have and be considered cacheable.\n     * If multiple headers are provided, only one needs to be present.\n     */\n    constructor(config) {\n        /**\n         * @param {Object} options\n         * @param {Response} options.response\n         * @return {Response|null}\n         * @private\n         */\n        this.cacheWillUpdate = async ({ response }) => {\n            if (this._cacheableResponse.isResponseCacheable(response)) {\n                return response;\n            }\n            return null;\n        };\n        this._cacheableResponse = new CacheableResponse(config);\n    }\n}\nexport { CacheableResponsePlugin };\n"],"names":["self","_","e","CacheableResponse","constructor","config","this","_statuses","statuses","_headers","headers","isResponseCacheable","response","cacheable","includes","status","Object","keys","some","headerName","get","cacheWillUpdate","async","_cacheableResponse"],"mappings":"sFAEA,IACIA,KAAK,qCAAuCC,GAChD,CACA,MAAOC,GAAK,CCeZ,MAAMC,EAeFC,YAAYC,EAAS,IA0BjBC,KAAKC,GAAYF,EAAOG,SACxBF,KAAKG,GAAWJ,EAAOK,OAC3B,CAUAC,oBAAoBC,GAShB,IAAIC,GAAY,EAiChB,OAhCIP,KAAKC,KACLM,EAAYP,KAAKC,GAAUO,SAASF,EAASG,SAE7CT,KAAKG,IAAYI,IACjBA,EAAYG,OAAOC,KAAKX,KAAKG,IAAUS,MAAMC,GAClCP,EAASF,QAAQU,IAAID,KAAgBb,KAAKG,GAASU,MA2B3DN,CACX,yDCpGJ,MAeIT,YAAYC,GAORC,KAAKe,gBAAkBC,OAASV,cACxBN,KAAKiB,GAAmBZ,oBAAoBC,GACrCA,EAEJ,KAEXN,KAAKiB,GAAqB,IAAIpB,EAAkBE,EACpD"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/index.d.ts b/tools/ui/node_modules/workbox-cacheable-response/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c8da5b7b6deb02845dd0e9c5f94829742f6eb6d6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/index.d.ts
@@ -0,0 +1,7 @@
+import { CacheableResponse, CacheableResponseOptions } from './CacheableResponse.js';
+import { CacheableResponsePlugin } from './CacheableResponsePlugin.js';
+import './_version.js';
+/**
+ * @module workbox-cacheable-response
+ */
+export { CacheableResponse, CacheableResponseOptions, CacheableResponsePlugin };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/index.js b/tools/ui/node_modules/workbox-cacheable-response/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..67361df1179f20894c68b0a36c5a6ea103054316
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/index.js
@@ -0,0 +1,14 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { CacheableResponse, } from './CacheableResponse.js';
+import { CacheableResponsePlugin } from './CacheableResponsePlugin.js';
+import './_version.js';
+/**
+ * @module workbox-cacheable-response
+ */
+export { CacheableResponse, CacheableResponsePlugin };
diff --git a/tools/ui/node_modules/workbox-cacheable-response/index.mjs b/tools/ui/node_modules/workbox-cacheable-response/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/package.json b/tools/ui/node_modules/workbox-cacheable-response/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e1c4cf39ba6f68d5fde21145e2876fe9df026c7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/package.json
@@ -0,0 +1,31 @@
+{
+  "name": "workbox-cacheable-response",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "This library takes a Response object and determines whether it's cacheable based on a specific configuration.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "workbox-plugin"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.cacheableResponse",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponse.ts b/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponse.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f33cef9319df2f3e29079682132d0d00f5d38ccf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponse.ts
@@ -0,0 +1,150 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import './_version.js';
+
+export interface CacheableResponseOptions {
+  statuses?: number[];
+  headers?: {[headerName: string]: string};
+}
+
+/**
+ * This class allows you to set up rules determining what
+ * status codes and/or headers need to be present in order for a
+ * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
+ * to be considered cacheable.
+ *
+ * @memberof workbox-cacheable-response
+ */
+class CacheableResponse {
+  private readonly _statuses?: CacheableResponseOptions['statuses'];
+  private readonly _headers?: CacheableResponseOptions['headers'];
+
+  /**
+   * To construct a new CacheableResponse instance you must provide at least
+   * one of the `config` properties.
+   *
+   * If both `statuses` and `headers` are specified, then both conditions must
+   * be met for the `Response` to be considered cacheable.
+   *
+   * @param {Object} config
+   * @param {Array} [config.statuses] One or more status codes that a
+   * `Response` can have and be considered cacheable.
+   * @param {Object} [config.headers] A mapping of header names
+   * and expected values that a `Response` can have and be considered cacheable.
+   * If multiple headers are provided, only one needs to be present.
+   */
+  constructor(config: CacheableResponseOptions = {}) {
+    if (process.env.NODE_ENV !== 'production') {
+      if (!(config.statuses || config.headers)) {
+        throw new WorkboxError('statuses-or-headers-required', {
+          moduleName: 'workbox-cacheable-response',
+          className: 'CacheableResponse',
+          funcName: 'constructor',
+        });
+      }
+
+      if (config.statuses) {
+        assert!.isArray(config.statuses, {
+          moduleName: 'workbox-cacheable-response',
+          className: 'CacheableResponse',
+          funcName: 'constructor',
+          paramName: 'config.statuses',
+        });
+      }
+
+      if (config.headers) {
+        assert!.isType(config.headers, 'object', {
+          moduleName: 'workbox-cacheable-response',
+          className: 'CacheableResponse',
+          funcName: 'constructor',
+          paramName: 'config.headers',
+        });
+      }
+    }
+
+    this._statuses = config.statuses;
+    this._headers = config.headers;
+  }
+
+  /**
+   * Checks a response to see whether it's cacheable or not, based on this
+   * object's configuration.
+   *
+   * @param {Response} response The response whose cacheability is being
+   * checked.
+   * @return {boolean} `true` if the `Response` is cacheable, and `false`
+   * otherwise.
+   */
+  isResponseCacheable(response: Response): boolean {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(response, Response, {
+        moduleName: 'workbox-cacheable-response',
+        className: 'CacheableResponse',
+        funcName: 'isResponseCacheable',
+        paramName: 'response',
+      });
+    }
+
+    let cacheable = true;
+
+    if (this._statuses) {
+      cacheable = this._statuses.includes(response.status);
+    }
+
+    if (this._headers && cacheable) {
+      cacheable = Object.keys(this._headers).some((headerName) => {
+        return response.headers.get(headerName) === this._headers![headerName];
+      });
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (!cacheable) {
+        logger.groupCollapsed(
+          `The request for ` +
+            `'${getFriendlyURL(response.url)}' returned a response that does ` +
+            `not meet the criteria for being cached.`,
+        );
+
+        logger.groupCollapsed(`View cacheability criteria here.`);
+        logger.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));
+        logger.log(
+          `Cacheable headers: ` + JSON.stringify(this._headers, null, 2),
+        );
+        logger.groupEnd();
+
+        const logFriendlyHeaders: {[key: string]: string} = {};
+        response.headers.forEach((value, key) => {
+          logFriendlyHeaders[key] = value;
+        });
+
+        logger.groupCollapsed(`View response status and headers here.`);
+        logger.log(`Response status: ${response.status}`);
+        logger.log(
+          `Response headers: ` + JSON.stringify(logFriendlyHeaders, null, 2),
+        );
+        logger.groupEnd();
+
+        logger.groupCollapsed(`View full response details here.`);
+        logger.log(response.headers);
+        logger.log(response);
+        logger.groupEnd();
+
+        logger.groupEnd();
+      }
+    }
+
+    return cacheable;
+  }
+}
+
+export {CacheableResponse};
diff --git a/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponsePlugin.ts b/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponsePlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ea82becda461ead026202f77db29ed1732cb9d68
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/src/CacheableResponsePlugin.ts
@@ -0,0 +1,58 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin} from 'workbox-core/types.js';
+import {
+  CacheableResponse,
+  CacheableResponseOptions,
+} from './CacheableResponse.js';
+import './_version.js';
+
+/**
+ * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it
+ * easier to add in cacheability checks to requests made via Workbox's built-in
+ * strategies.
+ *
+ * @memberof workbox-cacheable-response
+ */
+class CacheableResponsePlugin implements WorkboxPlugin {
+  private readonly _cacheableResponse: CacheableResponse;
+
+  /**
+   * To construct a new CacheableResponsePlugin instance you must provide at
+   * least one of the `config` properties.
+   *
+   * If both `statuses` and `headers` are specified, then both conditions must
+   * be met for the `Response` to be considered cacheable.
+   *
+   * @param {Object} config
+   * @param {Array} [config.statuses] One or more status codes that a
+   * `Response` can have and be considered cacheable.
+   * @param {Object} [config.headers] A mapping of header names
+   * and expected values that a `Response` can have and be considered cacheable.
+   * If multiple headers are provided, only one needs to be present.
+   */
+  constructor(config: CacheableResponseOptions) {
+    this._cacheableResponse = new CacheableResponse(config);
+  }
+
+  /**
+   * @param {Object} options
+   * @param {Response} options.response
+   * @return {Response|null}
+   * @private
+   */
+  cacheWillUpdate: WorkboxPlugin['cacheWillUpdate'] = async ({response}) => {
+    if (this._cacheableResponse.isResponseCacheable(response)) {
+      return response;
+    }
+    return null;
+  };
+}
+
+export {CacheableResponsePlugin};
diff --git a/tools/ui/node_modules/workbox-cacheable-response/src/_version.ts b/tools/ui/node_modules/workbox-cacheable-response/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..91800248682acda1bb4aecaca10ddc8be337444e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:cacheable-response:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-cacheable-response/src/index.ts b/tools/ui/node_modules/workbox-cacheable-response/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..365728ca26f59ad7e124bde1e5658623941e76cb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/src/index.ts
@@ -0,0 +1,21 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {
+  CacheableResponse,
+  CacheableResponseOptions,
+} from './CacheableResponse.js';
+import {CacheableResponsePlugin} from './CacheableResponsePlugin.js';
+
+import './_version.js';
+
+/**
+ * @module workbox-cacheable-response
+ */
+
+export {CacheableResponse, CacheableResponseOptions, CacheableResponsePlugin};
diff --git a/tools/ui/node_modules/workbox-cacheable-response/tsconfig.json b/tools/ui/node_modules/workbox-cacheable-response/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..3bb2772b586c4d0ceee3d014e64dba7aafbdd570
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/tsconfig.json
@@ -0,0 +1,11 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [{"path": "../workbox-core/"}]
+}
diff --git a/tools/ui/node_modules/workbox-cacheable-response/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-cacheable-response/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..68d09380b870b3ef16964790f9e696a097ab680f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-cacheable-response/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/workboxerror.d.ts","../workbox-core/_private/getfriendlyurl.d.ts","../workbox-core/_private/logger.d.ts","./src/_version.ts","./src/cacheableresponse.ts","./src/cacheableresponseplugin.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca","0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5","9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},{"version":"d5cbceab7a16e0618f578c2f8b349d65778489691c44b6417b6f8fcb7452aec4","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"25d77447b2a32efe9c18d51a7e17836bed54c4f945eb11f8ba798ba955a42262","signature":"be3d53a4a6cc2e67e4b4b09c46bffce6282585fe504f77839863c53cb378a47f"},{"version":"f790f41ece2d664de8dc66535e9cddc0b24cd55d170220621f44c7a103db9211","signature":"2effc15909dae21ab67f487a0d6b43193596626cdffb9103eb71078bde44f00a"},{"version":"9aaa64b833bff3a61667e1d3fa99358c80f0c68471aece6066efc32f036b34c9","signature":"669139a1a84ddbc802bdf27094dbf52d647e7ac27fe448f9ea9abee606103f90"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[71,113],[53,71,113],[53,54,55,56,57,71,113],[53,55,71,113],[62,64,71,113],[61,62,63,71,113],[71,113,126,162],[71,113,125,162,164],[71,113,187],[71,113,172],[71,113,176,177,178],[71,113,175],[71,113,177],[71,113,167,173,174,179,182,184,185,186],[71,113,174,180,181,187],[71,113,180,183],[71,113,174,175,180,187],[71,113,174,187],[71,113,168,169,170,171],[71,110,113],[71,112,113],[71,113,118,147],[71,113,114,119,125,126,133,144,155],[71,113,114,115,125,133],[66,67,68,71,113],[71,113,116,156],[71,113,117,118,126,134],[71,113,118,144,152],[71,113,119,121,125,133],[71,112,113,120],[71,113,121,122],[71,113,125],[71,113,123,125],[71,112,113,125],[71,113,125,126,127,144,155],[71,113,125,126,127,140,144,147],[71,108,113,160],[71,113,121,125,128,133,144,155],[71,113,125,126,128,129,133,144,152,155],[71,113,128,130,144,152,155],[71,113,125,131],[71,113,132,155,160],[71,113,121,125,133,144],[71,113,134],[71,113,135],[71,112,113,136],[71,110,111,112,113,114,115,116,117,118,119,120,121,122,123,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161],[71,113,138],[71,113,139],[71,113,125,140,141],[71,113,140,142,156,158],[71,113,125,144,145,147],[71,113,146,147],[71,113,144,145],[71,113,147],[71,113,148],[71,110,113,144],[71,113,125,150,151],[71,113,150,151],[71,113,118,133,144,152],[71,113,153],[113],[69,70,71,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161],[71,113,133,154],[71,113,128,139,155],[71,113,118,156],[71,113,144,157],[71,113,132,158],[71,113,159],[71,113,118,125,127,136,144,155,158,160],[71,113,144,161],[71,113,193,232],[71,113,193,217,232],[71,113,232],[71,113,193],[71,113,193,218,232],[71,113,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231],[71,113,218,232],[71,113,236],[71,113,162,239,240,241,242,243,244,245,246,247,248,249],[71,113,238,239,248],[71,113,239,248],[71,113,233,238,239,248],[71,113,238,239,240,241,242,243,244,245,246,247,249],[71,113,239],[71,113,118,238,248],[71,80,84,113,155],[71,80,113,144,155],[71,75,113],[71,77,80,113,152,155],[71,113,133,152],[71,113,162],[71,75,113,162],[71,77,80,113,133,155],[71,72,73,76,79,113,125,144,155],[71,80,87,113],[71,72,78,113],[71,80,101,102,113],[71,76,80,113,147,155,162],[71,101,113,162],[71,74,75,113,162],[71,80,113],[71,74,75,76,77,78,79,80,81,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,113],[71,80,95,113],[71,80,87,88,113],[71,78,80,88,89,113],[71,79,113],[71,72,75,80,113],[71,80,84,88,89,113],[71,84,113],[71,78,80,83,113,155],[71,72,77,80,87,113],[71,113,144],[71,75,80,101,113,160,162],[45,46,47,48,71,113],[44,50,71,113],[50,51,71,113],[44,71,113],[44,50],[50,51]],"referencedMap":[[42,1],[55,2],[53,1],[58,3],[54,2],[59,1],[56,4],[57,2],[60,1],[65,5],[61,1],[64,6],[62,1],[163,7],[165,8],[166,1],[63,1],[167,1],[188,9],[173,10],[179,11],[177,1],[176,12],[178,13],[187,14],[182,15],[184,16],[185,17],[186,18],[180,1],[181,18],[183,18],[175,18],[174,1],[169,1],[168,1],[171,10],[172,19],[170,10],[164,1],[189,1],[110,20],[111,20],[112,21],[113,22],[114,23],[115,24],[66,1],[69,25],[67,1],[68,1],[116,26],[117,27],[118,28],[119,29],[120,30],[121,31],[122,31],[124,32],[123,33],[125,34],[126,35],[127,36],[109,37],[128,38],[129,39],[130,40],[131,41],[132,42],[133,43],[134,44],[135,45],[136,46],[137,47],[138,48],[139,49],[140,50],[141,50],[142,51],[143,1],[144,52],[146,53],[145,54],[147,55],[148,56],[149,57],[150,58],[151,59],[152,60],[153,61],[71,62],[70,1],[162,63],[154,64],[155,65],[156,66],[157,67],[158,68],[159,69],[160,70],[161,71],[190,1],[191,1],[192,1],[217,72],[218,73],[193,74],[196,74],[215,72],[216,72],[206,72],[205,75],[203,72],[198,72],[211,72],[209,72],[213,72],[197,72],[210,72],[214,72],[199,72],[200,72],[212,72],[194,72],[201,72],[202,72],[204,72],[208,72],[219,76],[207,72],[195,72],[232,77],[231,1],[226,76],[228,78],[227,76],[220,76],[221,76],[223,76],[225,76],[229,78],[230,78],[222,78],[224,78],[233,1],[234,1],[235,1],[237,79],[236,1],[250,80],[249,81],[240,82],[241,83],[248,84],[242,83],[243,82],[244,82],[245,82],[246,85],[239,86],[247,81],[238,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[87,87],[97,88],[86,87],[107,89],[78,90],[77,91],[106,92],[100,93],[105,94],[80,95],[94,96],[79,97],[103,98],[75,99],[74,92],[104,100],[76,101],[81,102],[82,1],[85,102],[72,1],[108,103],[98,104],[89,105],[90,106],[92,107],[88,108],[91,109],[101,92],[83,110],[84,111],[93,112],[73,113],[96,104],[95,102],[99,1],[102,114],[49,1],[50,115],[51,116],[52,117],[45,118],[47,1],[48,1],[46,118],[43,1],[44,1]],"exportedModulesMap":[[42,1],[55,2],[53,1],[58,3],[54,2],[59,1],[56,4],[57,2],[60,1],[65,5],[61,1],[64,6],[62,1],[163,7],[165,8],[166,1],[63,1],[167,1],[188,9],[173,10],[179,11],[177,1],[176,12],[178,13],[187,14],[182,15],[184,16],[185,17],[186,18],[180,1],[181,18],[183,18],[175,18],[174,1],[169,1],[168,1],[171,10],[172,19],[170,10],[164,1],[189,1],[110,20],[111,20],[112,21],[113,22],[114,23],[115,24],[66,1],[69,25],[67,1],[68,1],[116,26],[117,27],[118,28],[119,29],[120,30],[121,31],[122,31],[124,32],[123,33],[125,34],[126,35],[127,36],[109,37],[128,38],[129,39],[130,40],[131,41],[132,42],[133,43],[134,44],[135,45],[136,46],[137,47],[138,48],[139,49],[140,50],[141,50],[142,51],[143,1],[144,52],[146,53],[145,54],[147,55],[148,56],[149,57],[150,58],[151,59],[152,60],[153,61],[71,62],[70,1],[162,63],[154,64],[155,65],[156,66],[157,67],[158,68],[159,69],[160,70],[161,71],[190,1],[191,1],[192,1],[217,72],[218,73],[193,74],[196,74],[215,72],[216,72],[206,72],[205,75],[203,72],[198,72],[211,72],[209,72],[213,72],[197,72],[210,72],[214,72],[199,72],[200,72],[212,72],[194,72],[201,72],[202,72],[204,72],[208,72],[219,76],[207,72],[195,72],[232,77],[231,1],[226,76],[228,78],[227,76],[220,76],[221,76],[223,76],[225,76],[229,78],[230,78],[222,78],[224,78],[233,1],[234,1],[235,1],[237,79],[236,1],[250,80],[249,81],[240,82],[241,83],[248,84],[242,83],[243,82],[244,82],[245,82],[246,85],[239,86],[247,81],[238,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[87,87],[97,88],[86,87],[107,89],[78,90],[77,91],[106,92],[100,93],[105,94],[80,95],[94,96],[79,97],[103,98],[75,99],[74,92],[104,100],[76,101],[81,102],[82,1],[85,102],[72,1],[108,103],[98,104],[89,105],[90,106],[92,107],[88,108],[91,109],[101,92],[83,110],[84,111],[93,112],[73,113],[96,104],[95,102],[99,1],[102,114],[51,119],[52,120],[45,118],[47,1],[48,1],[46,118],[43,1],[44,1]],"semanticDiagnosticsPerFile":[42,55,53,58,54,59,56,57,60,65,61,64,62,163,165,166,63,167,188,173,179,177,176,178,187,182,184,185,186,180,181,183,175,174,169,168,171,172,170,164,189,110,111,112,113,114,115,66,69,67,68,116,117,118,119,120,121,122,124,123,125,126,127,109,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,146,145,147,148,149,150,151,152,153,71,70,162,154,155,156,157,158,159,160,161,190,191,192,217,218,193,196,215,216,206,205,203,198,211,209,213,197,210,214,199,200,212,194,201,202,204,208,219,207,195,232,231,226,228,227,220,221,223,225,229,230,222,224,233,234,235,237,236,250,249,240,241,248,242,243,244,245,246,239,247,238,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,87,97,86,107,78,77,106,100,105,80,94,79,103,75,74,104,76,81,82,85,72,108,98,89,90,92,88,91,101,83,84,93,73,96,95,99,102,49,50,51,52,45,47,48,46,43,44],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/LICENSE b/tools/ui/node_modules/workbox-core/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-core/README.md b/tools/ui/node_modules/workbox-core/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..0cd4cfea663e20a6758e920241fd505b9a5ee53e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-core
diff --git a/tools/ui/node_modules/workbox-core/_private.d.ts b/tools/ui/node_modules/workbox-core/_private.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bd2cf9a1d2a89400fe9afe184444c0bd54c038f5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private.d.ts
@@ -0,0 +1,16 @@
+import { assert } from './_private/assert.js';
+import { cacheNames } from './_private/cacheNames.js';
+import { cacheMatchIgnoreParams } from './_private/cacheMatchIgnoreParams.js';
+import { canConstructReadableStream } from './_private/canConstructReadableStream.js';
+import { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';
+import { dontWaitFor } from './_private/dontWaitFor.js';
+import { Deferred } from './_private/Deferred.js';
+import { executeQuotaErrorCallbacks } from './_private/executeQuotaErrorCallbacks.js';
+import { getFriendlyURL } from './_private/getFriendlyURL.js';
+import { logger } from './_private/logger.js';
+import { resultingClientExists } from './_private/resultingClientExists.js';
+import { timeout } from './_private/timeout.js';
+import { waitUntil } from './_private/waitUntil.js';
+import { WorkboxError } from './_private/WorkboxError.js';
+import './_version.js';
+export { assert, cacheMatchIgnoreParams, cacheNames, canConstructReadableStream, canConstructResponseFromBodyStream, dontWaitFor, Deferred, executeQuotaErrorCallbacks, getFriendlyURL, logger, resultingClientExists, timeout, waitUntil, WorkboxError, };
diff --git a/tools/ui/node_modules/workbox-core/_private.js b/tools/ui/node_modules/workbox-core/_private.js
new file mode 100644
index 0000000000000000000000000000000000000000..10d62445f3d599c527a558449d012bc7dfe22348
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private.js
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+// We either expose defaults or we expose every named export.
+import { assert } from './_private/assert.js';
+import { cacheNames } from './_private/cacheNames.js';
+import { cacheMatchIgnoreParams } from './_private/cacheMatchIgnoreParams.js';
+import { canConstructReadableStream } from './_private/canConstructReadableStream.js';
+import { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';
+import { dontWaitFor } from './_private/dontWaitFor.js';
+import { Deferred } from './_private/Deferred.js';
+import { executeQuotaErrorCallbacks } from './_private/executeQuotaErrorCallbacks.js';
+import { getFriendlyURL } from './_private/getFriendlyURL.js';
+import { logger } from './_private/logger.js';
+import { resultingClientExists } from './_private/resultingClientExists.js';
+import { timeout } from './_private/timeout.js';
+import { waitUntil } from './_private/waitUntil.js';
+import { WorkboxError } from './_private/WorkboxError.js';
+import './_version.js';
+export { assert, cacheMatchIgnoreParams, cacheNames, canConstructReadableStream, canConstructResponseFromBodyStream, dontWaitFor, Deferred, executeQuotaErrorCallbacks, getFriendlyURL, logger, resultingClientExists, timeout, waitUntil, WorkboxError, };
diff --git a/tools/ui/node_modules/workbox-core/_private.mjs b/tools/ui/node_modules/workbox-core/_private.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..0d186c40b69a5ad0a321a84391bd49bf1062defc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private.mjs
@@ -0,0 +1 @@
+export * from './_private.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/Deferred.d.ts b/tools/ui/node_modules/workbox-core/_private/Deferred.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..eef1ce6af53c06803ff44a3beac982189d87dfa5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/Deferred.d.ts
@@ -0,0 +1,19 @@
+import '../_version.js';
+/**
+ * The Deferred class composes Promises in a way that allows for them to be
+ * resolved or rejected from outside the constructor. In most cases promises
+ * should be used directly, but Deferreds can be necessary when the logic to
+ * resolve a promise must be separate.
+ *
+ * @private
+ */
+declare class Deferred {
+    promise: Promise;
+    resolve: (value: T) => void;
+    reject: (reason?: any) => void;
+    /**
+     * Creates a promise and exposes its resolve and reject functions as methods.
+     */
+    constructor();
+}
+export { Deferred };
diff --git a/tools/ui/node_modules/workbox-core/_private/Deferred.js b/tools/ui/node_modules/workbox-core/_private/Deferred.js
new file mode 100644
index 0000000000000000000000000000000000000000..5d7a61ccf01fa4331cbcc7acbbad157b70a3046a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/Deferred.js
@@ -0,0 +1,28 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * The Deferred class composes Promises in a way that allows for them to be
+ * resolved or rejected from outside the constructor. In most cases promises
+ * should be used directly, but Deferreds can be necessary when the logic to
+ * resolve a promise must be separate.
+ *
+ * @private
+ */
+class Deferred {
+    /**
+     * Creates a promise and exposes its resolve and reject functions as methods.
+     */
+    constructor() {
+        this.promise = new Promise((resolve, reject) => {
+            this.resolve = resolve;
+            this.reject = reject;
+        });
+    }
+}
+export { Deferred };
diff --git a/tools/ui/node_modules/workbox-core/_private/Deferred.mjs b/tools/ui/node_modules/workbox-core/_private/Deferred.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..d9339cc2c3b5fd5cc0db68ef69cdbea34454d664
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/Deferred.mjs
@@ -0,0 +1 @@
+export * from './Deferred.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/WorkboxError.d.ts b/tools/ui/node_modules/workbox-core/_private/WorkboxError.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c94eac7c0bdc412eb51b958bfd865eab20b3c0dd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/WorkboxError.d.ts
@@ -0,0 +1,24 @@
+import { MapLikeObject } from '../types.js';
+import '../_version.js';
+/**
+ * Workbox errors should be thrown with this class.
+ * This allows use to ensure the type easily in tests,
+ * helps developers identify errors from workbox
+ * easily and allows use to optimise error
+ * messages correctly.
+ *
+ * @private
+ */
+declare class WorkboxError extends Error {
+    details?: MapLikeObject;
+    /**
+     *
+     * @param {string} errorCode The error code that
+     * identifies this particular error.
+     * @param {Object=} details Any relevant arguments
+     * that will help developers identify issues should
+     * be added as a key on the context object.
+     */
+    constructor(errorCode: string, details?: MapLikeObject);
+}
+export { WorkboxError };
diff --git a/tools/ui/node_modules/workbox-core/_private/WorkboxError.js b/tools/ui/node_modules/workbox-core/_private/WorkboxError.js
new file mode 100644
index 0000000000000000000000000000000000000000..be8257e3734accd21c7616c18d2f5416c692abc3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/WorkboxError.js
@@ -0,0 +1,35 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { messageGenerator } from '../models/messages/messageGenerator.js';
+import '../_version.js';
+/**
+ * Workbox errors should be thrown with this class.
+ * This allows use to ensure the type easily in tests,
+ * helps developers identify errors from workbox
+ * easily and allows use to optimise error
+ * messages correctly.
+ *
+ * @private
+ */
+class WorkboxError extends Error {
+    /**
+     *
+     * @param {string} errorCode The error code that
+     * identifies this particular error.
+     * @param {Object=} details Any relevant arguments
+     * that will help developers identify issues should
+     * be added as a key on the context object.
+     */
+    constructor(errorCode, details) {
+        const message = messageGenerator(errorCode, details);
+        super(message);
+        this.name = errorCode;
+        this.details = details;
+    }
+}
+export { WorkboxError };
diff --git a/tools/ui/node_modules/workbox-core/_private/WorkboxError.mjs b/tools/ui/node_modules/workbox-core/_private/WorkboxError.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..a138ba46bbaab1b827df64b5815f1de0c1b095a2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/WorkboxError.mjs
@@ -0,0 +1 @@
+export * from './WorkboxError.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/assert.d.ts b/tools/ui/node_modules/workbox-core/_private/assert.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c15247ac39de46b620a713b35defb4945daa5c20
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/assert.d.ts
@@ -0,0 +1,11 @@
+import { MapLikeObject } from '../types.js';
+import '../_version.js';
+declare const finalAssertExports: {
+    hasMethod: (object: MapLikeObject, expectedMethod: string, details: MapLikeObject) => void;
+    isArray: (value: any[], details: MapLikeObject) => void;
+    isInstance: (object: unknown, expectedClass: Function, details: MapLikeObject) => void;
+    isOneOf: (value: any, validValues: any[], details: MapLikeObject) => void;
+    isType: (object: unknown, expectedType: string, details: MapLikeObject) => void;
+    isArrayOfClass: (value: any, expectedClass: Function, details: MapLikeObject) => void;
+} | null;
+export { finalAssertExports as assert };
diff --git a/tools/ui/node_modules/workbox-core/_private/assert.js b/tools/ui/node_modules/workbox-core/_private/assert.js
new file mode 100644
index 0000000000000000000000000000000000000000..117b135273e2049bc6ef1e864f4d193866b90fb0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/assert.js
@@ -0,0 +1,73 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { WorkboxError } from '../_private/WorkboxError.js';
+import '../_version.js';
+/*
+ * This method throws if the supplied value is not an array.
+ * The destructed values are required to produce a meaningful error for users.
+ * The destructed and restructured object is so it's clear what is
+ * needed.
+ */
+const isArray = (value, details) => {
+    if (!Array.isArray(value)) {
+        throw new WorkboxError('not-an-array', details);
+    }
+};
+const hasMethod = (object, expectedMethod, details) => {
+    const type = typeof object[expectedMethod];
+    if (type !== 'function') {
+        details['expectedMethod'] = expectedMethod;
+        throw new WorkboxError('missing-a-method', details);
+    }
+};
+const isType = (object, expectedType, details) => {
+    if (typeof object !== expectedType) {
+        details['expectedType'] = expectedType;
+        throw new WorkboxError('incorrect-type', details);
+    }
+};
+const isInstance = (object, 
+// Need the general type to do the check later.
+// eslint-disable-next-line @typescript-eslint/ban-types
+expectedClass, details) => {
+    if (!(object instanceof expectedClass)) {
+        details['expectedClassName'] = expectedClass.name;
+        throw new WorkboxError('incorrect-class', details);
+    }
+};
+const isOneOf = (value, validValues, details) => {
+    if (!validValues.includes(value)) {
+        details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`;
+        throw new WorkboxError('invalid-value', details);
+    }
+};
+const isArrayOfClass = (value, 
+// Need general type to do check later.
+expectedClass, // eslint-disable-line
+details) => {
+    const error = new WorkboxError('not-array-of-class', details);
+    if (!Array.isArray(value)) {
+        throw error;
+    }
+    for (const item of value) {
+        if (!(item instanceof expectedClass)) {
+            throw error;
+        }
+    }
+};
+const finalAssertExports = process.env.NODE_ENV === 'production'
+    ? null
+    : {
+        hasMethod,
+        isArray,
+        isInstance,
+        isOneOf,
+        isType,
+        isArrayOfClass,
+    };
+export { finalAssertExports as assert };
diff --git a/tools/ui/node_modules/workbox-core/_private/assert.mjs b/tools/ui/node_modules/workbox-core/_private/assert.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..8be2e15998aa40225a0fc7776333163d5b62fbe2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/assert.mjs
@@ -0,0 +1 @@
+export * from './assert.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.d.ts b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5ccd85d68b03c2420963cac16cf8ddd0fa8f1d79
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.d.ts
@@ -0,0 +1,15 @@
+import '../_version.js';
+/**
+ * Matches an item in the cache, ignoring specific URL params. This is similar
+ * to the `ignoreSearch` option, but it allows you to ignore just specific
+ * params (while continuing to match on the others).
+ *
+ * @private
+ * @param {Cache} cache
+ * @param {Request} request
+ * @param {Object} matchOptions
+ * @param {Array} ignoreParams
+ * @return {Promise}
+ */
+declare function cacheMatchIgnoreParams(cache: Cache, request: Request, ignoreParams: string[], matchOptions?: CacheQueryOptions): Promise;
+export { cacheMatchIgnoreParams };
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js
new file mode 100644
index 0000000000000000000000000000000000000000..1aabbb9073c204e27c43cf2a3b7808879b42f9d6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js
@@ -0,0 +1,44 @@
+/*
+  Copyright 2020 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+function stripParams(fullURL, ignoreParams) {
+    const strippedURL = new URL(fullURL);
+    for (const param of ignoreParams) {
+        strippedURL.searchParams.delete(param);
+    }
+    return strippedURL.href;
+}
+/**
+ * Matches an item in the cache, ignoring specific URL params. This is similar
+ * to the `ignoreSearch` option, but it allows you to ignore just specific
+ * params (while continuing to match on the others).
+ *
+ * @private
+ * @param {Cache} cache
+ * @param {Request} request
+ * @param {Object} matchOptions
+ * @param {Array} ignoreParams
+ * @return {Promise}
+ */
+async function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {
+    const strippedRequestURL = stripParams(request.url, ignoreParams);
+    // If the request doesn't include any ignored params, match as normal.
+    if (request.url === strippedRequestURL) {
+        return cache.match(request, matchOptions);
+    }
+    // Otherwise, match by comparing keys
+    const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });
+    const cacheKeys = await cache.keys(request, keysOptions);
+    for (const cacheKey of cacheKeys) {
+        const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
+        if (strippedRequestURL === strippedCacheKeyURL) {
+            return cache.match(cacheKey, matchOptions);
+        }
+    }
+    return;
+}
+export { cacheMatchIgnoreParams };
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.mjs b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..cc981efbb7059ef58d57c7a856c1da80f322cc6b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheMatchIgnoreParams.mjs
@@ -0,0 +1 @@
+export * from './cacheMatchIgnoreParams.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheNames.d.ts b/tools/ui/node_modules/workbox-core/_private/cacheNames.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..414308e31b40bd1699159419f8d0f145a18de6af
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheNames.d.ts
@@ -0,0 +1,20 @@
+import '../_version.js';
+export interface CacheNameDetails {
+    googleAnalytics: string;
+    precache: string;
+    prefix: string;
+    runtime: string;
+    suffix: string;
+}
+export interface PartialCacheNameDetails {
+    [propName: string]: string;
+}
+export type CacheNameDetailsProp = 'googleAnalytics' | 'precache' | 'prefix' | 'runtime' | 'suffix';
+export declare const cacheNames: {
+    updateDetails: (details: PartialCacheNameDetails) => void;
+    getGoogleAnalyticsName: (userCacheName?: string) => string;
+    getPrecacheName: (userCacheName?: string) => string;
+    getPrefix: () => string;
+    getRuntimeName: (userCacheName?: string) => string;
+    getSuffix: () => string;
+};
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheNames.js b/tools/ui/node_modules/workbox-core/_private/cacheNames.js
new file mode 100644
index 0000000000000000000000000000000000000000..76124b17b4c6a663331e57b73687869dfc35cbcb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheNames.js
@@ -0,0 +1,49 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+const _cacheNameDetails = {
+    googleAnalytics: 'googleAnalytics',
+    precache: 'precache-v2',
+    prefix: 'workbox',
+    runtime: 'runtime',
+    suffix: typeof registration !== 'undefined' ? registration.scope : '',
+};
+const _createCacheName = (cacheName) => {
+    return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]
+        .filter((value) => value && value.length > 0)
+        .join('-');
+};
+const eachCacheNameDetail = (fn) => {
+    for (const key of Object.keys(_cacheNameDetails)) {
+        fn(key);
+    }
+};
+export const cacheNames = {
+    updateDetails: (details) => {
+        eachCacheNameDetail((key) => {
+            if (typeof details[key] === 'string') {
+                _cacheNameDetails[key] = details[key];
+            }
+        });
+    },
+    getGoogleAnalyticsName: (userCacheName) => {
+        return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
+    },
+    getPrecacheName: (userCacheName) => {
+        return userCacheName || _createCacheName(_cacheNameDetails.precache);
+    },
+    getPrefix: () => {
+        return _cacheNameDetails.prefix;
+    },
+    getRuntimeName: (userCacheName) => {
+        return userCacheName || _createCacheName(_cacheNameDetails.runtime);
+    },
+    getSuffix: () => {
+        return _cacheNameDetails.suffix;
+    },
+};
diff --git a/tools/ui/node_modules/workbox-core/_private/cacheNames.mjs b/tools/ui/node_modules/workbox-core/_private/cacheNames.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..2a299372164250b06c59b7f4a227ec39793abfa2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/cacheNames.mjs
@@ -0,0 +1 @@
+export * from './cacheNames.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.d.ts b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..da18a82a73b5bdb3f49743a3828c1feb83836e27
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.d.ts
@@ -0,0 +1,13 @@
+import '../_version.js';
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
+ * object.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `ReadableStream`, `false` otherwise.
+ *
+ * @private
+ */
+declare function canConstructReadableStream(): boolean;
+export { canConstructReadableStream };
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.js b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.js
new file mode 100644
index 0000000000000000000000000000000000000000..7fc3e06305a615891eca2eda50b935ae3f4f46fc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.js
@@ -0,0 +1,33 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+let supportStatus;
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
+ * object.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `ReadableStream`, `false` otherwise.
+ *
+ * @private
+ */
+function canConstructReadableStream() {
+    if (supportStatus === undefined) {
+        // See https://github.com/GoogleChrome/workbox/issues/1473
+        try {
+            new ReadableStream({ start() { } });
+            supportStatus = true;
+        }
+        catch (error) {
+            supportStatus = false;
+        }
+    }
+    return supportStatus;
+}
+export { canConstructReadableStream };
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.mjs b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..317ede690ce65ed3c780ff6ad326db29cc3dc3d7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructReadableStream.mjs
@@ -0,0 +1 @@
+export * from './canConstructReadableStream.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.d.ts b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2cf6f849dd7bd881b24771fbec5a460c6f9f5e06
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.d.ts
@@ -0,0 +1,12 @@
+import '../_version.js';
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a new `Response` from a `response.body` stream.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `Response` from a `response.body` stream, `false` otherwise.
+ *
+ * @private
+ */
+declare function canConstructResponseFromBodyStream(): boolean;
+export { canConstructResponseFromBodyStream };
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js
new file mode 100644
index 0000000000000000000000000000000000000000..d48d436f1207447b369ec372ea5e58b03388ab2f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js
@@ -0,0 +1,35 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+let supportStatus;
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a new `Response` from a `response.body` stream.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `Response` from a `response.body` stream, `false` otherwise.
+ *
+ * @private
+ */
+function canConstructResponseFromBodyStream() {
+    if (supportStatus === undefined) {
+        const testResponse = new Response('');
+        if ('body' in testResponse) {
+            try {
+                new Response(testResponse.body);
+                supportStatus = true;
+            }
+            catch (error) {
+                supportStatus = false;
+            }
+        }
+        supportStatus = false;
+    }
+    return supportStatus;
+}
+export { canConstructResponseFromBodyStream };
diff --git a/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.mjs b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..5022eb686066b6c92330c04278352b5ccbb0fa84
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.mjs
@@ -0,0 +1 @@
+export * from './canConstructResponseFromBodyStream.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/dontWaitFor.d.ts b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07e784836f95a5988cf70e54601b802b49942934
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.d.ts
@@ -0,0 +1,7 @@
+import '../_version.js';
+/**
+ * A helper function that prevents a promise from being flagged as unused.
+ *
+ * @private
+ **/
+export declare function dontWaitFor(promise: Promise): void;
diff --git a/tools/ui/node_modules/workbox-core/_private/dontWaitFor.js b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.js
new file mode 100644
index 0000000000000000000000000000000000000000..98ad7b602b27229d307c391546adfec88acee416
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.js
@@ -0,0 +1,16 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * A helper function that prevents a promise from being flagged as unused.
+ *
+ * @private
+ **/
+export function dontWaitFor(promise) {
+    // Effective no-op.
+    void promise.then(() => { });
+}
diff --git a/tools/ui/node_modules/workbox-core/_private/dontWaitFor.mjs b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..cc94c4d31739ca4a4c81054db41c48eb2d046cc8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/dontWaitFor.mjs
@@ -0,0 +1 @@
+export * from './dontWaitFor.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.d.ts b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..15aa4d59423624dc38e67febcc61dd3f19162ee2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.d.ts
@@ -0,0 +1,10 @@
+import '../_version.js';
+/**
+ * Runs all of the callback functions, one at a time sequentially, in the order
+ * in which they were registered.
+ *
+ * @memberof workbox-core
+ * @private
+ */
+declare function executeQuotaErrorCallbacks(): Promise;
+export { executeQuotaErrorCallbacks };
diff --git a/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec783c70a0af7dc4f05e3def090637e4ee6e4dc3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js
@@ -0,0 +1,33 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from '../_private/logger.js';
+import { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';
+import '../_version.js';
+/**
+ * Runs all of the callback functions, one at a time sequentially, in the order
+ * in which they were registered.
+ *
+ * @memberof workbox-core
+ * @private
+ */
+async function executeQuotaErrorCallbacks() {
+    if (process.env.NODE_ENV !== 'production') {
+        logger.log(`About to run ${quotaErrorCallbacks.size} ` +
+            `callbacks to clean up caches.`);
+    }
+    for (const callback of quotaErrorCallbacks) {
+        await callback();
+        if (process.env.NODE_ENV !== 'production') {
+            logger.log(callback, 'is complete.');
+        }
+    }
+    if (process.env.NODE_ENV !== 'production') {
+        logger.log('Finished running callbacks.');
+    }
+}
+export { executeQuotaErrorCallbacks };
diff --git a/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.mjs b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..9cfadb415aba0446bc4d106928eaaef266f2834e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.mjs
@@ -0,0 +1 @@
+export * from './executeQuotaErrorCallbacks.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.d.ts b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..acfb844d0339ee1261c1612a0ea2d2c44ef6fdef
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.d.ts
@@ -0,0 +1,3 @@
+import '../_version.js';
+declare const getFriendlyURL: (url: URL | string) => string;
+export { getFriendlyURL };
diff --git a/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.js b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7cbe44a966413520c152905c722511215683786
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.js
@@ -0,0 +1,15 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+const getFriendlyURL = (url) => {
+    const urlObj = new URL(String(url), location.href);
+    // See https://github.com/GoogleChrome/workbox/issues/2323
+    // We want to include everything, except for the origin if it's same-origin.
+    return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
+};
+export { getFriendlyURL };
diff --git a/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.mjs b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..aa37fe86f016625d3a31cf46c3b9b01c081b8e92
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/getFriendlyURL.mjs
@@ -0,0 +1 @@
+export * from './getFriendlyURL.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/logger.d.ts b/tools/ui/node_modules/workbox-core/_private/logger.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..41fb738d5fe2760be11729177bfbe1fd55d959cf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/logger.d.ts
@@ -0,0 +1,11 @@
+import '../_version.js';
+declare global {
+    interface WorkerGlobalScope {
+        __WB_DISABLE_DEV_LOGS: boolean;
+    }
+    interface Window {
+        __WB_DISABLE_DEV_LOGS: boolean;
+    }
+}
+declare const logger: Console;
+export { logger };
diff --git a/tools/ui/node_modules/workbox-core/_private/logger.js b/tools/ui/node_modules/workbox-core/_private/logger.js
new file mode 100644
index 0000000000000000000000000000000000000000..05876ff67194cf1e16992bad31d7c6eb48f6e499
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/logger.js
@@ -0,0 +1,65 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+const logger = (process.env.NODE_ENV === 'production'
+    ? null
+    : (() => {
+        // Don't overwrite this value if it's already set.
+        // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
+        if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {
+            self.__WB_DISABLE_DEV_LOGS = false;
+        }
+        let inGroup = false;
+        const methodToColorMap = {
+            debug: `#7f8c8d`,
+            log: `#2ecc71`,
+            warn: `#f39c12`,
+            error: `#c0392b`,
+            groupCollapsed: `#3498db`,
+            groupEnd: null, // No colored prefix on groupEnd
+        };
+        const print = function (method, args) {
+            if (self.__WB_DISABLE_DEV_LOGS) {
+                return;
+            }
+            if (method === 'groupCollapsed') {
+                // Safari doesn't print all console.groupCollapsed() arguments:
+                // https://bugs.webkit.org/show_bug.cgi?id=182754
+                if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
+                    console[method](...args);
+                    return;
+                }
+            }
+            const styles = [
+                `background: ${methodToColorMap[method]}`,
+                `border-radius: 0.5em`,
+                `color: white`,
+                `font-weight: bold`,
+                `padding: 2px 0.5em`,
+            ];
+            // When in a group, the workbox prefix is not displayed.
+            const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];
+            console[method](...logPrefix, ...args);
+            if (method === 'groupCollapsed') {
+                inGroup = true;
+            }
+            if (method === 'groupEnd') {
+                inGroup = false;
+            }
+        };
+        // eslint-disable-next-line @typescript-eslint/ban-types
+        const api = {};
+        const loggerMethods = Object.keys(methodToColorMap);
+        for (const key of loggerMethods) {
+            const method = key;
+            api[method] = (...args) => {
+                print(method, args);
+            };
+        }
+        return api;
+    })());
+export { logger };
diff --git a/tools/ui/node_modules/workbox-core/_private/logger.mjs b/tools/ui/node_modules/workbox-core/_private/logger.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..826d1a6c0f89e2408a23fdb6556701b313ec54f2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/logger.mjs
@@ -0,0 +1 @@
+export * from './logger.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/resultingClientExists.d.ts b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e0e092189799cdc1229c1b02b9efea986038fa09
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.d.ts
@@ -0,0 +1,12 @@
+import '../_version.js';
+/**
+ * Returns a promise that resolves to a window client matching the passed
+ * `resultingClientId`. For browsers that don't support `resultingClientId`
+ * or if waiting for the resulting client to apper takes too long, resolve to
+ * `undefined`.
+ *
+ * @param {string} [resultingClientId]
+ * @return {Promise}
+ * @private
+ */
+export declare function resultingClientExists(resultingClientId?: string): Promise;
diff --git a/tools/ui/node_modules/workbox-core/_private/resultingClientExists.js b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.js
new file mode 100644
index 0000000000000000000000000000000000000000..334627860deffe9be87e5127901001bde11eec91
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.js
@@ -0,0 +1,48 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { timeout } from './timeout.js';
+import '../_version.js';
+const MAX_RETRY_TIME = 2000;
+/**
+ * Returns a promise that resolves to a window client matching the passed
+ * `resultingClientId`. For browsers that don't support `resultingClientId`
+ * or if waiting for the resulting client to apper takes too long, resolve to
+ * `undefined`.
+ *
+ * @param {string} [resultingClientId]
+ * @return {Promise}
+ * @private
+ */
+export async function resultingClientExists(resultingClientId) {
+    if (!resultingClientId) {
+        return;
+    }
+    let existingWindows = await self.clients.matchAll({ type: 'window' });
+    const existingWindowIds = new Set(existingWindows.map((w) => w.id));
+    let resultingWindow;
+    const startTime = performance.now();
+    // Only wait up to `MAX_RETRY_TIME` to find a matching client.
+    while (performance.now() - startTime < MAX_RETRY_TIME) {
+        existingWindows = await self.clients.matchAll({ type: 'window' });
+        resultingWindow = existingWindows.find((w) => {
+            if (resultingClientId) {
+                // If we have a `resultingClientId`, we can match on that.
+                return w.id === resultingClientId;
+            }
+            else {
+                // Otherwise match on finding a window not in `existingWindowIds`.
+                return !existingWindowIds.has(w.id);
+            }
+        });
+        if (resultingWindow) {
+            break;
+        }
+        // Sleep for 100ms and retry.
+        await timeout(100);
+    }
+    return resultingWindow;
+}
diff --git a/tools/ui/node_modules/workbox-core/_private/resultingClientExists.mjs b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..9276bae7028d841de2ababbf977c8a905fac85d6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/resultingClientExists.mjs
@@ -0,0 +1 @@
+export * from './resultingClientExists.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/timeout.d.ts b/tools/ui/node_modules/workbox-core/_private/timeout.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1497ca18cd084556bec0ea5f4c6651680ceff2dd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/timeout.d.ts
@@ -0,0 +1,10 @@
+import '../_version.js';
+/**
+ * Returns a promise that resolves and the passed number of milliseconds.
+ * This utility is an async/await-friendly version of `setTimeout`.
+ *
+ * @param {number} ms
+ * @return {Promise}
+ * @private
+ */
+export declare function timeout(ms: number): Promise;
diff --git a/tools/ui/node_modules/workbox-core/_private/timeout.js b/tools/ui/node_modules/workbox-core/_private/timeout.js
new file mode 100644
index 0000000000000000000000000000000000000000..640c52b8fb466645a9cbf44313d2c62fa0c9754e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/timeout.js
@@ -0,0 +1,18 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * Returns a promise that resolves and the passed number of milliseconds.
+ * This utility is an async/await-friendly version of `setTimeout`.
+ *
+ * @param {number} ms
+ * @return {Promise}
+ * @private
+ */
+export function timeout(ms) {
+    return new Promise((resolve) => setTimeout(resolve, ms));
+}
diff --git a/tools/ui/node_modules/workbox-core/_private/timeout.mjs b/tools/ui/node_modules/workbox-core/_private/timeout.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..88473c41349a56736911af70a8f9573d44e0ce6b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/timeout.mjs
@@ -0,0 +1 @@
+export * from './timeout.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_private/waitUntil.d.ts b/tools/ui/node_modules/workbox-core/_private/waitUntil.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..44acfa476ff01f74764c21c9d79887f51398cc5e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/waitUntil.d.ts
@@ -0,0 +1,12 @@
+import '../_version.js';
+/**
+ * A utility method that makes it easier to use `event.waitUntil` with
+ * async functions and return the result.
+ *
+ * @param {ExtendableEvent} event
+ * @param {Function} asyncFn
+ * @return {Function}
+ * @private
+ */
+declare function waitUntil(event: ExtendableEvent, asyncFn: () => Promise): Promise;
+export { waitUntil };
diff --git a/tools/ui/node_modules/workbox-core/_private/waitUntil.js b/tools/ui/node_modules/workbox-core/_private/waitUntil.js
new file mode 100644
index 0000000000000000000000000000000000000000..80d1df19a8c0e9c7a389973b63dae462a5870e87
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/waitUntil.js
@@ -0,0 +1,22 @@
+/*
+  Copyright 2020 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * A utility method that makes it easier to use `event.waitUntil` with
+ * async functions and return the result.
+ *
+ * @param {ExtendableEvent} event
+ * @param {Function} asyncFn
+ * @return {Function}
+ * @private
+ */
+function waitUntil(event, asyncFn) {
+    const returnPromise = asyncFn();
+    event.waitUntil(returnPromise);
+    return returnPromise;
+}
+export { waitUntil };
diff --git a/tools/ui/node_modules/workbox-core/_private/waitUntil.mjs b/tools/ui/node_modules/workbox-core/_private/waitUntil.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..53dadf2ad25a4b845826ba2311152121d2ecf960
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_private/waitUntil.mjs
@@ -0,0 +1 @@
+export * from './waitUntil.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/_version.d.ts b/tools/ui/node_modules/workbox-core/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-core/_version.js b/tools/ui/node_modules/workbox-core/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..1776910e36ff94fba9166edbfd04734fc6389c4f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:core:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-core/_version.mjs b/tools/ui/node_modules/workbox-core/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..431f82592459b7c77eafbc35830c87c77d746fa6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:core:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js b/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8a79aa016da21c20a7c4f8a99dfc2eb8c72dc9e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js
@@ -0,0 +1,1060 @@
+this.workbox = this.workbox || {};
+this.workbox.core = (function (exports) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:core:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2019 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const logger = (() => {
+      // Don't overwrite this value if it's already set.
+      // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
+      if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {
+        self.__WB_DISABLE_DEV_LOGS = false;
+      }
+      let inGroup = false;
+      const methodToColorMap = {
+        debug: `#7f8c8d`,
+        log: `#2ecc71`,
+        warn: `#f39c12`,
+        error: `#c0392b`,
+        groupCollapsed: `#3498db`,
+        groupEnd: null // No colored prefix on groupEnd
+      };
+      const print = function (method, args) {
+        if (self.__WB_DISABLE_DEV_LOGS) {
+          return;
+        }
+        if (method === 'groupCollapsed') {
+          // Safari doesn't print all console.groupCollapsed() arguments:
+          // https://bugs.webkit.org/show_bug.cgi?id=182754
+          if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
+            console[method](...args);
+            return;
+          }
+        }
+        const styles = [`background: ${methodToColorMap[method]}`, `border-radius: 0.5em`, `color: white`, `font-weight: bold`, `padding: 2px 0.5em`];
+        // When in a group, the workbox prefix is not displayed.
+        const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];
+        console[method](...logPrefix, ...args);
+        if (method === 'groupCollapsed') {
+          inGroup = true;
+        }
+        if (method === 'groupEnd') {
+          inGroup = false;
+        }
+      };
+      // eslint-disable-next-line @typescript-eslint/ban-types
+      const api = {};
+      const loggerMethods = Object.keys(methodToColorMap);
+      for (const key of loggerMethods) {
+        const method = key;
+        api[method] = (...args) => {
+          print(method, args);
+        };
+      }
+      return api;
+    })();
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const messages = {
+      'invalid-value': ({
+        paramName,
+        validValueDescription,
+        value
+      }) => {
+        if (!paramName || !validValueDescription) {
+          throw new Error(`Unexpected input to 'invalid-value' error.`);
+        }
+        return `The '${paramName}' parameter was given a value with an ` + `unexpected value. ${validValueDescription} Received a value of ` + `${JSON.stringify(value)}.`;
+      },
+      'not-an-array': ({
+        moduleName,
+        className,
+        funcName,
+        paramName
+      }) => {
+        if (!moduleName || !className || !funcName || !paramName) {
+          throw new Error(`Unexpected input to 'not-an-array' error.`);
+        }
+        return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className}.${funcName}()' must be an array.`;
+      },
+      'incorrect-type': ({
+        expectedType,
+        paramName,
+        moduleName,
+        className,
+        funcName
+      }) => {
+        if (!expectedType || !paramName || !moduleName || !funcName) {
+          throw new Error(`Unexpected input to 'incorrect-type' error.`);
+        }
+        const classNameStr = className ? `${className}.` : '';
+        return `The parameter '${paramName}' passed into ` + `'${moduleName}.${classNameStr}` + `${funcName}()' must be of type ${expectedType}.`;
+      },
+      'incorrect-class': ({
+        expectedClassName,
+        paramName,
+        moduleName,
+        className,
+        funcName,
+        isReturnValueProblem
+      }) => {
+        if (!expectedClassName || !moduleName || !funcName) {
+          throw new Error(`Unexpected input to 'incorrect-class' error.`);
+        }
+        const classNameStr = className ? `${className}.` : '';
+        if (isReturnValueProblem) {
+          return `The return value from ` + `'${moduleName}.${classNameStr}${funcName}()' ` + `must be an instance of class ${expectedClassName}.`;
+        }
+        return `The parameter '${paramName}' passed into ` + `'${moduleName}.${classNameStr}${funcName}()' ` + `must be an instance of class ${expectedClassName}.`;
+      },
+      'missing-a-method': ({
+        expectedMethod,
+        paramName,
+        moduleName,
+        className,
+        funcName
+      }) => {
+        if (!expectedMethod || !paramName || !moduleName || !className || !funcName) {
+          throw new Error(`Unexpected input to 'missing-a-method' error.`);
+        }
+        return `${moduleName}.${className}.${funcName}() expected the ` + `'${paramName}' parameter to expose a '${expectedMethod}' method.`;
+      },
+      'add-to-cache-list-unexpected-type': ({
+        entry
+      }) => {
+        return `An unexpected entry was passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` + `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` + `strings with one or more characters, objects with a url property or ` + `Request objects.`;
+      },
+      'add-to-cache-list-conflicting-entries': ({
+        firstEntry,
+        secondEntry
+      }) => {
+        if (!firstEntry || !secondEntry) {
+          throw new Error(`Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`);
+        }
+        return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${firstEntry} but different revision details. Workbox is ` + `unable to cache and version the asset correctly. Please remove one ` + `of the entries.`;
+      },
+      'plugin-error-request-will-fetch': ({
+        thrownErrorMessage
+      }) => {
+        if (!thrownErrorMessage) {
+          throw new Error(`Unexpected input to ` + `'plugin-error-request-will-fetch', error.`);
+        }
+        return `An error was thrown by a plugins 'requestWillFetch()' method. ` + `The thrown error message was: '${thrownErrorMessage}'.`;
+      },
+      'invalid-cache-name': ({
+        cacheNameId,
+        value
+      }) => {
+        if (!cacheNameId) {
+          throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);
+        }
+        return `You must provide a name containing at least one character for ` + `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` + `'${JSON.stringify(value)}'`;
+      },
+      'unregister-route-but-not-found-with-method': ({
+        method
+      }) => {
+        if (!method) {
+          throw new Error(`Unexpected input to ` + `'unregister-route-but-not-found-with-method' error.`);
+        }
+        return `The route you're trying to unregister was not  previously ` + `registered for the method type '${method}'.`;
+      },
+      'unregister-route-route-not-registered': () => {
+        return `The route you're trying to unregister was not previously ` + `registered.`;
+      },
+      'queue-replay-failed': ({
+        name
+      }) => {
+        return `Replaying the background sync queue '${name}' failed.`;
+      },
+      'duplicate-queue-name': ({
+        name
+      }) => {
+        return `The Queue name '${name}' is already being used. ` + `All instances of backgroundSync.Queue must be given unique names.`;
+      },
+      'expired-test-without-max-age': ({
+        methodName,
+        paramName
+      }) => {
+        return `The '${methodName}()' method can only be used when the ` + `'${paramName}' is used in the constructor.`;
+      },
+      'unsupported-route-type': ({
+        moduleName,
+        className,
+        funcName,
+        paramName
+      }) => {
+        return `The supplied '${paramName}' parameter was an unsupported type. ` + `Please check the docs for ${moduleName}.${className}.${funcName} for ` + `valid input types.`;
+      },
+      'not-array-of-class': ({
+        value,
+        expectedClass,
+        moduleName,
+        className,
+        funcName,
+        paramName
+      }) => {
+        return `The supplied '${paramName}' parameter must be an array of ` + `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` + `Please check the call to ${moduleName}.${className}.${funcName}() ` + `to fix the issue.`;
+      },
+      'max-entries-or-age-required': ({
+        moduleName,
+        className,
+        funcName
+      }) => {
+        return `You must define either config.maxEntries or config.maxAgeSeconds` + `in ${moduleName}.${className}.${funcName}`;
+      },
+      'statuses-or-headers-required': ({
+        moduleName,
+        className,
+        funcName
+      }) => {
+        return `You must define either config.statuses or config.headers` + `in ${moduleName}.${className}.${funcName}`;
+      },
+      'invalid-string': ({
+        moduleName,
+        funcName,
+        paramName
+      }) => {
+        if (!paramName || !moduleName || !funcName) {
+          throw new Error(`Unexpected input to 'invalid-string' error.`);
+        }
+        return `When using strings, the '${paramName}' parameter must start with ` + `'http' (for cross-origin matches) or '/' (for same-origin matches). ` + `Please see the docs for ${moduleName}.${funcName}() for ` + `more info.`;
+      },
+      'channel-name-required': () => {
+        return `You must provide a channelName to construct a ` + `BroadcastCacheUpdate instance.`;
+      },
+      'invalid-responses-are-same-args': () => {
+        return `The arguments passed into responsesAreSame() appear to be ` + `invalid. Please ensure valid Responses are used.`;
+      },
+      'expire-custom-caches-only': () => {
+        return `You must provide a 'cacheName' property when using the ` + `expiration plugin with a runtime caching strategy.`;
+      },
+      'unit-must-be-bytes': ({
+        normalizedRangeHeader
+      }) => {
+        if (!normalizedRangeHeader) {
+          throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);
+        }
+        return `The 'unit' portion of the Range header must be set to 'bytes'. ` + `The Range header provided was "${normalizedRangeHeader}"`;
+      },
+      'single-range-only': ({
+        normalizedRangeHeader
+      }) => {
+        if (!normalizedRangeHeader) {
+          throw new Error(`Unexpected input to 'single-range-only' error.`);
+        }
+        return `Multiple ranges are not supported. Please use a  single start ` + `value, and optional end value. The Range header provided was ` + `"${normalizedRangeHeader}"`;
+      },
+      'invalid-range-values': ({
+        normalizedRangeHeader
+      }) => {
+        if (!normalizedRangeHeader) {
+          throw new Error(`Unexpected input to 'invalid-range-values' error.`);
+        }
+        return `The Range header is missing both start and end values. At least ` + `one of those values is needed. The Range header provided was ` + `"${normalizedRangeHeader}"`;
+      },
+      'no-range-header': () => {
+        return `No Range header was found in the Request provided.`;
+      },
+      'range-not-satisfiable': ({
+        size,
+        start,
+        end
+      }) => {
+        return `The start (${start}) and end (${end}) values in the Range are ` + `not satisfiable by the cached response, which is ${size} bytes.`;
+      },
+      'attempt-to-cache-non-get-request': ({
+        url,
+        method
+      }) => {
+        return `Unable to cache '${url}' because it is a '${method}' request and ` + `only 'GET' requests can be cached.`;
+      },
+      'cache-put-with-no-response': ({
+        url
+      }) => {
+        return `There was an attempt to cache '${url}' but the response was not ` + `defined.`;
+      },
+      'no-response': ({
+        url,
+        error
+      }) => {
+        let message = `The strategy could not generate a response for '${url}'.`;
+        if (error) {
+          message += ` The underlying error is ${error}.`;
+        }
+        return message;
+      },
+      'bad-precaching-response': ({
+        url,
+        status
+      }) => {
+        return `The precaching request for '${url}' failed` + (status ? ` with an HTTP status of ${status}.` : `.`);
+      },
+      'non-precached-url': ({
+        url
+      }) => {
+        return `createHandlerBoundToURL('${url}') was called, but that URL is ` + `not precached. Please pass in a URL that is precached instead.`;
+      },
+      'add-to-cache-list-conflicting-integrities': ({
+        url
+      }) => {
+        return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${url} with different integrity values. Please remove one of them.`;
+      },
+      'missing-precache-entry': ({
+        cacheName,
+        url
+      }) => {
+        return `Unable to find a precached response in ${cacheName} for ${url}.`;
+      },
+      'cross-origin-copy-response': ({
+        origin
+      }) => {
+        return `workbox-core.copyResponse() can only be used with same-origin ` + `responses. It was passed a response with origin ${origin}.`;
+      },
+      'opaque-streams-source': ({
+        type
+      }) => {
+        const message = `One of the workbox-streams sources resulted in an ` + `'${type}' response.`;
+        if (type === 'opaqueredirect') {
+          return `${message} Please do not use a navigation request that results ` + `in a redirect as a source.`;
+        }
+        return `${message} Please ensure your sources are CORS-enabled.`;
+      }
+    };
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const generatorFunction = (code, details = {}) => {
+      const message = messages[code];
+      if (!message) {
+        throw new Error(`Unable to find message for code '${code}'.`);
+      }
+      return message(details);
+    };
+    const messageGenerator = generatorFunction;
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Workbox errors should be thrown with this class.
+     * This allows use to ensure the type easily in tests,
+     * helps developers identify errors from workbox
+     * easily and allows use to optimise error
+     * messages correctly.
+     *
+     * @private
+     */
+    class WorkboxError extends Error {
+      /**
+       *
+       * @param {string} errorCode The error code that
+       * identifies this particular error.
+       * @param {Object=} details Any relevant arguments
+       * that will help developers identify issues should
+       * be added as a key on the context object.
+       */
+      constructor(errorCode, details) {
+        const message = messageGenerator(errorCode, details);
+        super(message);
+        this.name = errorCode;
+        this.details = details;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /*
+     * This method throws if the supplied value is not an array.
+     * The destructed values are required to produce a meaningful error for users.
+     * The destructed and restructured object is so it's clear what is
+     * needed.
+     */
+    const isArray = (value, details) => {
+      if (!Array.isArray(value)) {
+        throw new WorkboxError('not-an-array', details);
+      }
+    };
+    const hasMethod = (object, expectedMethod, details) => {
+      const type = typeof object[expectedMethod];
+      if (type !== 'function') {
+        details['expectedMethod'] = expectedMethod;
+        throw new WorkboxError('missing-a-method', details);
+      }
+    };
+    const isType = (object, expectedType, details) => {
+      if (typeof object !== expectedType) {
+        details['expectedType'] = expectedType;
+        throw new WorkboxError('incorrect-type', details);
+      }
+    };
+    const isInstance = (object,
+    // Need the general type to do the check later.
+    // eslint-disable-next-line @typescript-eslint/ban-types
+    expectedClass, details) => {
+      if (!(object instanceof expectedClass)) {
+        details['expectedClassName'] = expectedClass.name;
+        throw new WorkboxError('incorrect-class', details);
+      }
+    };
+    const isOneOf = (value, validValues, details) => {
+      if (!validValues.includes(value)) {
+        details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`;
+        throw new WorkboxError('invalid-value', details);
+      }
+    };
+    const isArrayOfClass = (value,
+    // Need general type to do check later.
+    expectedClass,
+    // eslint-disable-line
+    details) => {
+      const error = new WorkboxError('not-array-of-class', details);
+      if (!Array.isArray(value)) {
+        throw error;
+      }
+      for (const item of value) {
+        if (!(item instanceof expectedClass)) {
+          throw error;
+        }
+      }
+    };
+    const finalAssertExports = {
+      hasMethod,
+      isArray,
+      isInstance,
+      isOneOf,
+      isType,
+      isArrayOfClass
+    };
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    // Callbacks to be executed whenever there's a quota error.
+    // Can't change Function type right now.
+    // eslint-disable-next-line @typescript-eslint/ban-types
+    const quotaErrorCallbacks = new Set();
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Adds a function to the set of quotaErrorCallbacks that will be executed if
+     * there's a quota error.
+     *
+     * @param {Function} callback
+     * @memberof workbox-core
+     */
+    // Can't change Function type
+    // eslint-disable-next-line @typescript-eslint/ban-types
+    function registerQuotaErrorCallback(callback) {
+      {
+        finalAssertExports.isType(callback, 'function', {
+          moduleName: 'workbox-core',
+          funcName: 'register',
+          paramName: 'callback'
+        });
+      }
+      quotaErrorCallbacks.add(callback);
+      {
+        logger.log('Registered a callback to respond to quota errors.', callback);
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const _cacheNameDetails = {
+      googleAnalytics: 'googleAnalytics',
+      precache: 'precache-v2',
+      prefix: 'workbox',
+      runtime: 'runtime',
+      suffix: typeof registration !== 'undefined' ? registration.scope : ''
+    };
+    const _createCacheName = cacheName => {
+      return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix].filter(value => value && value.length > 0).join('-');
+    };
+    const eachCacheNameDetail = fn => {
+      for (const key of Object.keys(_cacheNameDetails)) {
+        fn(key);
+      }
+    };
+    const cacheNames$1 = {
+      updateDetails: details => {
+        eachCacheNameDetail(key => {
+          if (typeof details[key] === 'string') {
+            _cacheNameDetails[key] = details[key];
+          }
+        });
+      },
+      getGoogleAnalyticsName: userCacheName => {
+        return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
+      },
+      getPrecacheName: userCacheName => {
+        return userCacheName || _createCacheName(_cacheNameDetails.precache);
+      },
+      getPrefix: () => {
+        return _cacheNameDetails.prefix;
+      },
+      getRuntimeName: userCacheName => {
+        return userCacheName || _createCacheName(_cacheNameDetails.runtime);
+      },
+      getSuffix: () => {
+        return _cacheNameDetails.suffix;
+      }
+    };
+
+    /*
+      Copyright 2020 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    function stripParams(fullURL, ignoreParams) {
+      const strippedURL = new URL(fullURL);
+      for (const param of ignoreParams) {
+        strippedURL.searchParams.delete(param);
+      }
+      return strippedURL.href;
+    }
+    /**
+     * Matches an item in the cache, ignoring specific URL params. This is similar
+     * to the `ignoreSearch` option, but it allows you to ignore just specific
+     * params (while continuing to match on the others).
+     *
+     * @private
+     * @param {Cache} cache
+     * @param {Request} request
+     * @param {Object} matchOptions
+     * @param {Array} ignoreParams
+     * @return {Promise}
+     */
+    async function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {
+      const strippedRequestURL = stripParams(request.url, ignoreParams);
+      // If the request doesn't include any ignored params, match as normal.
+      if (request.url === strippedRequestURL) {
+        return cache.match(request, matchOptions);
+      }
+      // Otherwise, match by comparing keys
+      const keysOptions = Object.assign(Object.assign({}, matchOptions), {
+        ignoreSearch: true
+      });
+      const cacheKeys = await cache.keys(request, keysOptions);
+      for (const cacheKey of cacheKeys) {
+        const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
+        if (strippedRequestURL === strippedCacheKeyURL) {
+          return cache.match(cacheKey, matchOptions);
+        }
+      }
+      return;
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    let supportStatus$1;
+    /**
+     * A utility function that determines whether the current browser supports
+     * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
+     * object.
+     *
+     * @return {boolean} `true`, if the current browser can successfully
+     *     construct a `ReadableStream`, `false` otherwise.
+     *
+     * @private
+     */
+    function canConstructReadableStream() {
+      if (supportStatus$1 === undefined) {
+        // See https://github.com/GoogleChrome/workbox/issues/1473
+        try {
+          new ReadableStream({
+            start() {}
+          });
+          supportStatus$1 = true;
+        } catch (error) {
+          supportStatus$1 = false;
+        }
+      }
+      return supportStatus$1;
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    let supportStatus;
+    /**
+     * A utility function that determines whether the current browser supports
+     * constructing a new `Response` from a `response.body` stream.
+     *
+     * @return {boolean} `true`, if the current browser can successfully
+     *     construct a `Response` from a `response.body` stream, `false` otherwise.
+     *
+     * @private
+     */
+    function canConstructResponseFromBodyStream() {
+      if (supportStatus === undefined) {
+        const testResponse = new Response('');
+        if ('body' in testResponse) {
+          try {
+            new Response(testResponse.body);
+            supportStatus = true;
+          } catch (error) {
+            supportStatus = false;
+          }
+        }
+        supportStatus = false;
+      }
+      return supportStatus;
+    }
+
+    /*
+      Copyright 2019 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A helper function that prevents a promise from being flagged as unused.
+     *
+     * @private
+     **/
+    function dontWaitFor(promise) {
+      // Effective no-op.
+      void promise.then(() => {});
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * The Deferred class composes Promises in a way that allows for them to be
+     * resolved or rejected from outside the constructor. In most cases promises
+     * should be used directly, but Deferreds can be necessary when the logic to
+     * resolve a promise must be separate.
+     *
+     * @private
+     */
+    class Deferred {
+      /**
+       * Creates a promise and exposes its resolve and reject functions as methods.
+       */
+      constructor() {
+        this.promise = new Promise((resolve, reject) => {
+          this.resolve = resolve;
+          this.reject = reject;
+        });
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Runs all of the callback functions, one at a time sequentially, in the order
+     * in which they were registered.
+     *
+     * @memberof workbox-core
+     * @private
+     */
+    async function executeQuotaErrorCallbacks() {
+      {
+        logger.log(`About to run ${quotaErrorCallbacks.size} ` + `callbacks to clean up caches.`);
+      }
+      for (const callback of quotaErrorCallbacks) {
+        await callback();
+        {
+          logger.log(callback, 'is complete.');
+        }
+      }
+      {
+        logger.log('Finished running callbacks.');
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const getFriendlyURL = url => {
+      const urlObj = new URL(String(url), location.href);
+      // See https://github.com/GoogleChrome/workbox/issues/2323
+      // We want to include everything, except for the origin if it's same-origin.
+      return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
+    };
+
+    /*
+      Copyright 2019 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Returns a promise that resolves and the passed number of milliseconds.
+     * This utility is an async/await-friendly version of `setTimeout`.
+     *
+     * @param {number} ms
+     * @return {Promise}
+     * @private
+     */
+    function timeout(ms) {
+      return new Promise(resolve => setTimeout(resolve, ms));
+    }
+
+    /*
+      Copyright 2019 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const MAX_RETRY_TIME = 2000;
+    /**
+     * Returns a promise that resolves to a window client matching the passed
+     * `resultingClientId`. For browsers that don't support `resultingClientId`
+     * or if waiting for the resulting client to apper takes too long, resolve to
+     * `undefined`.
+     *
+     * @param {string} [resultingClientId]
+     * @return {Promise}
+     * @private
+     */
+    async function resultingClientExists(resultingClientId) {
+      if (!resultingClientId) {
+        return;
+      }
+      let existingWindows = await self.clients.matchAll({
+        type: 'window'
+      });
+      const existingWindowIds = new Set(existingWindows.map(w => w.id));
+      let resultingWindow;
+      const startTime = performance.now();
+      // Only wait up to `MAX_RETRY_TIME` to find a matching client.
+      while (performance.now() - startTime < MAX_RETRY_TIME) {
+        existingWindows = await self.clients.matchAll({
+          type: 'window'
+        });
+        resultingWindow = existingWindows.find(w => {
+          if (resultingClientId) {
+            // If we have a `resultingClientId`, we can match on that.
+            return w.id === resultingClientId;
+          } else {
+            // Otherwise match on finding a window not in `existingWindowIds`.
+            return !existingWindowIds.has(w.id);
+          }
+        });
+        if (resultingWindow) {
+          break;
+        }
+        // Sleep for 100ms and retry.
+        await timeout(100);
+      }
+      return resultingWindow;
+    }
+
+    /*
+      Copyright 2020 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A utility method that makes it easier to use `event.waitUntil` with
+     * async functions and return the result.
+     *
+     * @param {ExtendableEvent} event
+     * @param {Function} asyncFn
+     * @return {Function}
+     * @private
+     */
+    function waitUntil(event, asyncFn) {
+      const returnPromise = asyncFn();
+      event.waitUntil(returnPromise);
+      return returnPromise;
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    // We either expose defaults or we expose every named export.
+
+    var _private = /*#__PURE__*/Object.freeze({
+        __proto__: null,
+        Deferred: Deferred,
+        WorkboxError: WorkboxError,
+        assert: finalAssertExports,
+        cacheMatchIgnoreParams: cacheMatchIgnoreParams,
+        cacheNames: cacheNames$1,
+        canConstructReadableStream: canConstructReadableStream,
+        canConstructResponseFromBodyStream: canConstructResponseFromBodyStream,
+        dontWaitFor: dontWaitFor,
+        executeQuotaErrorCallbacks: executeQuotaErrorCallbacks,
+        getFriendlyURL: getFriendlyURL,
+        logger: logger,
+        resultingClientExists: resultingClientExists,
+        timeout: timeout,
+        waitUntil: waitUntil
+    });
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Get the current cache names and prefix/suffix used by Workbox.
+     *
+     * `cacheNames.precache` is used for precached assets,
+     * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to
+     * store `analytics.js`, and `cacheNames.runtime` is used for everything else.
+     *
+     * `cacheNames.prefix` can be used to retrieve just the current prefix value.
+     * `cacheNames.suffix` can be used to retrieve just the current suffix value.
+     *
+     * @return {Object} An object with `precache`, `runtime`, `prefix`, and
+     *     `googleAnalytics` properties.
+     *
+     * @memberof workbox-core
+     */
+    const cacheNames = {
+      get googleAnalytics() {
+        return cacheNames$1.getGoogleAnalyticsName();
+      },
+      get precache() {
+        return cacheNames$1.getPrecacheName();
+      },
+      get prefix() {
+        return cacheNames$1.getPrefix();
+      },
+      get runtime() {
+        return cacheNames$1.getRuntimeName();
+      },
+      get suffix() {
+        return cacheNames$1.getSuffix();
+      }
+    };
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Allows developers to copy a response and modify its `headers`, `status`,
+     * or `statusText` values (the values settable via a
+     * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
+     * object in the constructor).
+     * To modify these values, pass a function as the second argument. That
+     * function will be invoked with a single object with the response properties
+     * `{headers, status, statusText}`. The return value of this function will
+     * be used as the `ResponseInit` for the new `Response`. To change the values
+     * either modify the passed parameter(s) and return it, or return a totally
+     * new object.
+     *
+     * This method is intentionally limited to same-origin responses, regardless of
+     * whether CORS was used or not.
+     *
+     * @param {Response} response
+     * @param {Function} modifier
+     * @memberof workbox-core
+     */
+    async function copyResponse(response, modifier) {
+      let origin = null;
+      // If response.url isn't set, assume it's cross-origin and keep origin null.
+      if (response.url) {
+        const responseURL = new URL(response.url);
+        origin = responseURL.origin;
+      }
+      if (origin !== self.location.origin) {
+        throw new WorkboxError('cross-origin-copy-response', {
+          origin
+        });
+      }
+      const clonedResponse = response.clone();
+      // Create a fresh `ResponseInit` object by cloning the headers.
+      const responseInit = {
+        headers: new Headers(clonedResponse.headers),
+        status: clonedResponse.status,
+        statusText: clonedResponse.statusText
+      };
+      // Apply any user modifications.
+      const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;
+      // Create the new response from the body stream and `ResponseInit`
+      // modifications. Note: not all browsers support the Response.body stream,
+      // so fall back to reading the entire body into memory as a blob.
+      const body = canConstructResponseFromBodyStream() ? clonedResponse.body : await clonedResponse.blob();
+      return new Response(body, modifiedResponseInit);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Claim any currently available clients once the service worker
+     * becomes active. This is normally used in conjunction with `skipWaiting()`.
+     *
+     * @memberof workbox-core
+     */
+    function clientsClaim() {
+      self.addEventListener('activate', () => self.clients.claim());
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Modifies the default cache names used by the Workbox packages.
+     * Cache names are generated as `--`.
+     *
+     * @param {Object} details
+     * @param {Object} [details.prefix] The string to add to the beginning of
+     *     the precache and runtime cache names.
+     * @param {Object} [details.suffix] The string to add to the end of
+     *     the precache and runtime cache names.
+     * @param {Object} [details.precache] The cache name to use for precache
+     *     caching.
+     * @param {Object} [details.runtime] The cache name to use for runtime caching.
+     * @param {Object} [details.googleAnalytics] The cache name to use for
+     *     `workbox-google-analytics` caching.
+     *
+     * @memberof workbox-core
+     */
+    function setCacheNameDetails(details) {
+      {
+        Object.keys(details).forEach(key => {
+          finalAssertExports.isType(details[key], 'string', {
+            moduleName: 'workbox-core',
+            funcName: 'setCacheNameDetails',
+            paramName: `details.${key}`
+          });
+        });
+        if ('precache' in details && details['precache'].length === 0) {
+          throw new WorkboxError('invalid-cache-name', {
+            cacheNameId: 'precache',
+            value: details['precache']
+          });
+        }
+        if ('runtime' in details && details['runtime'].length === 0) {
+          throw new WorkboxError('invalid-cache-name', {
+            cacheNameId: 'runtime',
+            value: details['runtime']
+          });
+        }
+        if ('googleAnalytics' in details && details['googleAnalytics'].length === 0) {
+          throw new WorkboxError('invalid-cache-name', {
+            cacheNameId: 'googleAnalytics',
+            value: details['googleAnalytics']
+          });
+        }
+      }
+      cacheNames$1.updateDetails(details);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * This method is deprecated, and will be removed in Workbox v7.
+     *
+     * Calling self.skipWaiting() is equivalent, and should be used instead.
+     *
+     * @memberof workbox-core
+     */
+    function skipWaiting() {
+      // Just call self.skipWaiting() directly.
+      // See https://github.com/GoogleChrome/workbox/issues/2525
+      {
+        logger.warn(`skipWaiting() from workbox-core is no longer recommended ` + `and will be removed in Workbox v7. Using self.skipWaiting() instead ` + `is equivalent.`);
+      }
+      void self.skipWaiting();
+    }
+
+    exports._private = _private;
+    exports.cacheNames = cacheNames;
+    exports.clientsClaim = clientsClaim;
+    exports.copyResponse = copyResponse;
+    exports.registerQuotaErrorCallback = registerQuotaErrorCallback;
+    exports.setCacheNameDetails = setCacheNameDetails;
+    exports.skipWaiting = skipWaiting;
+
+    return exports;
+
+})({});
+//# sourceMappingURL=workbox-core.dev.js.map
diff --git a/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js.map b/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..697b2601e045d6a5a03abd486c698a70b8d7b109
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/build/workbox-core.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-core.dev.js","sources":["../_version.js","../_private/logger.js","../models/messages/messages.js","../models/messages/messageGenerator.js","../_private/WorkboxError.js","../_private/assert.js","../models/quotaErrorCallbacks.js","../registerQuotaErrorCallback.js","../_private/cacheNames.js","../_private/cacheMatchIgnoreParams.js","../_private/canConstructReadableStream.js","../_private/canConstructResponseFromBodyStream.js","../_private/dontWaitFor.js","../_private/Deferred.js","../_private/executeQuotaErrorCallbacks.js","../_private/getFriendlyURL.js","../_private/timeout.js","../_private/resultingClientExists.js","../_private/waitUntil.js","../_private.js","../cacheNames.js","../copyResponse.js","../clientsClaim.js","../setCacheNameDetails.js","../skipWaiting.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:core:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n    ? null\n    : (() => {\n        // Don't overwrite this value if it's already set.\n        // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n        if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {\n            self.__WB_DISABLE_DEV_LOGS = false;\n        }\n        let inGroup = false;\n        const methodToColorMap = {\n            debug: `#7f8c8d`,\n            log: `#2ecc71`,\n            warn: `#f39c12`,\n            error: `#c0392b`,\n            groupCollapsed: `#3498db`,\n            groupEnd: null, // No colored prefix on groupEnd\n        };\n        const print = function (method, args) {\n            if (self.__WB_DISABLE_DEV_LOGS) {\n                return;\n            }\n            if (method === 'groupCollapsed') {\n                // Safari doesn't print all console.groupCollapsed() arguments:\n                // https://bugs.webkit.org/show_bug.cgi?id=182754\n                if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n                    console[method](...args);\n                    return;\n                }\n            }\n            const styles = [\n                `background: ${methodToColorMap[method]}`,\n                `border-radius: 0.5em`,\n                `color: white`,\n                `font-weight: bold`,\n                `padding: 2px 0.5em`,\n            ];\n            // When in a group, the workbox prefix is not displayed.\n            const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n            console[method](...logPrefix, ...args);\n            if (method === 'groupCollapsed') {\n                inGroup = true;\n            }\n            if (method === 'groupEnd') {\n                inGroup = false;\n            }\n        };\n        // eslint-disable-next-line @typescript-eslint/ban-types\n        const api = {};\n        const loggerMethods = Object.keys(methodToColorMap);\n        for (const key of loggerMethods) {\n            const method = key;\n            api[method] = (...args) => {\n                print(method, args);\n            };\n        }\n        return api;\n    })());\nexport { logger };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../../_version.js';\nexport const messages = {\n    'invalid-value': ({ paramName, validValueDescription, value }) => {\n        if (!paramName || !validValueDescription) {\n            throw new Error(`Unexpected input to 'invalid-value' error.`);\n        }\n        return (`The '${paramName}' parameter was given a value with an ` +\n            `unexpected value. ${validValueDescription} Received a value of ` +\n            `${JSON.stringify(value)}.`);\n    },\n    'not-an-array': ({ moduleName, className, funcName, paramName }) => {\n        if (!moduleName || !className || !funcName || !paramName) {\n            throw new Error(`Unexpected input to 'not-an-array' error.`);\n        }\n        return (`The parameter '${paramName}' passed into ` +\n            `'${moduleName}.${className}.${funcName}()' must be an array.`);\n    },\n    'incorrect-type': ({ expectedType, paramName, moduleName, className, funcName, }) => {\n        if (!expectedType || !paramName || !moduleName || !funcName) {\n            throw new Error(`Unexpected input to 'incorrect-type' error.`);\n        }\n        const classNameStr = className ? `${className}.` : '';\n        return (`The parameter '${paramName}' passed into ` +\n            `'${moduleName}.${classNameStr}` +\n            `${funcName}()' must be of type ${expectedType}.`);\n    },\n    'incorrect-class': ({ expectedClassName, paramName, moduleName, className, funcName, isReturnValueProblem, }) => {\n        if (!expectedClassName || !moduleName || !funcName) {\n            throw new Error(`Unexpected input to 'incorrect-class' error.`);\n        }\n        const classNameStr = className ? `${className}.` : '';\n        if (isReturnValueProblem) {\n            return (`The return value from ` +\n                `'${moduleName}.${classNameStr}${funcName}()' ` +\n                `must be an instance of class ${expectedClassName}.`);\n        }\n        return (`The parameter '${paramName}' passed into ` +\n            `'${moduleName}.${classNameStr}${funcName}()' ` +\n            `must be an instance of class ${expectedClassName}.`);\n    },\n    'missing-a-method': ({ expectedMethod, paramName, moduleName, className, funcName, }) => {\n        if (!expectedMethod ||\n            !paramName ||\n            !moduleName ||\n            !className ||\n            !funcName) {\n            throw new Error(`Unexpected input to 'missing-a-method' error.`);\n        }\n        return (`${moduleName}.${className}.${funcName}() expected the ` +\n            `'${paramName}' parameter to expose a '${expectedMethod}' method.`);\n    },\n    'add-to-cache-list-unexpected-type': ({ entry }) => {\n        return (`An unexpected entry was passed to ` +\n            `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` +\n            `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` +\n            `strings with one or more characters, objects with a url property or ` +\n            `Request objects.`);\n    },\n    'add-to-cache-list-conflicting-entries': ({ firstEntry, secondEntry }) => {\n        if (!firstEntry || !secondEntry) {\n            throw new Error(`Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`);\n        }\n        return (`Two of the entries passed to ` +\n            `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +\n            `${firstEntry} but different revision details. Workbox is ` +\n            `unable to cache and version the asset correctly. Please remove one ` +\n            `of the entries.`);\n    },\n    'plugin-error-request-will-fetch': ({ thrownErrorMessage }) => {\n        if (!thrownErrorMessage) {\n            throw new Error(`Unexpected input to ` + `'plugin-error-request-will-fetch', error.`);\n        }\n        return (`An error was thrown by a plugins 'requestWillFetch()' method. ` +\n            `The thrown error message was: '${thrownErrorMessage}'.`);\n    },\n    'invalid-cache-name': ({ cacheNameId, value }) => {\n        if (!cacheNameId) {\n            throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);\n        }\n        return (`You must provide a name containing at least one character for ` +\n            `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` +\n            `'${JSON.stringify(value)}'`);\n    },\n    'unregister-route-but-not-found-with-method': ({ method }) => {\n        if (!method) {\n            throw new Error(`Unexpected input to ` +\n                `'unregister-route-but-not-found-with-method' error.`);\n        }\n        return (`The route you're trying to unregister was not  previously ` +\n            `registered for the method type '${method}'.`);\n    },\n    'unregister-route-route-not-registered': () => {\n        return (`The route you're trying to unregister was not previously ` +\n            `registered.`);\n    },\n    'queue-replay-failed': ({ name }) => {\n        return `Replaying the background sync queue '${name}' failed.`;\n    },\n    'duplicate-queue-name': ({ name }) => {\n        return (`The Queue name '${name}' is already being used. ` +\n            `All instances of backgroundSync.Queue must be given unique names.`);\n    },\n    'expired-test-without-max-age': ({ methodName, paramName }) => {\n        return (`The '${methodName}()' method can only be used when the ` +\n            `'${paramName}' is used in the constructor.`);\n    },\n    'unsupported-route-type': ({ moduleName, className, funcName, paramName }) => {\n        return (`The supplied '${paramName}' parameter was an unsupported type. ` +\n            `Please check the docs for ${moduleName}.${className}.${funcName} for ` +\n            `valid input types.`);\n    },\n    'not-array-of-class': ({ value, expectedClass, moduleName, className, funcName, paramName, }) => {\n        return (`The supplied '${paramName}' parameter must be an array of ` +\n            `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` +\n            `Please check the call to ${moduleName}.${className}.${funcName}() ` +\n            `to fix the issue.`);\n    },\n    'max-entries-or-age-required': ({ moduleName, className, funcName }) => {\n        return (`You must define either config.maxEntries or config.maxAgeSeconds` +\n            `in ${moduleName}.${className}.${funcName}`);\n    },\n    'statuses-or-headers-required': ({ moduleName, className, funcName }) => {\n        return (`You must define either config.statuses or config.headers` +\n            `in ${moduleName}.${className}.${funcName}`);\n    },\n    'invalid-string': ({ moduleName, funcName, paramName }) => {\n        if (!paramName || !moduleName || !funcName) {\n            throw new Error(`Unexpected input to 'invalid-string' error.`);\n        }\n        return (`When using strings, the '${paramName}' parameter must start with ` +\n            `'http' (for cross-origin matches) or '/' (for same-origin matches). ` +\n            `Please see the docs for ${moduleName}.${funcName}() for ` +\n            `more info.`);\n    },\n    'channel-name-required': () => {\n        return (`You must provide a channelName to construct a ` +\n            `BroadcastCacheUpdate instance.`);\n    },\n    'invalid-responses-are-same-args': () => {\n        return (`The arguments passed into responsesAreSame() appear to be ` +\n            `invalid. Please ensure valid Responses are used.`);\n    },\n    'expire-custom-caches-only': () => {\n        return (`You must provide a 'cacheName' property when using the ` +\n            `expiration plugin with a runtime caching strategy.`);\n    },\n    'unit-must-be-bytes': ({ normalizedRangeHeader }) => {\n        if (!normalizedRangeHeader) {\n            throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);\n        }\n        return (`The 'unit' portion of the Range header must be set to 'bytes'. ` +\n            `The Range header provided was \"${normalizedRangeHeader}\"`);\n    },\n    'single-range-only': ({ normalizedRangeHeader }) => {\n        if (!normalizedRangeHeader) {\n            throw new Error(`Unexpected input to 'single-range-only' error.`);\n        }\n        return (`Multiple ranges are not supported. Please use a  single start ` +\n            `value, and optional end value. The Range header provided was ` +\n            `\"${normalizedRangeHeader}\"`);\n    },\n    'invalid-range-values': ({ normalizedRangeHeader }) => {\n        if (!normalizedRangeHeader) {\n            throw new Error(`Unexpected input to 'invalid-range-values' error.`);\n        }\n        return (`The Range header is missing both start and end values. At least ` +\n            `one of those values is needed. The Range header provided was ` +\n            `\"${normalizedRangeHeader}\"`);\n    },\n    'no-range-header': () => {\n        return `No Range header was found in the Request provided.`;\n    },\n    'range-not-satisfiable': ({ size, start, end }) => {\n        return (`The start (${start}) and end (${end}) values in the Range are ` +\n            `not satisfiable by the cached response, which is ${size} bytes.`);\n    },\n    'attempt-to-cache-non-get-request': ({ url, method }) => {\n        return (`Unable to cache '${url}' because it is a '${method}' request and ` +\n            `only 'GET' requests can be cached.`);\n    },\n    'cache-put-with-no-response': ({ url }) => {\n        return (`There was an attempt to cache '${url}' but the response was not ` +\n            `defined.`);\n    },\n    'no-response': ({ url, error }) => {\n        let message = `The strategy could not generate a response for '${url}'.`;\n        if (error) {\n            message += ` The underlying error is ${error}.`;\n        }\n        return message;\n    },\n    'bad-precaching-response': ({ url, status }) => {\n        return (`The precaching request for '${url}' failed` +\n            (status ? ` with an HTTP status of ${status}.` : `.`));\n    },\n    'non-precached-url': ({ url }) => {\n        return (`createHandlerBoundToURL('${url}') was called, but that URL is ` +\n            `not precached. Please pass in a URL that is precached instead.`);\n    },\n    'add-to-cache-list-conflicting-integrities': ({ url }) => {\n        return (`Two of the entries passed to ` +\n            `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +\n            `${url} with different integrity values. Please remove one of them.`);\n    },\n    'missing-precache-entry': ({ cacheName, url }) => {\n        return `Unable to find a precached response in ${cacheName} for ${url}.`;\n    },\n    'cross-origin-copy-response': ({ origin }) => {\n        return (`workbox-core.copyResponse() can only be used with same-origin ` +\n            `responses. It was passed a response with origin ${origin}.`);\n    },\n    'opaque-streams-source': ({ type }) => {\n        const message = `One of the workbox-streams sources resulted in an ` +\n            `'${type}' response.`;\n        if (type === 'opaqueredirect') {\n            return (`${message} Please do not use a navigation request that results ` +\n                `in a redirect as a source.`);\n        }\n        return `${message} Please ensure your sources are CORS-enabled.`;\n    },\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n    let msg = code;\n    if (args.length > 0) {\n        msg += ` :: ${JSON.stringify(args)}`;\n    }\n    return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n    const message = messages[code];\n    if (!message) {\n        throw new Error(`Unable to find message for code '${code}'.`);\n    }\n    return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n    /**\n     *\n     * @param {string} errorCode The error code that\n     * identifies this particular error.\n     * @param {Object=} details Any relevant arguments\n     * that will help developers identify issues should\n     * be added as a key on the context object.\n     */\n    constructor(errorCode, details) {\n        const message = messageGenerator(errorCode, details);\n        super(message);\n        this.name = errorCode;\n        this.details = details;\n    }\n}\nexport { WorkboxError };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from '../_private/WorkboxError.js';\nimport '../_version.js';\n/*\n * This method throws if the supplied value is not an array.\n * The destructed values are required to produce a meaningful error for users.\n * The destructed and restructured object is so it's clear what is\n * needed.\n */\nconst isArray = (value, details) => {\n    if (!Array.isArray(value)) {\n        throw new WorkboxError('not-an-array', details);\n    }\n};\nconst hasMethod = (object, expectedMethod, details) => {\n    const type = typeof object[expectedMethod];\n    if (type !== 'function') {\n        details['expectedMethod'] = expectedMethod;\n        throw new WorkboxError('missing-a-method', details);\n    }\n};\nconst isType = (object, expectedType, details) => {\n    if (typeof object !== expectedType) {\n        details['expectedType'] = expectedType;\n        throw new WorkboxError('incorrect-type', details);\n    }\n};\nconst isInstance = (object, \n// Need the general type to do the check later.\n// eslint-disable-next-line @typescript-eslint/ban-types\nexpectedClass, details) => {\n    if (!(object instanceof expectedClass)) {\n        details['expectedClassName'] = expectedClass.name;\n        throw new WorkboxError('incorrect-class', details);\n    }\n};\nconst isOneOf = (value, validValues, details) => {\n    if (!validValues.includes(value)) {\n        details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`;\n        throw new WorkboxError('invalid-value', details);\n    }\n};\nconst isArrayOfClass = (value, \n// Need general type to do check later.\nexpectedClass, // eslint-disable-line\ndetails) => {\n    const error = new WorkboxError('not-array-of-class', details);\n    if (!Array.isArray(value)) {\n        throw error;\n    }\n    for (const item of value) {\n        if (!(item instanceof expectedClass)) {\n            throw error;\n        }\n    }\n};\nconst finalAssertExports = process.env.NODE_ENV === 'production'\n    ? null\n    : {\n        hasMethod,\n        isArray,\n        isInstance,\n        isOneOf,\n        isType,\n        isArrayOfClass,\n    };\nexport { finalAssertExports as assert };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from './_private/logger.js';\nimport { assert } from './_private/assert.js';\nimport { quotaErrorCallbacks } from './models/quotaErrorCallbacks.js';\nimport './_version.js';\n/**\n * Adds a function to the set of quotaErrorCallbacks that will be executed if\n * there's a quota error.\n *\n * @param {Function} callback\n * @memberof workbox-core\n */\n// Can't change Function type\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction registerQuotaErrorCallback(callback) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isType(callback, 'function', {\n            moduleName: 'workbox-core',\n            funcName: 'register',\n            paramName: 'callback',\n        });\n    }\n    quotaErrorCallbacks.add(callback);\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log('Registered a callback to respond to quota errors.', callback);\n    }\n}\nexport { registerQuotaErrorCallback };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n    googleAnalytics: 'googleAnalytics',\n    precache: 'precache-v2',\n    prefix: 'workbox',\n    runtime: 'runtime',\n    suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n    return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n        .filter((value) => value && value.length > 0)\n        .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n    for (const key of Object.keys(_cacheNameDetails)) {\n        fn(key);\n    }\n};\nexport const cacheNames = {\n    updateDetails: (details) => {\n        eachCacheNameDetail((key) => {\n            if (typeof details[key] === 'string') {\n                _cacheNameDetails[key] = details[key];\n            }\n        });\n    },\n    getGoogleAnalyticsName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n    },\n    getPrecacheName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.precache);\n    },\n    getPrefix: () => {\n        return _cacheNameDetails.prefix;\n    },\n    getRuntimeName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n    },\n    getSuffix: () => {\n        return _cacheNameDetails.suffix;\n    },\n};\n","/*\n  Copyright 2020 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n    const strippedURL = new URL(fullURL);\n    for (const param of ignoreParams) {\n        strippedURL.searchParams.delete(param);\n    }\n    return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n    const strippedRequestURL = stripParams(request.url, ignoreParams);\n    // If the request doesn't include any ignored params, match as normal.\n    if (request.url === strippedRequestURL) {\n        return cache.match(request, matchOptions);\n    }\n    // Otherwise, match by comparing keys\n    const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n    const cacheKeys = await cache.keys(request, keysOptions);\n    for (const cacheKey of cacheKeys) {\n        const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n        if (strippedRequestURL === strippedCacheKeyURL) {\n            return cache.match(cacheKey, matchOptions);\n        }\n    }\n    return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * object.\n *\n * @return {boolean} `true`, if the current browser can successfully\n *     construct a `ReadableStream`, `false` otherwise.\n *\n * @private\n */\nfunction canConstructReadableStream() {\n    if (supportStatus === undefined) {\n        // See https://github.com/GoogleChrome/workbox/issues/1473\n        try {\n            new ReadableStream({ start() { } });\n            supportStatus = true;\n        }\n        catch (error) {\n            supportStatus = false;\n        }\n    }\n    return supportStatus;\n}\nexport { canConstructReadableStream };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n *     construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n    if (supportStatus === undefined) {\n        const testResponse = new Response('');\n        if ('body' in testResponse) {\n            try {\n                new Response(testResponse.body);\n                supportStatus = true;\n            }\n            catch (error) {\n                supportStatus = false;\n            }\n        }\n        supportStatus = false;\n    }\n    return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A helper function that prevents a promise from being flagged as unused.\n *\n * @private\n **/\nexport function dontWaitFor(promise) {\n    // Effective no-op.\n    void promise.then(() => { });\n}\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n    /**\n     * Creates a promise and exposes its resolve and reject functions as methods.\n     */\n    constructor() {\n        this.promise = new Promise((resolve, reject) => {\n            this.resolve = resolve;\n            this.reject = reject;\n        });\n    }\n}\nexport { Deferred };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n            `callbacks to clean up caches.`);\n    }\n    for (const callback of quotaErrorCallbacks) {\n        await callback();\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(callback, 'is complete.');\n        }\n    }\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log('Finished running callbacks.');\n    }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n    const urlObj = new URL(String(url), location.href);\n    // See https://github.com/GoogleChrome/workbox/issues/2323\n    // We want to include everything, except for the origin if it's same-origin.\n    return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n    return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { timeout } from './timeout.js';\nimport '../_version.js';\nconst MAX_RETRY_TIME = 2000;\n/**\n * Returns a promise that resolves to a window client matching the passed\n * `resultingClientId`. For browsers that don't support `resultingClientId`\n * or if waiting for the resulting client to apper takes too long, resolve to\n * `undefined`.\n *\n * @param {string} [resultingClientId]\n * @return {Promise}\n * @private\n */\nexport async function resultingClientExists(resultingClientId) {\n    if (!resultingClientId) {\n        return;\n    }\n    let existingWindows = await self.clients.matchAll({ type: 'window' });\n    const existingWindowIds = new Set(existingWindows.map((w) => w.id));\n    let resultingWindow;\n    const startTime = performance.now();\n    // Only wait up to `MAX_RETRY_TIME` to find a matching client.\n    while (performance.now() - startTime < MAX_RETRY_TIME) {\n        existingWindows = await self.clients.matchAll({ type: 'window' });\n        resultingWindow = existingWindows.find((w) => {\n            if (resultingClientId) {\n                // If we have a `resultingClientId`, we can match on that.\n                return w.id === resultingClientId;\n            }\n            else {\n                // Otherwise match on finding a window not in `existingWindowIds`.\n                return !existingWindowIds.has(w.id);\n            }\n        });\n        if (resultingWindow) {\n            break;\n        }\n        // Sleep for 100ms and retry.\n        await timeout(100);\n    }\n    return resultingWindow;\n}\n","/*\n  Copyright 2020 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n    const returnPromise = asyncFn();\n    event.waitUntil(returnPromise);\n    return returnPromise;\n}\nexport { waitUntil };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\n// We either expose defaults or we expose every named export.\nimport { assert } from './_private/assert.js';\nimport { cacheNames } from './_private/cacheNames.js';\nimport { cacheMatchIgnoreParams } from './_private/cacheMatchIgnoreParams.js';\nimport { canConstructReadableStream } from './_private/canConstructReadableStream.js';\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { dontWaitFor } from './_private/dontWaitFor.js';\nimport { Deferred } from './_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from './_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './_private/getFriendlyURL.js';\nimport { logger } from './_private/logger.js';\nimport { resultingClientExists } from './_private/resultingClientExists.js';\nimport { timeout } from './_private/timeout.js';\nimport { waitUntil } from './_private/waitUntil.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\nexport { assert, cacheMatchIgnoreParams, cacheNames, canConstructReadableStream, canConstructResponseFromBodyStream, dontWaitFor, Deferred, executeQuotaErrorCallbacks, getFriendlyURL, logger, resultingClientExists, timeout, waitUntil, WorkboxError, };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n *     `googleAnalytics` properties.\n *\n * @memberof workbox-core\n */\nconst cacheNames = {\n    get googleAnalytics() {\n        return _cacheNames.getGoogleAnalyticsName();\n    },\n    get precache() {\n        return _cacheNames.getPrecacheName();\n    },\n    get prefix() {\n        return _cacheNames.getPrefix();\n    },\n    get runtime() {\n        return _cacheNames.getRuntimeName();\n    },\n    get suffix() {\n        return _cacheNames.getSuffix();\n    },\n};\nexport { cacheNames };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n    let origin = null;\n    // If response.url isn't set, assume it's cross-origin and keep origin null.\n    if (response.url) {\n        const responseURL = new URL(response.url);\n        origin = responseURL.origin;\n    }\n    if (origin !== self.location.origin) {\n        throw new WorkboxError('cross-origin-copy-response', { origin });\n    }\n    const clonedResponse = response.clone();\n    // Create a fresh `ResponseInit` object by cloning the headers.\n    const responseInit = {\n        headers: new Headers(clonedResponse.headers),\n        status: clonedResponse.status,\n        statusText: clonedResponse.statusText,\n    };\n    // Apply any user modifications.\n    const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n    // Create the new response from the body stream and `ResponseInit`\n    // modifications. Note: not all browsers support the Response.body stream,\n    // so fall back to reading the entire body into memory as a blob.\n    const body = canConstructResponseFromBodyStream()\n        ? clonedResponse.body\n        : await clonedResponse.blob();\n    return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport './_version.js';\n/**\n * Claim any currently available clients once the service worker\n * becomes active. This is normally used in conjunction with `skipWaiting()`.\n *\n * @memberof workbox-core\n */\nfunction clientsClaim() {\n    self.addEventListener('activate', () => self.clients.claim());\n}\nexport { clientsClaim };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './_private/assert.js';\nimport { cacheNames } from './_private/cacheNames.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Modifies the default cache names used by the Workbox packages.\n * Cache names are generated as `--`.\n *\n * @param {Object} details\n * @param {Object} [details.prefix] The string to add to the beginning of\n *     the precache and runtime cache names.\n * @param {Object} [details.suffix] The string to add to the end of\n *     the precache and runtime cache names.\n * @param {Object} [details.precache] The cache name to use for precache\n *     caching.\n * @param {Object} [details.runtime] The cache name to use for runtime caching.\n * @param {Object} [details.googleAnalytics] The cache name to use for\n *     `workbox-google-analytics` caching.\n *\n * @memberof workbox-core\n */\nfunction setCacheNameDetails(details) {\n    if (process.env.NODE_ENV !== 'production') {\n        Object.keys(details).forEach((key) => {\n            assert.isType(details[key], 'string', {\n                moduleName: 'workbox-core',\n                funcName: 'setCacheNameDetails',\n                paramName: `details.${key}`,\n            });\n        });\n        if ('precache' in details && details['precache'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'precache',\n                value: details['precache'],\n            });\n        }\n        if ('runtime' in details && details['runtime'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'runtime',\n                value: details['runtime'],\n            });\n        }\n        if ('googleAnalytics' in details &&\n            details['googleAnalytics'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'googleAnalytics',\n                value: details['googleAnalytics'],\n            });\n        }\n    }\n    cacheNames.updateDetails(details);\n}\nexport { setCacheNameDetails };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from './_private/logger.js';\nimport './_version.js';\n/**\n * This method is deprecated, and will be removed in Workbox v7.\n *\n * Calling self.skipWaiting() is equivalent, and should be used instead.\n *\n * @memberof workbox-core\n */\nfunction skipWaiting() {\n    // Just call self.skipWaiting() directly.\n    // See https://github.com/GoogleChrome/workbox/issues/2525\n    if (process.env.NODE_ENV !== 'production') {\n        logger.warn(`skipWaiting() from workbox-core is no longer recommended ` +\n            `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +\n            `is equivalent.`);\n    }\n    void self.skipWaiting();\n}\nexport { skipWaiting };\n"],"names":["self","_","e","logger","globalThis","__WB_DISABLE_DEV_LOGS","inGroup","methodToColorMap","debug","log","warn","error","groupCollapsed","groupEnd","print","method","args","test","navigator","userAgent","console","styles","logPrefix","join","api","loggerMethods","Object","keys","key","messages","invalid-value","paramName","validValueDescription","value","Error","JSON","stringify","not-an-array","moduleName","className","funcName","incorrect-type","expectedType","classNameStr","incorrect-class","expectedClassName","isReturnValueProblem","missing-a-method","expectedMethod","add-to-cache-list-unexpected-type","entry","add-to-cache-list-conflicting-entries","firstEntry","secondEntry","plugin-error-request-will-fetch","thrownErrorMessage","invalid-cache-name","cacheNameId","unregister-route-but-not-found-with-method","unregister-route-route-not-registered","queue-replay-failed","name","duplicate-queue-name","expired-test-without-max-age","methodName","unsupported-route-type","not-array-of-class","expectedClass","max-entries-or-age-required","statuses-or-headers-required","invalid-string","channel-name-required","invalid-responses-are-same-args","expire-custom-caches-only","unit-must-be-bytes","normalizedRangeHeader","single-range-only","invalid-range-values","no-range-header","range-not-satisfiable","size","start","end","attempt-to-cache-non-get-request","url","cache-put-with-no-response","no-response","message","bad-precaching-response","status","non-precached-url","add-to-cache-list-conflicting-integrities","missing-precache-entry","cacheName","cross-origin-copy-response","origin","opaque-streams-source","type","generatorFunction","code","details","messageGenerator","WorkboxError","constructor","errorCode","isArray","Array","hasMethod","object","isType","isInstance","isOneOf","validValues","includes","isArrayOfClass","item","finalAssertExports","quotaErrorCallbacks","Set","registerQuotaErrorCallback","callback","assert","add","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","filter","length","eachCacheNameDetail","fn","cacheNames","updateDetails","getGoogleAnalyticsName","userCacheName","getPrecacheName","getPrefix","getRuntimeName","getSuffix","stripParams","fullURL","ignoreParams","strippedURL","URL","param","searchParams","delete","href","cacheMatchIgnoreParams","cache","request","matchOptions","strippedRequestURL","match","keysOptions","assign","ignoreSearch","cacheKeys","cacheKey","strippedCacheKeyURL","supportStatus","canConstructReadableStream","undefined","ReadableStream","canConstructResponseFromBodyStream","testResponse","Response","body","dontWaitFor","promise","then","Deferred","Promise","resolve","reject","executeQuotaErrorCallbacks","getFriendlyURL","urlObj","String","location","replace","RegExp","timeout","ms","setTimeout","MAX_RETRY_TIME","resultingClientExists","resultingClientId","existingWindows","clients","matchAll","existingWindowIds","map","w","id","resultingWindow","startTime","performance","now","find","has","waitUntil","event","asyncFn","returnPromise","_cacheNames","copyResponse","response","modifier","responseURL","clonedResponse","clone","responseInit","headers","Headers","statusText","modifiedResponseInit","blob","clientsClaim","addEventListener","claim","setCacheNameDetails","forEach","skipWaiting"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,oBAAoB,CAAC,IAAIC,CAAC,EAAE;IACrC,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;IACA;IACA;IACA;IACA;IAEA,MAAMC,MAAM,GAEN,CAAC,MAAM;IACL;IACA;IACA,EAAA,IAAI,EAAE,uBAAuB,IAAIC,UAAU,CAAC,EAAE;QAC1CJ,IAAI,CAACK,qBAAqB,GAAG,KAAK;IACtC,EAAA;MACA,IAAIC,OAAO,GAAG,KAAK;IACnB,EAAA,MAAMC,gBAAgB,GAAG;IACrBC,IAAAA,KAAK,EAAG,CAAA,OAAA,CAAQ;IAChBC,IAAAA,GAAG,EAAG,CAAA,OAAA,CAAQ;IACdC,IAAAA,IAAI,EAAG,CAAA,OAAA,CAAQ;IACfC,IAAAA,KAAK,EAAG,CAAA,OAAA,CAAQ;IAChBC,IAAAA,cAAc,EAAG,CAAA,OAAA,CAAQ;QACzBC,QAAQ,EAAE,IAAI;OACjB;IACD,EAAA,MAAMC,KAAK,GAAG,UAAUC,MAAM,EAAEC,IAAI,EAAE;QAClC,IAAIhB,IAAI,CAACK,qBAAqB,EAAE;IAC5B,MAAA;IACJ,IAAA;QACA,IAAIU,MAAM,KAAK,gBAAgB,EAAE;IAC7B;IACA;UACA,IAAI,gCAAgC,CAACE,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC,EAAE;IAC5DC,QAAAA,OAAO,CAACL,MAAM,CAAC,CAAC,GAAGC,IAAI,CAAC;IACxB,Q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M,CAACO,IAAI,CAAE,CAAA,yDAAA,CAA0D,GAClE,CAAA,oEAAA,CAAqE,GACrE,gBAAe,CAAC;IACzB,EAAA;IACA,EAAA,KAAKV,IAAI,CAACoO,WAAW,EAAE;IAC3B;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js b/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..92f71756466f002a243adc27715bad0fd1d86561
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.core=function(t){"use strict";try{self["workbox:core:7.4.0"]&&_()}catch(t){}const e=(t,...e)=>{let n=t;return e.length>0&&(n+=` :: ${JSON.stringify(e)}`),n};class n extends Error{constructor(t,n){super(e(t,n)),this.name=t,this.details=n}}const r=new Set;const o={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},s=t=>[o.prefix,t,o.suffix].filter((t=>t&&t.length>0)).join("-"),i={updateDetails:t=>{(t=>{for(const e of Object.keys(o))t(e)})((e=>{"string"==typeof t[e]&&(o[e]=t[e])}))},getGoogleAnalyticsName:t=>t||s(o.googleAnalytics),getPrecacheName:t=>t||s(o.precache),getPrefix:()=>o.prefix,getRuntimeName:t=>t||s(o.runtime),getSuffix:()=>o.suffix};function c(t,e){const n=new URL(t);for(const t of e)n.searchParams.delete(t);return n.href}let a,u;function f(){if(void 0===u){const t=new Response("");if("body"in t)try{new Response(t.body),u=!0}catch(t){u=!1}u=!1}return u}function l(t){return new Promise((e=>setTimeout(e,t)))}var g=Object.freeze({__proto__:null,Deferred:class{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}},WorkboxError:n,assert:null,cacheMatchIgnoreParams:async function(t,e,n,r){const o=c(e.url,n);if(e.url===o)return t.match(e,r);const s=Object.assign(Object.assign({},r),{ignoreSearch:!0}),i=await t.keys(e,s);for(const e of i){if(o===c(e.url,n))return t.match(e,r)}},cacheNames:i,canConstructReadableStream:function(){if(void 0===a)try{new ReadableStream({start(){}}),a=!0}catch(t){a=!1}return a},canConstructResponseFromBodyStream:f,dontWaitFor:function(t){t.then((()=>{}))},executeQuotaErrorCallbacks:async function(){for(const t of r)await t()},getFriendlyURL:t=>new URL(String(t),location.href).href.replace(new RegExp(`^${location.origin}`),""),logger:null,resultingClientExists:async function(t){if(!t)return;let e=await self.clients.matchAll({type:"window"});const n=new Set(e.map((t=>t.id)));let r;const o=performance.now();for(;performance.now()-o<2e3&&(e=await self.clients.matchAll({type:"window"}),r=e.find((e=>t?e.id===t:!n.has(e.id))),!r);)await l(100);return r},timeout:l,waitUntil:function(t,e){const n=e();return t.waitUntil(n),n}});const w={get googleAnalytics(){return i.getGoogleAnalyticsName()},get precache(){return i.getPrecacheName()},get prefix(){return i.getPrefix()},get runtime(){return i.getRuntimeName()},get suffix(){return i.getSuffix()}};return t._private=g,t.cacheNames=w,t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.copyResponse=async function(t,e){let r=null;if(t.url){r=new URL(t.url).origin}if(r!==self.location.origin)throw new n("cross-origin-copy-response",{origin:r});const o=t.clone(),s={headers:new Headers(o.headers),status:o.status,statusText:o.statusText},i=e?e(s):s,c=f()?o.body:await o.blob();return new Response(c,i)},t.registerQuotaErrorCallback=function(t){r.add(t)},t.setCacheNameDetails=function(t){i.updateDetails(t)},t.skipWaiting=function(){self.skipWaiting()},t}({});
+//# sourceMappingURL=workbox-core.prod.js.map
diff --git a/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js.map b/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..0be80bd70080a9067d16a34020a4bce4d5bb943c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/build/workbox-core.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-core.prod.js","sources":["../_version.js","../_private/logger.js","../models/messages/messageGenerator.js","../_private/WorkboxError.js","../_private/assert.js","../models/quotaErrorCallbacks.js","../_private/cacheNames.js","../_private/cacheMatchIgnoreParams.js","../_private/canConstructReadableStream.js","../_private/canConstructResponseFromBodyStream.js","../_private/timeout.js","../_private/Deferred.js","../_private/dontWaitFor.js","../_private/executeQuotaErrorCallbacks.js","../_private/getFriendlyURL.js","../_private/resultingClientExists.js","../_private/waitUntil.js","../cacheNames.js","../clientsClaim.js","../copyResponse.js","../registerQuotaErrorCallback.js","../setCacheNameDetails.js","../skipWaiting.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:core:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n    ? null\n    : (() => {\n        // Don't overwrite this value if it's already set.\n        // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n        if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {\n            self.__WB_DISABLE_DEV_LOGS = false;\n        }\n        let inGroup = false;\n        const methodToColorMap = {\n            debug: `#7f8c8d`,\n            log: `#2ecc71`,\n            warn: `#f39c12`,\n            error: `#c0392b`,\n            groupCollapsed: `#3498db`,\n            groupEnd: null, // No colored prefix on groupEnd\n        };\n        const print = function (method, args) {\n            if (self.__WB_DISABLE_DEV_LOGS) {\n                return;\n            }\n            if (method === 'groupCollapsed') {\n                // Safari doesn't print all console.groupCollapsed() arguments:\n                // https://bugs.webkit.org/show_bug.cgi?id=182754\n                if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n                    console[method](...args);\n                    return;\n                }\n            }\n            const styles = [\n                `background: ${methodToColorMap[method]}`,\n                `border-radius: 0.5em`,\n                `color: white`,\n                `font-weight: bold`,\n                `padding: 2px 0.5em`,\n            ];\n            // When in a group, the workbox prefix is not displayed.\n            const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n            console[method](...logPrefix, ...args);\n            if (method === 'groupCollapsed') {\n                inGroup = true;\n            }\n            if (method === 'groupEnd') {\n                inGroup = false;\n            }\n        };\n        // eslint-disable-next-line @typescript-eslint/ban-types\n        const api = {};\n        const loggerMethods = Object.keys(methodToColorMap);\n        for (const key of loggerMethods) {\n            const method = key;\n            api[method] = (...args) => {\n                print(method, args);\n            };\n        }\n        return api;\n    })());\nexport { logger };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n    let msg = code;\n    if (args.length > 0) {\n        msg += ` :: ${JSON.stringify(args)}`;\n    }\n    return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n    const message = messages[code];\n    if (!message) {\n        throw new Error(`Unable to find message for code '${code}'.`);\n    }\n    return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n    /**\n     *\n     * @param {string} errorCode The error code that\n     * identifies this particular error.\n     * @param {Object=} details Any relevant arguments\n     * that will help developers identify issues should\n     * be added as a key on the context object.\n     */\n    constructor(errorCode, details) {\n        const message = messageGenerator(errorCode, details);\n        super(message);\n        this.name = errorCode;\n        this.details = details;\n    }\n}\nexport { WorkboxError };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from '../_private/WorkboxError.js';\nimport '../_version.js';\n/*\n * This method throws if the supplied value is not an array.\n * The destructed values are required to produce a meaningful error for users.\n * The destructed and restructured object is so it's clear what is\n * needed.\n */\nconst isArray = (value, details) => {\n    if (!Array.isArray(value)) {\n        throw new WorkboxError('not-an-array', details);\n    }\n};\nconst hasMethod = (object, expectedMethod, details) => {\n    const type = typeof object[expectedMethod];\n    if (type !== 'function') {\n        details['expectedMethod'] = expectedMethod;\n        throw new WorkboxError('missing-a-method', details);\n    }\n};\nconst isType = (object, expectedType, details) => {\n    if (typeof object !== expectedType) {\n        details['expectedType'] = expectedType;\n        throw new WorkboxError('incorrect-type', details);\n    }\n};\nconst isInstance = (object, \n// Need the general type to do the check later.\n// eslint-disable-next-line @typescript-eslint/ban-types\nexpectedClass, details) => {\n    if (!(object instanceof expectedClass)) {\n        details['expectedClassName'] = expectedClass.name;\n        throw new WorkboxError('incorrect-class', details);\n    }\n};\nconst isOneOf = (value, validValues, details) => {\n    if (!validValues.includes(value)) {\n        details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`;\n        throw new WorkboxError('invalid-value', details);\n    }\n};\nconst isArrayOfClass = (value, \n// Need general type to do check later.\nexpectedClass, // eslint-disable-line\ndetails) => {\n    const error = new WorkboxError('not-array-of-class', details);\n    if (!Array.isArray(value)) {\n        throw error;\n    }\n    for (const item of value) {\n        if (!(item instanceof expectedClass)) {\n            throw error;\n        }\n    }\n};\nconst finalAssertExports = process.env.NODE_ENV === 'production'\n    ? null\n    : {\n        hasMethod,\n        isArray,\n        isInstance,\n        isOneOf,\n        isType,\n        isArrayOfClass,\n    };\nexport { finalAssertExports as assert };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n    googleAnalytics: 'googleAnalytics',\n    precache: 'precache-v2',\n    prefix: 'workbox',\n    runtime: 'runtime',\n    suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n    return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n        .filter((value) => value && value.length > 0)\n        .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n    for (const key of Object.keys(_cacheNameDetails)) {\n        fn(key);\n    }\n};\nexport const cacheNames = {\n    updateDetails: (details) => {\n        eachCacheNameDetail((key) => {\n            if (typeof details[key] === 'string') {\n                _cacheNameDetails[key] = details[key];\n            }\n        });\n    },\n    getGoogleAnalyticsName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n    },\n    getPrecacheName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.precache);\n    },\n    getPrefix: () => {\n        return _cacheNameDetails.prefix;\n    },\n    getRuntimeName: (userCacheName) => {\n        return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n    },\n    getSuffix: () => {\n        return _cacheNameDetails.suffix;\n    },\n};\n","/*\n  Copyright 2020 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n    const strippedURL = new URL(fullURL);\n    for (const param of ignoreParams) {\n        strippedURL.searchParams.delete(param);\n    }\n    return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n    const strippedRequestURL = stripParams(request.url, ignoreParams);\n    // If the request doesn't include any ignored params, match as normal.\n    if (request.url === strippedRequestURL) {\n        return cache.match(request, matchOptions);\n    }\n    // Otherwise, match by comparing keys\n    const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n    const cacheKeys = await cache.keys(request, keysOptions);\n    for (const cacheKey of cacheKeys) {\n        const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n        if (strippedRequestURL === strippedCacheKeyURL) {\n            return cache.match(cacheKey, matchOptions);\n        }\n    }\n    return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * object.\n *\n * @return {boolean} `true`, if the current browser can successfully\n *     construct a `ReadableStream`, `false` otherwise.\n *\n * @private\n */\nfunction canConstructReadableStream() {\n    if (supportStatus === undefined) {\n        // See https://github.com/GoogleChrome/workbox/issues/1473\n        try {\n            new ReadableStream({ start() { } });\n            supportStatus = true;\n        }\n        catch (error) {\n            supportStatus = false;\n        }\n    }\n    return supportStatus;\n}\nexport { canConstructReadableStream };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n *     construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n    if (supportStatus === undefined) {\n        const testResponse = new Response('');\n        if ('body' in testResponse) {\n            try {\n                new Response(testResponse.body);\n                supportStatus = true;\n            }\n            catch (error) {\n                supportStatus = false;\n            }\n        }\n        supportStatus = false;\n    }\n    return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n    return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n    /**\n     * Creates a promise and exposes its resolve and reject functions as methods.\n     */\n    constructor() {\n        this.promise = new Promise((resolve, reject) => {\n            this.resolve = resolve;\n            this.reject = reject;\n        });\n    }\n}\nexport { Deferred };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A helper function that prevents a promise from being flagged as unused.\n *\n * @private\n **/\nexport function dontWaitFor(promise) {\n    // Effective no-op.\n    void promise.then(() => { });\n}\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n            `callbacks to clean up caches.`);\n    }\n    for (const callback of quotaErrorCallbacks) {\n        await callback();\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(callback, 'is complete.');\n        }\n    }\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log('Finished running callbacks.');\n    }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n    const urlObj = new URL(String(url), location.href);\n    // See https://github.com/GoogleChrome/workbox/issues/2323\n    // We want to include everything, except for the origin if it's same-origin.\n    return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { timeout } from './timeout.js';\nimport '../_version.js';\nconst MAX_RETRY_TIME = 2000;\n/**\n * Returns a promise that resolves to a window client matching the passed\n * `resultingClientId`. For browsers that don't support `resultingClientId`\n * or if waiting for the resulting client to apper takes too long, resolve to\n * `undefined`.\n *\n * @param {string} [resultingClientId]\n * @return {Promise}\n * @private\n */\nexport async function resultingClientExists(resultingClientId) {\n    if (!resultingClientId) {\n        return;\n    }\n    let existingWindows = await self.clients.matchAll({ type: 'window' });\n    const existingWindowIds = new Set(existingWindows.map((w) => w.id));\n    let resultingWindow;\n    const startTime = performance.now();\n    // Only wait up to `MAX_RETRY_TIME` to find a matching client.\n    while (performance.now() - startTime < MAX_RETRY_TIME) {\n        existingWindows = await self.clients.matchAll({ type: 'window' });\n        resultingWindow = existingWindows.find((w) => {\n            if (resultingClientId) {\n                // If we have a `resultingClientId`, we can match on that.\n                return w.id === resultingClientId;\n            }\n            else {\n                // Otherwise match on finding a window not in `existingWindowIds`.\n                return !existingWindowIds.has(w.id);\n            }\n        });\n        if (resultingWindow) {\n            break;\n        }\n        // Sleep for 100ms and retry.\n        await timeout(100);\n    }\n    return resultingWindow;\n}\n","/*\n  Copyright 2020 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n    const returnPromise = asyncFn();\n    event.waitUntil(returnPromise);\n    return returnPromise;\n}\nexport { waitUntil };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n *     `googleAnalytics` properties.\n *\n * @memberof workbox-core\n */\nconst cacheNames = {\n    get googleAnalytics() {\n        return _cacheNames.getGoogleAnalyticsName();\n    },\n    get precache() {\n        return _cacheNames.getPrecacheName();\n    },\n    get prefix() {\n        return _cacheNames.getPrefix();\n    },\n    get runtime() {\n        return _cacheNames.getRuntimeName();\n    },\n    get suffix() {\n        return _cacheNames.getSuffix();\n    },\n};\nexport { cacheNames };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport './_version.js';\n/**\n * Claim any currently available clients once the service worker\n * becomes active. This is normally used in conjunction with `skipWaiting()`.\n *\n * @memberof workbox-core\n */\nfunction clientsClaim() {\n    self.addEventListener('activate', () => self.clients.claim());\n}\nexport { clientsClaim };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n    let origin = null;\n    // If response.url isn't set, assume it's cross-origin and keep origin null.\n    if (response.url) {\n        const responseURL = new URL(response.url);\n        origin = responseURL.origin;\n    }\n    if (origin !== self.location.origin) {\n        throw new WorkboxError('cross-origin-copy-response', { origin });\n    }\n    const clonedResponse = response.clone();\n    // Create a fresh `ResponseInit` object by cloning the headers.\n    const responseInit = {\n        headers: new Headers(clonedResponse.headers),\n        status: clonedResponse.status,\n        statusText: clonedResponse.statusText,\n    };\n    // Apply any user modifications.\n    const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n    // Create the new response from the body stream and `ResponseInit`\n    // modifications. Note: not all browsers support the Response.body stream,\n    // so fall back to reading the entire body into memory as a blob.\n    const body = canConstructResponseFromBodyStream()\n        ? clonedResponse.body\n        : await clonedResponse.blob();\n    return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from './_private/logger.js';\nimport { assert } from './_private/assert.js';\nimport { quotaErrorCallbacks } from './models/quotaErrorCallbacks.js';\nimport './_version.js';\n/**\n * Adds a function to the set of quotaErrorCallbacks that will be executed if\n * there's a quota error.\n *\n * @param {Function} callback\n * @memberof workbox-core\n */\n// Can't change Function type\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction registerQuotaErrorCallback(callback) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isType(callback, 'function', {\n            moduleName: 'workbox-core',\n            funcName: 'register',\n            paramName: 'callback',\n        });\n    }\n    quotaErrorCallbacks.add(callback);\n    if (process.env.NODE_ENV !== 'production') {\n        logger.log('Registered a callback to respond to quota errors.', callback);\n    }\n}\nexport { registerQuotaErrorCallback };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './_private/assert.js';\nimport { cacheNames } from './_private/cacheNames.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Modifies the default cache names used by the Workbox packages.\n * Cache names are generated as `--`.\n *\n * @param {Object} details\n * @param {Object} [details.prefix] The string to add to the beginning of\n *     the precache and runtime cache names.\n * @param {Object} [details.suffix] The string to add to the end of\n *     the precache and runtime cache names.\n * @param {Object} [details.precache] The cache name to use for precache\n *     caching.\n * @param {Object} [details.runtime] The cache name to use for runtime caching.\n * @param {Object} [details.googleAnalytics] The cache name to use for\n *     `workbox-google-analytics` caching.\n *\n * @memberof workbox-core\n */\nfunction setCacheNameDetails(details) {\n    if (process.env.NODE_ENV !== 'production') {\n        Object.keys(details).forEach((key) => {\n            assert.isType(details[key], 'string', {\n                moduleName: 'workbox-core',\n                funcName: 'setCacheNameDetails',\n                paramName: `details.${key}`,\n            });\n        });\n        if ('precache' in details && details['precache'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'precache',\n                value: details['precache'],\n            });\n        }\n        if ('runtime' in details && details['runtime'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'runtime',\n                value: details['runtime'],\n            });\n        }\n        if ('googleAnalytics' in details &&\n            details['googleAnalytics'].length === 0) {\n            throw new WorkboxError('invalid-cache-name', {\n                cacheNameId: 'googleAnalytics',\n                value: details['googleAnalytics'],\n            });\n        }\n    }\n    cacheNames.updateDetails(details);\n}\nexport { setCacheNameDetails };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from './_private/logger.js';\nimport './_version.js';\n/**\n * This method is deprecated, and will be removed in Workbox v7.\n *\n * Calling self.skipWaiting() is equivalent, and should be used instead.\n *\n * @memberof workbox-core\n */\nfunction skipWaiting() {\n    // Just call self.skipWaiting() directly.\n    // See https://github.com/GoogleChrome/workbox/issues/2525\n    if (process.env.NODE_ENV !== 'production') {\n        logger.warn(`skipWaiting() from workbox-core is no longer recommended ` +\n            `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +\n            `is equivalent.`);\n    }\n    void self.skipWaiting();\n}\nexport { skipWaiting };\n"],"names":["self","_","e","messageGenerator","fallback","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","quotaErrorCallbacks","Set","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","updateDetails","fn","key","Object","keys","eachCacheNameDetail","getGoogleAnalyticsName","userCacheName","getPrecacheName","getPrefix","getRuntimeName","getSuffix","stripParams","fullURL","ignoreParams","strippedURL","URL","param","searchParams","delete","href","supportStatus","canConstructResponseFromBodyStream","undefined","testResponse","Response","body","error","timeout","ms","Promise","resolve","setTimeout","promise","reject","async","cache","request","matchOptions","strippedRequestURL","url","match","keysOptions","assign","ignoreSearch","cacheKeys","cacheKey","ReadableStream","start","then","callback","String","location","replace","RegExp","origin","resultingClientId","existingWindows","clients","matchAll","type","existingWindowIds","map","w","id","resultingWindow","startTime","performance","now","find","has","event","asyncFn","returnPromise","waitUntil","_cacheNames","addEventListener","claim","response","modifier","clonedResponse","clone","responseInit","headers","Headers","status","statusText","modifiedResponseInit","blob","add","skipWaiting"],"mappings":"yEAEA,IACIA,KAAK,uBAAyBC,GAClC,CACA,MAAOC,GAAK,CCEZ,MCgBaC,EAdIC,CAACC,KAASC,KACvB,IAAIC,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAQ,OAAME,KAAKC,UAAUJ,MAE1BC,CAAG,ECId,MAAMI,UAAqBC,MASvBC,YAAYC,EAAWC,GAEnBC,MADgBb,EAAiBW,EAAWC,IAE5CE,KAAKC,KAAOJ,EACZG,KAAKF,QAAUA,CACnB,EC8BJ,MCnDMI,EAAsB,IAAIC,ICHhC,MAAMC,EAAoB,CACtBC,gBAAiB,kBACjBC,SAAU,cACVC,OAAQ,UACRC,QAAS,UACTC,OAAgC,oBAAjBC,aAA+BA,aAAaC,MAAQ,IAEjEC,EAAoBC,GACf,CAACT,EAAkBG,OAAQM,EAAWT,EAAkBK,QAC1DK,QAAQC,GAAUA,GAASA,EAAMxB,OAAS,IAC1CyB,KAAK,KAODC,EAAa,CACtBC,cAAgBpB,IANSqB,KACzB,IAAK,MAAMC,KAAOC,OAAOC,KAAKlB,GAC1Be,EAAGC,EACP,EAIIG,EAAqBH,IACW,iBAAjBtB,EAAQsB,KACfhB,EAAkBgB,GAAOtB,EAAQsB,G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MACzB,CACA,GAAIA,IAAW1F,KAAKuF,SAASG,OACzB,MAAM,IAAI/E,EAAa,6BAA8B,CAAE+E,WAE3D,MAAMyB,EAAiBF,EAASG,QAE1BC,EAAe,CACjBC,QAAS,IAAIC,QAAQJ,EAAeG,SACpCE,OAAQL,EAAeK,OACvBC,WAAYN,EAAeM,YAGzBC,EAAuBR,EAAWA,EAASG,GAAgBA,EAI3DxD,EAAOJ,IACP0D,EAAetD,WACTsD,EAAeQ,OAC3B,OAAO,IAAI/D,SAASC,EAAM6D,EAC9B,+BCnCA,SAAoCrC,GAQhClE,EAAoByG,IAAIvC,EAI5B,wBCJA,SAA6BtE,GA6BzBmB,EAAWC,cAAcpB,EAC7B,gBC1CA,WAQSf,KAAK6H,aACd"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/cacheNames.d.ts b/tools/ui/node_modules/workbox-core/cacheNames.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ef6029c91d0a38c48ff202048e198392dae2c26a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/cacheNames.d.ts
@@ -0,0 +1,24 @@
+import './_version.js';
+/**
+ * Get the current cache names and prefix/suffix used by Workbox.
+ *
+ * `cacheNames.precache` is used for precached assets,
+ * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to
+ * store `analytics.js`, and `cacheNames.runtime` is used for everything else.
+ *
+ * `cacheNames.prefix` can be used to retrieve just the current prefix value.
+ * `cacheNames.suffix` can be used to retrieve just the current suffix value.
+ *
+ * @return {Object} An object with `precache`, `runtime`, `prefix`, and
+ *     `googleAnalytics` properties.
+ *
+ * @memberof workbox-core
+ */
+declare const cacheNames: {
+    readonly googleAnalytics: string;
+    readonly precache: string;
+    readonly prefix: string;
+    readonly runtime: string;
+    readonly suffix: string;
+};
+export { cacheNames };
diff --git a/tools/ui/node_modules/workbox-core/cacheNames.js b/tools/ui/node_modules/workbox-core/cacheNames.js
new file mode 100644
index 0000000000000000000000000000000000000000..4295c36aa96d3186f824e433b38f272c38488dee
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/cacheNames.js
@@ -0,0 +1,42 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { cacheNames as _cacheNames } from './_private/cacheNames.js';
+import './_version.js';
+/**
+ * Get the current cache names and prefix/suffix used by Workbox.
+ *
+ * `cacheNames.precache` is used for precached assets,
+ * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to
+ * store `analytics.js`, and `cacheNames.runtime` is used for everything else.
+ *
+ * `cacheNames.prefix` can be used to retrieve just the current prefix value.
+ * `cacheNames.suffix` can be used to retrieve just the current suffix value.
+ *
+ * @return {Object} An object with `precache`, `runtime`, `prefix`, and
+ *     `googleAnalytics` properties.
+ *
+ * @memberof workbox-core
+ */
+const cacheNames = {
+    get googleAnalytics() {
+        return _cacheNames.getGoogleAnalyticsName();
+    },
+    get precache() {
+        return _cacheNames.getPrecacheName();
+    },
+    get prefix() {
+        return _cacheNames.getPrefix();
+    },
+    get runtime() {
+        return _cacheNames.getRuntimeName();
+    },
+    get suffix() {
+        return _cacheNames.getSuffix();
+    },
+};
+export { cacheNames };
diff --git a/tools/ui/node_modules/workbox-core/cacheNames.mjs b/tools/ui/node_modules/workbox-core/cacheNames.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..2a299372164250b06c59b7f4a227ec39793abfa2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/cacheNames.mjs
@@ -0,0 +1 @@
+export * from './cacheNames.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/clientsClaim.d.ts b/tools/ui/node_modules/workbox-core/clientsClaim.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..61e75f51cd7d3c665c29f768197922a1ebe52784
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/clientsClaim.d.ts
@@ -0,0 +1,9 @@
+import './_version.js';
+/**
+ * Claim any currently available clients once the service worker
+ * becomes active. This is normally used in conjunction with `skipWaiting()`.
+ *
+ * @memberof workbox-core
+ */
+declare function clientsClaim(): void;
+export { clientsClaim };
diff --git a/tools/ui/node_modules/workbox-core/clientsClaim.js b/tools/ui/node_modules/workbox-core/clientsClaim.js
new file mode 100644
index 0000000000000000000000000000000000000000..5764bd180849d89c72ccad8edf864f57312fbf6e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/clientsClaim.js
@@ -0,0 +1,18 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import './_version.js';
+/**
+ * Claim any currently available clients once the service worker
+ * becomes active. This is normally used in conjunction with `skipWaiting()`.
+ *
+ * @memberof workbox-core
+ */
+function clientsClaim() {
+    self.addEventListener('activate', () => self.clients.claim());
+}
+export { clientsClaim };
diff --git a/tools/ui/node_modules/workbox-core/clientsClaim.mjs b/tools/ui/node_modules/workbox-core/clientsClaim.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..7cf3dc83e12d2a11341387d6e5b94a68420ed1bd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/clientsClaim.mjs
@@ -0,0 +1 @@
+export * from './clientsClaim.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/copyResponse.d.ts b/tools/ui/node_modules/workbox-core/copyResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2d07c4ef8b2d58f9fc2de844d797c14be51499bd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/copyResponse.d.ts
@@ -0,0 +1,22 @@
+import './_version.js';
+/**
+ * Allows developers to copy a response and modify its `headers`, `status`,
+ * or `statusText` values (the values settable via a
+ * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
+ * object in the constructor).
+ * To modify these values, pass a function as the second argument. That
+ * function will be invoked with a single object with the response properties
+ * `{headers, status, statusText}`. The return value of this function will
+ * be used as the `ResponseInit` for the new `Response`. To change the values
+ * either modify the passed parameter(s) and return it, or return a totally
+ * new object.
+ *
+ * This method is intentionally limited to same-origin responses, regardless of
+ * whether CORS was used or not.
+ *
+ * @param {Response} response
+ * @param {Function} modifier
+ * @memberof workbox-core
+ */
+declare function copyResponse(response: Response, modifier?: (responseInit: ResponseInit) => ResponseInit): Promise;
+export { copyResponse };
diff --git a/tools/ui/node_modules/workbox-core/copyResponse.js b/tools/ui/node_modules/workbox-core/copyResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..eaf23f1552596625910236b54395259c9fecba2c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/copyResponse.js
@@ -0,0 +1,57 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';
+import { WorkboxError } from './_private/WorkboxError.js';
+import './_version.js';
+/**
+ * Allows developers to copy a response and modify its `headers`, `status`,
+ * or `statusText` values (the values settable via a
+ * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
+ * object in the constructor).
+ * To modify these values, pass a function as the second argument. That
+ * function will be invoked with a single object with the response properties
+ * `{headers, status, statusText}`. The return value of this function will
+ * be used as the `ResponseInit` for the new `Response`. To change the values
+ * either modify the passed parameter(s) and return it, or return a totally
+ * new object.
+ *
+ * This method is intentionally limited to same-origin responses, regardless of
+ * whether CORS was used or not.
+ *
+ * @param {Response} response
+ * @param {Function} modifier
+ * @memberof workbox-core
+ */
+async function copyResponse(response, modifier) {
+    let origin = null;
+    // If response.url isn't set, assume it's cross-origin and keep origin null.
+    if (response.url) {
+        const responseURL = new URL(response.url);
+        origin = responseURL.origin;
+    }
+    if (origin !== self.location.origin) {
+        throw new WorkboxError('cross-origin-copy-response', { origin });
+    }
+    const clonedResponse = response.clone();
+    // Create a fresh `ResponseInit` object by cloning the headers.
+    const responseInit = {
+        headers: new Headers(clonedResponse.headers),
+        status: clonedResponse.status,
+        statusText: clonedResponse.statusText,
+    };
+    // Apply any user modifications.
+    const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;
+    // Create the new response from the body stream and `ResponseInit`
+    // modifications. Note: not all browsers support the Response.body stream,
+    // so fall back to reading the entire body into memory as a blob.
+    const body = canConstructResponseFromBodyStream()
+        ? clonedResponse.body
+        : await clonedResponse.blob();
+    return new Response(body, modifiedResponseInit);
+}
+export { copyResponse };
diff --git a/tools/ui/node_modules/workbox-core/copyResponse.mjs b/tools/ui/node_modules/workbox-core/copyResponse.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..03b1304e04691b74acd7b5ff4205305d3095d522
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/copyResponse.mjs
@@ -0,0 +1 @@
+export * from './copyResponse.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/index.d.ts b/tools/ui/node_modules/workbox-core/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..24363024973a4903462c6213f44801d0aafd73e6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/index.d.ts
@@ -0,0 +1,17 @@
+import { registerQuotaErrorCallback } from './registerQuotaErrorCallback.js';
+import * as _private from './_private.js';
+import { cacheNames } from './cacheNames.js';
+import { copyResponse } from './copyResponse.js';
+import { clientsClaim } from './clientsClaim.js';
+import { setCacheNameDetails } from './setCacheNameDetails.js';
+import { skipWaiting } from './skipWaiting.js';
+import './_version.js';
+/**
+ * All of the Workbox service worker libraries use workbox-core for shared
+ * code as well as setting default values that need to be shared (like cache
+ * names).
+ *
+ * @module workbox-core
+ */
+export { _private, cacheNames, clientsClaim, copyResponse, registerQuotaErrorCallback, setCacheNameDetails, skipWaiting, };
+export * from './types.js';
diff --git a/tools/ui/node_modules/workbox-core/index.js b/tools/ui/node_modules/workbox-core/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..eb1bac8b443a60fddc63ffacfa8164f998b2c4ef
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/index.js
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { registerQuotaErrorCallback } from './registerQuotaErrorCallback.js';
+import * as _private from './_private.js';
+import { cacheNames } from './cacheNames.js';
+import { copyResponse } from './copyResponse.js';
+import { clientsClaim } from './clientsClaim.js';
+import { setCacheNameDetails } from './setCacheNameDetails.js';
+import { skipWaiting } from './skipWaiting.js';
+import './_version.js';
+/**
+ * All of the Workbox service worker libraries use workbox-core for shared
+ * code as well as setting default values that need to be shared (like cache
+ * names).
+ *
+ * @module workbox-core
+ */
+export { _private, cacheNames, clientsClaim, copyResponse, registerQuotaErrorCallback, setCacheNameDetails, skipWaiting, };
+export * from './types.js';
diff --git a/tools/ui/node_modules/workbox-core/index.mjs b/tools/ui/node_modules/workbox-core/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.d.ts b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d4f63577d18568398e4648220147603ae043fe03
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.d.ts
@@ -0,0 +1,2 @@
+import '../../_version.js';
+export declare const messageGenerator: ((code: string, ...args: any[]) => string) | ((code: string, details?: {}) => string);
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.js b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.js
new file mode 100644
index 0000000000000000000000000000000000000000..6cb49824fa09c00c95f3571778cbcff42b77df37
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.js
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { messages } from './messages.js';
+import '../../_version.js';
+const fallback = (code, ...args) => {
+    let msg = code;
+    if (args.length > 0) {
+        msg += ` :: ${JSON.stringify(args)}`;
+    }
+    return msg;
+};
+const generatorFunction = (code, details = {}) => {
+    const message = messages[code];
+    if (!message) {
+        throw new Error(`Unable to find message for code '${code}'.`);
+    }
+    return message(details);
+};
+export const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.mjs b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..586814254108b2a14910fe25d7be8690b666fe36
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messageGenerator.mjs
@@ -0,0 +1 @@
+export * from './messageGenerator.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messages.d.ts b/tools/ui/node_modules/workbox-core/models/messages/messages.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1d9c63e41bf84ceca4336928c2d8168b4005ec47
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messages.d.ts
@@ -0,0 +1,9 @@
+import '../../_version.js';
+interface LoggableObject {
+    [key: string]: string | number;
+}
+interface MessageMap {
+    [messageID: string]: (param: LoggableObject) => string;
+}
+export declare const messages: MessageMap;
+export {};
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messages.js b/tools/ui/node_modules/workbox-core/models/messages/messages.js
new file mode 100644
index 0000000000000000000000000000000000000000..1ed5821158565175d2adce2b82a84a48f360a74d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messages.js
@@ -0,0 +1,228 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../../_version.js';
+export const messages = {
+    'invalid-value': ({ paramName, validValueDescription, value }) => {
+        if (!paramName || !validValueDescription) {
+            throw new Error(`Unexpected input to 'invalid-value' error.`);
+        }
+        return (`The '${paramName}' parameter was given a value with an ` +
+            `unexpected value. ${validValueDescription} Received a value of ` +
+            `${JSON.stringify(value)}.`);
+    },
+    'not-an-array': ({ moduleName, className, funcName, paramName }) => {
+        if (!moduleName || !className || !funcName || !paramName) {
+            throw new Error(`Unexpected input to 'not-an-array' error.`);
+        }
+        return (`The parameter '${paramName}' passed into ` +
+            `'${moduleName}.${className}.${funcName}()' must be an array.`);
+    },
+    'incorrect-type': ({ expectedType, paramName, moduleName, className, funcName, }) => {
+        if (!expectedType || !paramName || !moduleName || !funcName) {
+            throw new Error(`Unexpected input to 'incorrect-type' error.`);
+        }
+        const classNameStr = className ? `${className}.` : '';
+        return (`The parameter '${paramName}' passed into ` +
+            `'${moduleName}.${classNameStr}` +
+            `${funcName}()' must be of type ${expectedType}.`);
+    },
+    'incorrect-class': ({ expectedClassName, paramName, moduleName, className, funcName, isReturnValueProblem, }) => {
+        if (!expectedClassName || !moduleName || !funcName) {
+            throw new Error(`Unexpected input to 'incorrect-class' error.`);
+        }
+        const classNameStr = className ? `${className}.` : '';
+        if (isReturnValueProblem) {
+            return (`The return value from ` +
+                `'${moduleName}.${classNameStr}${funcName}()' ` +
+                `must be an instance of class ${expectedClassName}.`);
+        }
+        return (`The parameter '${paramName}' passed into ` +
+            `'${moduleName}.${classNameStr}${funcName}()' ` +
+            `must be an instance of class ${expectedClassName}.`);
+    },
+    'missing-a-method': ({ expectedMethod, paramName, moduleName, className, funcName, }) => {
+        if (!expectedMethod ||
+            !paramName ||
+            !moduleName ||
+            !className ||
+            !funcName) {
+            throw new Error(`Unexpected input to 'missing-a-method' error.`);
+        }
+        return (`${moduleName}.${className}.${funcName}() expected the ` +
+            `'${paramName}' parameter to expose a '${expectedMethod}' method.`);
+    },
+    'add-to-cache-list-unexpected-type': ({ entry }) => {
+        return (`An unexpected entry was passed to ` +
+            `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` +
+            `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` +
+            `strings with one or more characters, objects with a url property or ` +
+            `Request objects.`);
+    },
+    'add-to-cache-list-conflicting-entries': ({ firstEntry, secondEntry }) => {
+        if (!firstEntry || !secondEntry) {
+            throw new Error(`Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`);
+        }
+        return (`Two of the entries passed to ` +
+            `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
+            `${firstEntry} but different revision details. Workbox is ` +
+            `unable to cache and version the asset correctly. Please remove one ` +
+            `of the entries.`);
+    },
+    'plugin-error-request-will-fetch': ({ thrownErrorMessage }) => {
+        if (!thrownErrorMessage) {
+            throw new Error(`Unexpected input to ` + `'plugin-error-request-will-fetch', error.`);
+        }
+        return (`An error was thrown by a plugins 'requestWillFetch()' method. ` +
+            `The thrown error message was: '${thrownErrorMessage}'.`);
+    },
+    'invalid-cache-name': ({ cacheNameId, value }) => {
+        if (!cacheNameId) {
+            throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);
+        }
+        return (`You must provide a name containing at least one character for ` +
+            `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` +
+            `'${JSON.stringify(value)}'`);
+    },
+    'unregister-route-but-not-found-with-method': ({ method }) => {
+        if (!method) {
+            throw new Error(`Unexpected input to ` +
+                `'unregister-route-but-not-found-with-method' error.`);
+        }
+        return (`The route you're trying to unregister was not  previously ` +
+            `registered for the method type '${method}'.`);
+    },
+    'unregister-route-route-not-registered': () => {
+        return (`The route you're trying to unregister was not previously ` +
+            `registered.`);
+    },
+    'queue-replay-failed': ({ name }) => {
+        return `Replaying the background sync queue '${name}' failed.`;
+    },
+    'duplicate-queue-name': ({ name }) => {
+        return (`The Queue name '${name}' is already being used. ` +
+            `All instances of backgroundSync.Queue must be given unique names.`);
+    },
+    'expired-test-without-max-age': ({ methodName, paramName }) => {
+        return (`The '${methodName}()' method can only be used when the ` +
+            `'${paramName}' is used in the constructor.`);
+    },
+    'unsupported-route-type': ({ moduleName, className, funcName, paramName }) => {
+        return (`The supplied '${paramName}' parameter was an unsupported type. ` +
+            `Please check the docs for ${moduleName}.${className}.${funcName} for ` +
+            `valid input types.`);
+    },
+    'not-array-of-class': ({ value, expectedClass, moduleName, className, funcName, paramName, }) => {
+        return (`The supplied '${paramName}' parameter must be an array of ` +
+            `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` +
+            `Please check the call to ${moduleName}.${className}.${funcName}() ` +
+            `to fix the issue.`);
+    },
+    'max-entries-or-age-required': ({ moduleName, className, funcName }) => {
+        return (`You must define either config.maxEntries or config.maxAgeSeconds` +
+            `in ${moduleName}.${className}.${funcName}`);
+    },
+    'statuses-or-headers-required': ({ moduleName, className, funcName }) => {
+        return (`You must define either config.statuses or config.headers` +
+            `in ${moduleName}.${className}.${funcName}`);
+    },
+    'invalid-string': ({ moduleName, funcName, paramName }) => {
+        if (!paramName || !moduleName || !funcName) {
+            throw new Error(`Unexpected input to 'invalid-string' error.`);
+        }
+        return (`When using strings, the '${paramName}' parameter must start with ` +
+            `'http' (for cross-origin matches) or '/' (for same-origin matches). ` +
+            `Please see the docs for ${moduleName}.${funcName}() for ` +
+            `more info.`);
+    },
+    'channel-name-required': () => {
+        return (`You must provide a channelName to construct a ` +
+            `BroadcastCacheUpdate instance.`);
+    },
+    'invalid-responses-are-same-args': () => {
+        return (`The arguments passed into responsesAreSame() appear to be ` +
+            `invalid. Please ensure valid Responses are used.`);
+    },
+    'expire-custom-caches-only': () => {
+        return (`You must provide a 'cacheName' property when using the ` +
+            `expiration plugin with a runtime caching strategy.`);
+    },
+    'unit-must-be-bytes': ({ normalizedRangeHeader }) => {
+        if (!normalizedRangeHeader) {
+            throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);
+        }
+        return (`The 'unit' portion of the Range header must be set to 'bytes'. ` +
+            `The Range header provided was "${normalizedRangeHeader}"`);
+    },
+    'single-range-only': ({ normalizedRangeHeader }) => {
+        if (!normalizedRangeHeader) {
+            throw new Error(`Unexpected input to 'single-range-only' error.`);
+        }
+        return (`Multiple ranges are not supported. Please use a  single start ` +
+            `value, and optional end value. The Range header provided was ` +
+            `"${normalizedRangeHeader}"`);
+    },
+    'invalid-range-values': ({ normalizedRangeHeader }) => {
+        if (!normalizedRangeHeader) {
+            throw new Error(`Unexpected input to 'invalid-range-values' error.`);
+        }
+        return (`The Range header is missing both start and end values. At least ` +
+            `one of those values is needed. The Range header provided was ` +
+            `"${normalizedRangeHeader}"`);
+    },
+    'no-range-header': () => {
+        return `No Range header was found in the Request provided.`;
+    },
+    'range-not-satisfiable': ({ size, start, end }) => {
+        return (`The start (${start}) and end (${end}) values in the Range are ` +
+            `not satisfiable by the cached response, which is ${size} bytes.`);
+    },
+    'attempt-to-cache-non-get-request': ({ url, method }) => {
+        return (`Unable to cache '${url}' because it is a '${method}' request and ` +
+            `only 'GET' requests can be cached.`);
+    },
+    'cache-put-with-no-response': ({ url }) => {
+        return (`There was an attempt to cache '${url}' but the response was not ` +
+            `defined.`);
+    },
+    'no-response': ({ url, error }) => {
+        let message = `The strategy could not generate a response for '${url}'.`;
+        if (error) {
+            message += ` The underlying error is ${error}.`;
+        }
+        return message;
+    },
+    'bad-precaching-response': ({ url, status }) => {
+        return (`The precaching request for '${url}' failed` +
+            (status ? ` with an HTTP status of ${status}.` : `.`));
+    },
+    'non-precached-url': ({ url }) => {
+        return (`createHandlerBoundToURL('${url}') was called, but that URL is ` +
+            `not precached. Please pass in a URL that is precached instead.`);
+    },
+    'add-to-cache-list-conflicting-integrities': ({ url }) => {
+        return (`Two of the entries passed to ` +
+            `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
+            `${url} with different integrity values. Please remove one of them.`);
+    },
+    'missing-precache-entry': ({ cacheName, url }) => {
+        return `Unable to find a precached response in ${cacheName} for ${url}.`;
+    },
+    'cross-origin-copy-response': ({ origin }) => {
+        return (`workbox-core.copyResponse() can only be used with same-origin ` +
+            `responses. It was passed a response with origin ${origin}.`);
+    },
+    'opaque-streams-source': ({ type }) => {
+        const message = `One of the workbox-streams sources resulted in an ` +
+            `'${type}' response.`;
+        if (type === 'opaqueredirect') {
+            return (`${message} Please do not use a navigation request that results ` +
+                `in a redirect as a source.`);
+        }
+        return `${message} Please ensure your sources are CORS-enabled.`;
+    },
+};
diff --git a/tools/ui/node_modules/workbox-core/models/messages/messages.mjs b/tools/ui/node_modules/workbox-core/models/messages/messages.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..fcad226c2238011ab36b9799e8999b5109083c3e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/messages/messages.mjs
@@ -0,0 +1 @@
+export * from './messages.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/models/pluginEvents.d.ts b/tools/ui/node_modules/workbox-core/models/pluginEvents.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dfd5077e1631b493ce91556796d0e6e744dc372c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/pluginEvents.d.ts
@@ -0,0 +1,10 @@
+import '../_version.js';
+export declare const enum pluginEvents {
+    CACHE_DID_UPDATE = "cacheDidUpdate",
+    CACHE_KEY_WILL_BE_USED = "cacheKeyWillBeUsed",
+    CACHE_WILL_UPDATE = "cacheWillUpdate",
+    CACHED_RESPONSE_WILL_BE_USED = "cachedResponseWillBeUsed",
+    FETCH_DID_FAIL = "fetchDidFail",
+    FETCH_DID_SUCCEED = "fetchDidSucceed",
+    REQUEST_WILL_FETCH = "requestWillFetch"
+}
diff --git a/tools/ui/node_modules/workbox-core/models/pluginEvents.js b/tools/ui/node_modules/workbox-core/models/pluginEvents.js
new file mode 100644
index 0000000000000000000000000000000000000000..4db5bbd99a29d3906d9f54ccee1fd984bca2d0a9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/pluginEvents.js
@@ -0,0 +1,18 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+export var pluginEvents;
+(function (pluginEvents) {
+    pluginEvents["CACHE_DID_UPDATE"] = "cacheDidUpdate";
+    pluginEvents["CACHE_KEY_WILL_BE_USED"] = "cacheKeyWillBeUsed";
+    pluginEvents["CACHE_WILL_UPDATE"] = "cacheWillUpdate";
+    pluginEvents["CACHED_RESPONSE_WILL_BE_USED"] = "cachedResponseWillBeUsed";
+    pluginEvents["FETCH_DID_FAIL"] = "fetchDidFail";
+    pluginEvents["FETCH_DID_SUCCEED"] = "fetchDidSucceed";
+    pluginEvents["REQUEST_WILL_FETCH"] = "requestWillFetch";
+})(pluginEvents || (pluginEvents = {}));
diff --git a/tools/ui/node_modules/workbox-core/models/pluginEvents.mjs b/tools/ui/node_modules/workbox-core/models/pluginEvents.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..d9cdbe66bb5cc9c182e2c31dde0c66d5be08ee7b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/pluginEvents.mjs
@@ -0,0 +1 @@
+export * from './pluginEvents.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.d.ts b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b179075840132768eaa15a6611859e7eb77b5660
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.d.ts
@@ -0,0 +1,3 @@
+import '../_version.js';
+declare const quotaErrorCallbacks: Set;
+export { quotaErrorCallbacks };
diff --git a/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.js b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.js
new file mode 100644
index 0000000000000000000000000000000000000000..f0b9b2251728b6c412b3e964bd29db4b8733dc11
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.js
@@ -0,0 +1,13 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+// Callbacks to be executed whenever there's a quota error.
+// Can't change Function type right now.
+// eslint-disable-next-line @typescript-eslint/ban-types
+const quotaErrorCallbacks = new Set();
+export { quotaErrorCallbacks };
diff --git a/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.mjs b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..b5e60ec663da2a72ac4af5e0f6f6e1be31327ca5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/models/quotaErrorCallbacks.mjs
@@ -0,0 +1 @@
+export * from './quotaErrorCallbacks.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/package.json b/tools/ui/node_modules/workbox-core/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..7368969fb9cc8571e12cf7848b53b4a1bb20aba9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "workbox-core",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "This module is used by a number of the other Workbox modules to share common code.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.core",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.d.ts b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a8bd4683c672b9a31d2ad1ff235a5525b15ba68a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.d.ts
@@ -0,0 +1,10 @@
+import './_version.js';
+/**
+ * Adds a function to the set of quotaErrorCallbacks that will be executed if
+ * there's a quota error.
+ *
+ * @param {Function} callback
+ * @memberof workbox-core
+ */
+declare function registerQuotaErrorCallback(callback: Function): void;
+export { registerQuotaErrorCallback };
diff --git a/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.js b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.js
new file mode 100644
index 0000000000000000000000000000000000000000..0aed841c1662b167e4e06fef63d61ef245d10d4e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.js
@@ -0,0 +1,34 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from './_private/logger.js';
+import { assert } from './_private/assert.js';
+import { quotaErrorCallbacks } from './models/quotaErrorCallbacks.js';
+import './_version.js';
+/**
+ * Adds a function to the set of quotaErrorCallbacks that will be executed if
+ * there's a quota error.
+ *
+ * @param {Function} callback
+ * @memberof workbox-core
+ */
+// Can't change Function type
+// eslint-disable-next-line @typescript-eslint/ban-types
+function registerQuotaErrorCallback(callback) {
+    if (process.env.NODE_ENV !== 'production') {
+        assert.isType(callback, 'function', {
+            moduleName: 'workbox-core',
+            funcName: 'register',
+            paramName: 'callback',
+        });
+    }
+    quotaErrorCallbacks.add(callback);
+    if (process.env.NODE_ENV !== 'production') {
+        logger.log('Registered a callback to respond to quota errors.', callback);
+    }
+}
+export { registerQuotaErrorCallback };
diff --git a/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.mjs b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..95a6522a4b4a45ddb1c9165b1bd79d114b75b011
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/registerQuotaErrorCallback.mjs
@@ -0,0 +1 @@
+export * from './registerQuotaErrorCallback.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/setCacheNameDetails.d.ts b/tools/ui/node_modules/workbox-core/setCacheNameDetails.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..68ec8ec44aa67a13e48b19907774c1c9eea69860
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/setCacheNameDetails.d.ts
@@ -0,0 +1,21 @@
+import { PartialCacheNameDetails } from './_private/cacheNames.js';
+import './_version.js';
+/**
+ * Modifies the default cache names used by the Workbox packages.
+ * Cache names are generated as `--`.
+ *
+ * @param {Object} details
+ * @param {Object} [details.prefix] The string to add to the beginning of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.suffix] The string to add to the end of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.precache] The cache name to use for precache
+ *     caching.
+ * @param {Object} [details.runtime] The cache name to use for runtime caching.
+ * @param {Object} [details.googleAnalytics] The cache name to use for
+ *     `workbox-google-analytics` caching.
+ *
+ * @memberof workbox-core
+ */
+declare function setCacheNameDetails(details: PartialCacheNameDetails): void;
+export { setCacheNameDetails };
diff --git a/tools/ui/node_modules/workbox-core/setCacheNameDetails.js b/tools/ui/node_modules/workbox-core/setCacheNameDetails.js
new file mode 100644
index 0000000000000000000000000000000000000000..4857f1ce173eb3a421b63dc275c90f50f420dea3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/setCacheNameDetails.js
@@ -0,0 +1,60 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from './_private/assert.js';
+import { cacheNames } from './_private/cacheNames.js';
+import { WorkboxError } from './_private/WorkboxError.js';
+import './_version.js';
+/**
+ * Modifies the default cache names used by the Workbox packages.
+ * Cache names are generated as `--`.
+ *
+ * @param {Object} details
+ * @param {Object} [details.prefix] The string to add to the beginning of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.suffix] The string to add to the end of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.precache] The cache name to use for precache
+ *     caching.
+ * @param {Object} [details.runtime] The cache name to use for runtime caching.
+ * @param {Object} [details.googleAnalytics] The cache name to use for
+ *     `workbox-google-analytics` caching.
+ *
+ * @memberof workbox-core
+ */
+function setCacheNameDetails(details) {
+    if (process.env.NODE_ENV !== 'production') {
+        Object.keys(details).forEach((key) => {
+            assert.isType(details[key], 'string', {
+                moduleName: 'workbox-core',
+                funcName: 'setCacheNameDetails',
+                paramName: `details.${key}`,
+            });
+        });
+        if ('precache' in details && details['precache'].length === 0) {
+            throw new WorkboxError('invalid-cache-name', {
+                cacheNameId: 'precache',
+                value: details['precache'],
+            });
+        }
+        if ('runtime' in details && details['runtime'].length === 0) {
+            throw new WorkboxError('invalid-cache-name', {
+                cacheNameId: 'runtime',
+                value: details['runtime'],
+            });
+        }
+        if ('googleAnalytics' in details &&
+            details['googleAnalytics'].length === 0) {
+            throw new WorkboxError('invalid-cache-name', {
+                cacheNameId: 'googleAnalytics',
+                value: details['googleAnalytics'],
+            });
+        }
+    }
+    cacheNames.updateDetails(details);
+}
+export { setCacheNameDetails };
diff --git a/tools/ui/node_modules/workbox-core/setCacheNameDetails.mjs b/tools/ui/node_modules/workbox-core/setCacheNameDetails.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..bee80bc9a7c268d7c84d2f5ed1bef6d5af7408b2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/setCacheNameDetails.mjs
@@ -0,0 +1 @@
+export * from './setCacheNameDetails.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/skipWaiting.d.ts b/tools/ui/node_modules/workbox-core/skipWaiting.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4162fb145039815c6abcb444e863ba0770102b83
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/skipWaiting.d.ts
@@ -0,0 +1,10 @@
+import './_version.js';
+/**
+ * This method is deprecated, and will be removed in Workbox v7.
+ *
+ * Calling self.skipWaiting() is equivalent, and should be used instead.
+ *
+ * @memberof workbox-core
+ */
+declare function skipWaiting(): void;
+export { skipWaiting };
diff --git a/tools/ui/node_modules/workbox-core/skipWaiting.js b/tools/ui/node_modules/workbox-core/skipWaiting.js
new file mode 100644
index 0000000000000000000000000000000000000000..765893683727ecb883b1211f34d02a154ddf8eed
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/skipWaiting.js
@@ -0,0 +1,27 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from './_private/logger.js';
+import './_version.js';
+/**
+ * This method is deprecated, and will be removed in Workbox v7.
+ *
+ * Calling self.skipWaiting() is equivalent, and should be used instead.
+ *
+ * @memberof workbox-core
+ */
+function skipWaiting() {
+    // Just call self.skipWaiting() directly.
+    // See https://github.com/GoogleChrome/workbox/issues/2525
+    if (process.env.NODE_ENV !== 'production') {
+        logger.warn(`skipWaiting() from workbox-core is no longer recommended ` +
+            `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +
+            `is equivalent.`);
+    }
+    void self.skipWaiting();
+}
+export { skipWaiting };
diff --git a/tools/ui/node_modules/workbox-core/skipWaiting.mjs b/tools/ui/node_modules/workbox-core/skipWaiting.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..47fb97da2bbe8fd548312c24421980a4cc509e0d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/skipWaiting.mjs
@@ -0,0 +1 @@
+export * from './skipWaiting.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/src/_private.ts b/tools/ui/node_modules/workbox-core/src/_private.ts
new file mode 100644
index 0000000000000000000000000000000000000000..455b7cd08f965279b5b1a374d0fcf7ed5ccb58ec
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private.ts
@@ -0,0 +1,42 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+// We either expose defaults or we expose every named export.
+import {assert} from './_private/assert.js';
+import {cacheNames} from './_private/cacheNames.js';
+import {cacheMatchIgnoreParams} from './_private/cacheMatchIgnoreParams.js';
+import {canConstructReadableStream} from './_private/canConstructReadableStream.js';
+import {canConstructResponseFromBodyStream} from './_private/canConstructResponseFromBodyStream.js';
+import {dontWaitFor} from './_private/dontWaitFor.js';
+import {Deferred} from './_private/Deferred.js';
+import {executeQuotaErrorCallbacks} from './_private/executeQuotaErrorCallbacks.js';
+import {getFriendlyURL} from './_private/getFriendlyURL.js';
+import {logger} from './_private/logger.js';
+import {resultingClientExists} from './_private/resultingClientExists.js';
+import {timeout} from './_private/timeout.js';
+import {waitUntil} from './_private/waitUntil.js';
+import {WorkboxError} from './_private/WorkboxError.js';
+
+import './_version.js';
+
+export {
+  assert,
+  cacheMatchIgnoreParams,
+  cacheNames,
+  canConstructReadableStream,
+  canConstructResponseFromBodyStream,
+  dontWaitFor,
+  Deferred,
+  executeQuotaErrorCallbacks,
+  getFriendlyURL,
+  logger,
+  resultingClientExists,
+  timeout,
+  waitUntil,
+  WorkboxError,
+};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/Deferred.ts b/tools/ui/node_modules/workbox-core/src/_private/Deferred.ts
new file mode 100644
index 0000000000000000000000000000000000000000..66f2197410e3562a8b4d1b56577d88c126ae46cf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/Deferred.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+/**
+ * The Deferred class composes Promises in a way that allows for them to be
+ * resolved or rejected from outside the constructor. In most cases promises
+ * should be used directly, but Deferreds can be necessary when the logic to
+ * resolve a promise must be separate.
+ *
+ * @private
+ */
+class Deferred {
+  promise: Promise;
+  resolve!: (value: T) => void;
+  reject!: (reason?: any) => void;
+
+  /**
+   * Creates a promise and exposes its resolve and reject functions as methods.
+   */
+  constructor() {
+    this.promise = new Promise((resolve, reject) => {
+      this.resolve = resolve;
+      this.reject = reject;
+    });
+  }
+}
+
+export {Deferred};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/WorkboxError.ts b/tools/ui/node_modules/workbox-core/src/_private/WorkboxError.ts
new file mode 100644
index 0000000000000000000000000000000000000000..edc4214344531ee4dfc3b5e5dc7aca0524edf607
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/WorkboxError.ts
@@ -0,0 +1,43 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {messageGenerator} from '../models/messages/messageGenerator.js';
+import {MapLikeObject} from '../types.js';
+import '../_version.js';
+
+/**
+ * Workbox errors should be thrown with this class.
+ * This allows use to ensure the type easily in tests,
+ * helps developers identify errors from workbox
+ * easily and allows use to optimise error
+ * messages correctly.
+ *
+ * @private
+ */
+class WorkboxError extends Error {
+  details?: MapLikeObject;
+
+  /**
+   *
+   * @param {string} errorCode The error code that
+   * identifies this particular error.
+   * @param {Object=} details Any relevant arguments
+   * that will help developers identify issues should
+   * be added as a key on the context object.
+   */
+  constructor(errorCode: string, details?: MapLikeObject) {
+    const message = messageGenerator(errorCode, details);
+
+    super(message);
+
+    this.name = errorCode;
+    this.details = details;
+  }
+}
+
+export {WorkboxError};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/assert.ts b/tools/ui/node_modules/workbox-core/src/_private/assert.ts
new file mode 100644
index 0000000000000000000000000000000000000000..025f96062c12457219e5c0b1a2d24b218a5c10bf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/assert.ts
@@ -0,0 +1,100 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxError} from '../_private/WorkboxError.js';
+import {MapLikeObject} from '../types.js';
+import '../_version.js';
+
+/*
+ * This method throws if the supplied value is not an array.
+ * The destructed values are required to produce a meaningful error for users.
+ * The destructed and restructured object is so it's clear what is
+ * needed.
+ */
+const isArray = (value: any[], details: MapLikeObject) => {
+  if (!Array.isArray(value)) {
+    throw new WorkboxError('not-an-array', details);
+  }
+};
+
+const hasMethod = (
+  object: MapLikeObject,
+  expectedMethod: string,
+  details: MapLikeObject,
+) => {
+  const type = typeof object[expectedMethod];
+  if (type !== 'function') {
+    details['expectedMethod'] = expectedMethod;
+    throw new WorkboxError('missing-a-method', details);
+  }
+};
+
+const isType = (
+  object: unknown,
+  expectedType: string,
+  details: MapLikeObject,
+) => {
+  if (typeof object !== expectedType) {
+    details['expectedType'] = expectedType;
+    throw new WorkboxError('incorrect-type', details);
+  }
+};
+
+const isInstance = (
+  object: unknown,
+  // Need the general type to do the check later.
+  // eslint-disable-next-line @typescript-eslint/ban-types
+  expectedClass: Function,
+  details: MapLikeObject,
+) => {
+  if (!(object instanceof expectedClass)) {
+    details['expectedClassName'] = expectedClass.name;
+    throw new WorkboxError('incorrect-class', details);
+  }
+};
+
+const isOneOf = (value: any, validValues: any[], details: MapLikeObject) => {
+  if (!validValues.includes(value)) {
+    details['validValueDescription'] = `Valid values are ${JSON.stringify(
+      validValues,
+    )}.`;
+    throw new WorkboxError('invalid-value', details);
+  }
+};
+
+const isArrayOfClass = (
+  value: any,
+  // Need general type to do check later.
+  expectedClass: Function, // eslint-disable-line
+  details: MapLikeObject,
+) => {
+  const error = new WorkboxError('not-array-of-class', details);
+  if (!Array.isArray(value)) {
+    throw error;
+  }
+
+  for (const item of value) {
+    if (!(item instanceof expectedClass)) {
+      throw error;
+    }
+  }
+};
+
+const finalAssertExports =
+  process.env.NODE_ENV === 'production'
+    ? null
+    : {
+        hasMethod,
+        isArray,
+        isInstance,
+        isOneOf,
+        isType,
+        isArrayOfClass,
+      };
+
+export {finalAssertExports as assert};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/cacheMatchIgnoreParams.ts b/tools/ui/node_modules/workbox-core/src/_private/cacheMatchIgnoreParams.ts
new file mode 100644
index 0000000000000000000000000000000000000000..93c7126825a70e4aacd80cabc7fc2bc47a8bb61c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/cacheMatchIgnoreParams.ts
@@ -0,0 +1,56 @@
+/*
+  Copyright 2020 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+function stripParams(fullURL: string, ignoreParams: string[]) {
+  const strippedURL = new URL(fullURL);
+  for (const param of ignoreParams) {
+    strippedURL.searchParams.delete(param);
+  }
+  return strippedURL.href;
+}
+
+/**
+ * Matches an item in the cache, ignoring specific URL params. This is similar
+ * to the `ignoreSearch` option, but it allows you to ignore just specific
+ * params (while continuing to match on the others).
+ *
+ * @private
+ * @param {Cache} cache
+ * @param {Request} request
+ * @param {Object} matchOptions
+ * @param {Array} ignoreParams
+ * @return {Promise}
+ */
+async function cacheMatchIgnoreParams(
+  cache: Cache,
+  request: Request,
+  ignoreParams: string[],
+  matchOptions?: CacheQueryOptions,
+): Promise {
+  const strippedRequestURL = stripParams(request.url, ignoreParams);
+
+  // If the request doesn't include any ignored params, match as normal.
+  if (request.url === strippedRequestURL) {
+    return cache.match(request, matchOptions);
+  }
+
+  // Otherwise, match by comparing keys
+  const keysOptions = {...matchOptions, ignoreSearch: true};
+  const cacheKeys = await cache.keys(request, keysOptions);
+
+  for (const cacheKey of cacheKeys) {
+    const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
+    if (strippedRequestURL === strippedCacheKeyURL) {
+      return cache.match(cacheKey, matchOptions);
+    }
+  }
+  return;
+}
+
+export {cacheMatchIgnoreParams};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/cacheNames.ts b/tools/ui/node_modules/workbox-core/src/_private/cacheNames.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6a4a5cb564396670faceeb0913e000953fe6f940
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/cacheNames.ts
@@ -0,0 +1,75 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+declare let registration: ServiceWorkerRegistration | undefined;
+
+export interface CacheNameDetails {
+  googleAnalytics: string;
+  precache: string;
+  prefix: string;
+  runtime: string;
+  suffix: string;
+}
+
+export interface PartialCacheNameDetails {
+  [propName: string]: string;
+}
+
+export type CacheNameDetailsProp =
+  | 'googleAnalytics'
+  | 'precache'
+  | 'prefix'
+  | 'runtime'
+  | 'suffix';
+
+const _cacheNameDetails: CacheNameDetails = {
+  googleAnalytics: 'googleAnalytics',
+  precache: 'precache-v2',
+  prefix: 'workbox',
+  runtime: 'runtime',
+  suffix: typeof registration !== 'undefined' ? registration.scope : '',
+};
+
+const _createCacheName = (cacheName: string): string => {
+  return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]
+    .filter((value) => value && value.length > 0)
+    .join('-');
+};
+
+const eachCacheNameDetail = (fn: (key: CacheNameDetailsProp) => void): void => {
+  for (const key of Object.keys(_cacheNameDetails)) {
+    fn(key as CacheNameDetailsProp);
+  }
+};
+
+export const cacheNames = {
+  updateDetails: (details: PartialCacheNameDetails): void => {
+    eachCacheNameDetail((key: CacheNameDetailsProp): void => {
+      if (typeof details[key] === 'string') {
+        _cacheNameDetails[key] = details[key];
+      }
+    });
+  },
+  getGoogleAnalyticsName: (userCacheName?: string): string => {
+    return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
+  },
+  getPrecacheName: (userCacheName?: string): string => {
+    return userCacheName || _createCacheName(_cacheNameDetails.precache);
+  },
+  getPrefix: (): string => {
+    return _cacheNameDetails.prefix;
+  },
+  getRuntimeName: (userCacheName?: string): string => {
+    return userCacheName || _createCacheName(_cacheNameDetails.runtime);
+  },
+  getSuffix: (): string => {
+    return _cacheNameDetails.suffix;
+  },
+};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/canConstructReadableStream.ts b/tools/ui/node_modules/workbox-core/src/_private/canConstructReadableStream.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dc839089e7fb3a2c4764da2047667fbcadfe5d90
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/canConstructReadableStream.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+let supportStatus: boolean | undefined;
+
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
+ * object.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `ReadableStream`, `false` otherwise.
+ *
+ * @private
+ */
+function canConstructReadableStream(): boolean {
+  if (supportStatus === undefined) {
+    // See https://github.com/GoogleChrome/workbox/issues/1473
+    try {
+      new ReadableStream({start() {}});
+      supportStatus = true;
+    } catch (error) {
+      supportStatus = false;
+    }
+  }
+
+  return supportStatus;
+}
+
+export {canConstructReadableStream};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/canConstructResponseFromBodyStream.ts b/tools/ui/node_modules/workbox-core/src/_private/canConstructResponseFromBodyStream.ts
new file mode 100644
index 0000000000000000000000000000000000000000..00aa901be380e43b64a82c8bf9a72c9bfa66b37c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/canConstructResponseFromBodyStream.ts
@@ -0,0 +1,40 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+let supportStatus: boolean | undefined;
+
+/**
+ * A utility function that determines whether the current browser supports
+ * constructing a new `Response` from a `response.body` stream.
+ *
+ * @return {boolean} `true`, if the current browser can successfully
+ *     construct a `Response` from a `response.body` stream, `false` otherwise.
+ *
+ * @private
+ */
+function canConstructResponseFromBodyStream(): boolean {
+  if (supportStatus === undefined) {
+    const testResponse = new Response('');
+
+    if ('body' in testResponse) {
+      try {
+        new Response(testResponse.body);
+        supportStatus = true;
+      } catch (error) {
+        supportStatus = false;
+      }
+    }
+    supportStatus = false;
+  }
+
+  return supportStatus;
+}
+
+export {canConstructResponseFromBodyStream};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/dontWaitFor.ts b/tools/ui/node_modules/workbox-core/src/_private/dontWaitFor.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a2f731aa501fbd5f1dd5423a91cba6a57a1ce176
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/dontWaitFor.ts
@@ -0,0 +1,18 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+/**
+ * A helper function that prevents a promise from being flagged as unused.
+ *
+ * @private
+ **/
+export function dontWaitFor(promise: Promise): void {
+  // Effective no-op.
+  void promise.then(() => {});
+}
diff --git a/tools/ui/node_modules/workbox-core/src/_private/executeQuotaErrorCallbacks.ts b/tools/ui/node_modules/workbox-core/src/_private/executeQuotaErrorCallbacks.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a299af170ef6534b3212d7e0a4741b6ad0766763
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/executeQuotaErrorCallbacks.ts
@@ -0,0 +1,40 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from '../_private/logger.js';
+import {quotaErrorCallbacks} from '../models/quotaErrorCallbacks.js';
+import '../_version.js';
+
+/**
+ * Runs all of the callback functions, one at a time sequentially, in the order
+ * in which they were registered.
+ *
+ * @memberof workbox-core
+ * @private
+ */
+async function executeQuotaErrorCallbacks(): Promise {
+  if (process.env.NODE_ENV !== 'production') {
+    logger.log(
+      `About to run ${quotaErrorCallbacks.size} ` +
+        `callbacks to clean up caches.`,
+    );
+  }
+
+  for (const callback of quotaErrorCallbacks) {
+    await callback();
+    if (process.env.NODE_ENV !== 'production') {
+      logger.log(callback, 'is complete.');
+    }
+  }
+
+  if (process.env.NODE_ENV !== 'production') {
+    logger.log('Finished running callbacks.');
+  }
+}
+
+export {executeQuotaErrorCallbacks};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/getFriendlyURL.ts b/tools/ui/node_modules/workbox-core/src/_private/getFriendlyURL.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0890c8e74e0de89fd50a3ac17c405be2efebc289
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/getFriendlyURL.ts
@@ -0,0 +1,18 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+const getFriendlyURL = (url: URL | string): string => {
+  const urlObj = new URL(String(url), location.href);
+  // See https://github.com/GoogleChrome/workbox/issues/2323
+  // We want to include everything, except for the origin if it's same-origin.
+  return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
+};
+
+export {getFriendlyURL};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/logger.ts b/tools/ui/node_modules/workbox-core/src/_private/logger.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0334c461435ddec635efbd449603e91c60ecc3a5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/logger.ts
@@ -0,0 +1,100 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+// logger is used inside of both service workers and the window global scope.
+declare global {
+  interface WorkerGlobalScope {
+    __WB_DISABLE_DEV_LOGS: boolean;
+  }
+
+  interface Window {
+    __WB_DISABLE_DEV_LOGS: boolean;
+  }
+}
+
+type LoggerMethods =
+  | 'debug'
+  | 'log'
+  | 'warn'
+  | 'error'
+  | 'groupCollapsed'
+  | 'groupEnd';
+
+const logger = (
+  process.env.NODE_ENV === 'production'
+    ? null
+    : (() => {
+        // Don't overwrite this value if it's already set.
+        // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
+        if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {
+          self.__WB_DISABLE_DEV_LOGS = false;
+        }
+
+        let inGroup = false;
+
+        const methodToColorMap: {[methodName: string]: string | null} = {
+          debug: `#7f8c8d`, // Gray
+          log: `#2ecc71`, // Green
+          warn: `#f39c12`, // Yellow
+          error: `#c0392b`, // Red
+          groupCollapsed: `#3498db`, // Blue
+          groupEnd: null, // No colored prefix on groupEnd
+        };
+
+        const print = function (method: LoggerMethods, args: any[]) {
+          if (self.__WB_DISABLE_DEV_LOGS) {
+            return;
+          }
+
+          if (method === 'groupCollapsed') {
+            // Safari doesn't print all console.groupCollapsed() arguments:
+            // https://bugs.webkit.org/show_bug.cgi?id=182754
+            if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
+              console[method](...args);
+              return;
+            }
+          }
+
+          const styles = [
+            `background: ${methodToColorMap[method]!}`,
+            `border-radius: 0.5em`,
+            `color: white`,
+            `font-weight: bold`,
+            `padding: 2px 0.5em`,
+          ];
+
+          // When in a group, the workbox prefix is not displayed.
+          const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];
+
+          console[method](...logPrefix, ...args);
+
+          if (method === 'groupCollapsed') {
+            inGroup = true;
+          }
+          if (method === 'groupEnd') {
+            inGroup = false;
+          }
+        };
+        // eslint-disable-next-line @typescript-eslint/ban-types
+        const api: {[methodName: string]: Function} = {};
+        const loggerMethods = Object.keys(methodToColorMap);
+
+        for (const key of loggerMethods) {
+          const method = key as LoggerMethods;
+
+          api[method] = (...args: any[]) => {
+            print(method, args);
+          };
+        }
+
+        return api as unknown;
+      })()
+) as Console;
+
+export {logger};
diff --git a/tools/ui/node_modules/workbox-core/src/_private/resultingClientExists.ts b/tools/ui/node_modules/workbox-core/src/_private/resultingClientExists.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b5decc6fd12f72400fc22a9438d3e764da422929
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/resultingClientExists.ts
@@ -0,0 +1,62 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {timeout} from './timeout.js';
+import '../_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+const MAX_RETRY_TIME = 2000;
+
+/**
+ * Returns a promise that resolves to a window client matching the passed
+ * `resultingClientId`. For browsers that don't support `resultingClientId`
+ * or if waiting for the resulting client to apper takes too long, resolve to
+ * `undefined`.
+ *
+ * @param {string} [resultingClientId]
+ * @return {Promise}
+ * @private
+ */
+export async function resultingClientExists(
+  resultingClientId?: string,
+): Promise {
+  if (!resultingClientId) {
+    return;
+  }
+
+  let existingWindows = await self.clients.matchAll({type: 'window'});
+  const existingWindowIds = new Set(existingWindows.map((w) => w.id));
+
+  let resultingWindow;
+  const startTime = performance.now();
+
+  // Only wait up to `MAX_RETRY_TIME` to find a matching client.
+  while (performance.now() - startTime < MAX_RETRY_TIME) {
+    existingWindows = await self.clients.matchAll({type: 'window'});
+
+    resultingWindow = existingWindows.find((w) => {
+      if (resultingClientId) {
+        // If we have a `resultingClientId`, we can match on that.
+        return w.id === resultingClientId;
+      } else {
+        // Otherwise match on finding a window not in `existingWindowIds`.
+        return !existingWindowIds.has(w.id);
+      }
+    });
+
+    if (resultingWindow) {
+      break;
+    }
+
+    // Sleep for 100ms and retry.
+    await timeout(100);
+  }
+
+  return resultingWindow;
+}
diff --git a/tools/ui/node_modules/workbox-core/src/_private/timeout.ts b/tools/ui/node_modules/workbox-core/src/_private/timeout.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aa675f4142936515687f7538bc16749305f30c88
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/timeout.ts
@@ -0,0 +1,21 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+/**
+ * Returns a promise that resolves and the passed number of milliseconds.
+ * This utility is an async/await-friendly version of `setTimeout`.
+ *
+ * @param {number} ms
+ * @return {Promise}
+ * @private
+ */
+
+export function timeout(ms: number): Promise {
+  return new Promise((resolve) => setTimeout(resolve, ms));
+}
diff --git a/tools/ui/node_modules/workbox-core/src/_private/waitUntil.ts b/tools/ui/node_modules/workbox-core/src/_private/waitUntil.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3cde66be525a1a6950756798cc116293a4a31d14
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_private/waitUntil.ts
@@ -0,0 +1,28 @@
+/*
+  Copyright 2020 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+/**
+ * A utility method that makes it easier to use `event.waitUntil` with
+ * async functions and return the result.
+ *
+ * @param {ExtendableEvent} event
+ * @param {Function} asyncFn
+ * @return {Function}
+ * @private
+ */
+function waitUntil(
+  event: ExtendableEvent,
+  asyncFn: () => Promise,
+): Promise {
+  const returnPromise = asyncFn();
+  event.waitUntil(returnPromise);
+  return returnPromise;
+}
+
+export {waitUntil};
diff --git a/tools/ui/node_modules/workbox-core/src/_version.ts b/tools/ui/node_modules/workbox-core/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3acb82af6ad94c79b5af04c84754daf80b37d3ef
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:core:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/src/cacheNames.ts b/tools/ui/node_modules/workbox-core/src/cacheNames.ts
new file mode 100644
index 0000000000000000000000000000000000000000..858d4c2b79521e5c87e3c60834d11c9b415ac814
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/cacheNames.ts
@@ -0,0 +1,45 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {cacheNames as _cacheNames} from './_private/cacheNames.js';
+import './_version.js';
+
+/**
+ * Get the current cache names and prefix/suffix used by Workbox.
+ *
+ * `cacheNames.precache` is used for precached assets,
+ * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to
+ * store `analytics.js`, and `cacheNames.runtime` is used for everything else.
+ *
+ * `cacheNames.prefix` can be used to retrieve just the current prefix value.
+ * `cacheNames.suffix` can be used to retrieve just the current suffix value.
+ *
+ * @return {Object} An object with `precache`, `runtime`, `prefix`, and
+ *     `googleAnalytics` properties.
+ *
+ * @memberof workbox-core
+ */
+const cacheNames = {
+  get googleAnalytics(): string {
+    return _cacheNames.getGoogleAnalyticsName();
+  },
+  get precache(): string {
+    return _cacheNames.getPrecacheName();
+  },
+  get prefix(): string {
+    return _cacheNames.getPrefix();
+  },
+  get runtime(): string {
+    return _cacheNames.getRuntimeName();
+  },
+  get suffix(): string {
+    return _cacheNames.getSuffix();
+  },
+};
+
+export {cacheNames};
diff --git a/tools/ui/node_modules/workbox-core/src/clientsClaim.ts b/tools/ui/node_modules/workbox-core/src/clientsClaim.ts
new file mode 100644
index 0000000000000000000000000000000000000000..717688b6c2530894c216eb6397f78c813142dad8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/clientsClaim.ts
@@ -0,0 +1,24 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * Claim any currently available clients once the service worker
+ * becomes active. This is normally used in conjunction with `skipWaiting()`.
+ *
+ * @memberof workbox-core
+ */
+function clientsClaim(): void {
+  self.addEventListener('activate', () => self.clients.claim());
+}
+
+export {clientsClaim};
diff --git a/tools/ui/node_modules/workbox-core/src/copyResponse.ts b/tools/ui/node_modules/workbox-core/src/copyResponse.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b9c520b844f3bcd726e9a253cf00732b8f51d1b6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/copyResponse.ts
@@ -0,0 +1,70 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {canConstructResponseFromBodyStream} from './_private/canConstructResponseFromBodyStream.js';
+import {WorkboxError} from './_private/WorkboxError.js';
+
+import './_version.js';
+
+/**
+ * Allows developers to copy a response and modify its `headers`, `status`,
+ * or `statusText` values (the values settable via a
+ * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
+ * object in the constructor).
+ * To modify these values, pass a function as the second argument. That
+ * function will be invoked with a single object with the response properties
+ * `{headers, status, statusText}`. The return value of this function will
+ * be used as the `ResponseInit` for the new `Response`. To change the values
+ * either modify the passed parameter(s) and return it, or return a totally
+ * new object.
+ *
+ * This method is intentionally limited to same-origin responses, regardless of
+ * whether CORS was used or not.
+ *
+ * @param {Response} response
+ * @param {Function} modifier
+ * @memberof workbox-core
+ */
+async function copyResponse(
+  response: Response,
+  modifier?: (responseInit: ResponseInit) => ResponseInit,
+): Promise {
+  let origin = null;
+  // If response.url isn't set, assume it's cross-origin and keep origin null.
+  if (response.url) {
+    const responseURL = new URL(response.url);
+    origin = responseURL.origin;
+  }
+
+  if (origin !== self.location.origin) {
+    throw new WorkboxError('cross-origin-copy-response', {origin});
+  }
+
+  const clonedResponse = response.clone();
+
+  // Create a fresh `ResponseInit` object by cloning the headers.
+  const responseInit: ResponseInit = {
+    headers: new Headers(clonedResponse.headers),
+    status: clonedResponse.status,
+    statusText: clonedResponse.statusText,
+  };
+
+  // Apply any user modifications.
+  const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;
+
+  // Create the new response from the body stream and `ResponseInit`
+  // modifications. Note: not all browsers support the Response.body stream,
+  // so fall back to reading the entire body into memory as a blob.
+  const body = canConstructResponseFromBodyStream()
+    ? clonedResponse.body
+    : await clonedResponse.blob();
+
+  return new Response(body, modifiedResponseInit);
+}
+
+export {copyResponse};
diff --git a/tools/ui/node_modules/workbox-core/src/index.ts b/tools/ui/node_modules/workbox-core/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..111d15fcbf6836cee6c0800f16a8632696f447c3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/index.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {registerQuotaErrorCallback} from './registerQuotaErrorCallback.js';
+import * as _private from './_private.js';
+import {cacheNames} from './cacheNames.js';
+import {copyResponse} from './copyResponse.js';
+import {clientsClaim} from './clientsClaim.js';
+import {setCacheNameDetails} from './setCacheNameDetails.js';
+import {skipWaiting} from './skipWaiting.js';
+import './_version.js';
+
+/**
+ * All of the Workbox service worker libraries use workbox-core for shared
+ * code as well as setting default values that need to be shared (like cache
+ * names).
+ *
+ * @module workbox-core
+ */
+export {
+  _private,
+  cacheNames,
+  clientsClaim,
+  copyResponse,
+  registerQuotaErrorCallback,
+  setCacheNameDetails,
+  skipWaiting,
+};
+
+export * from './types.js';
diff --git a/tools/ui/node_modules/workbox-core/src/models/messages/messageGenerator.ts b/tools/ui/node_modules/workbox-core/src/models/messages/messageGenerator.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aba95368d26e3c68e04736ace15a87d7ae4811cd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/models/messages/messageGenerator.ts
@@ -0,0 +1,30 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {messages} from './messages.js';
+import '../../_version.js';
+
+const fallback = (code: string, ...args: any[]) => {
+  let msg = code;
+  if (args.length > 0) {
+    msg += ` :: ${JSON.stringify(args)}`;
+  }
+  return msg;
+};
+
+const generatorFunction = (code: string, details = {}) => {
+  const message = messages[code];
+  if (!message) {
+    throw new Error(`Unable to find message for code '${code}'.`);
+  }
+
+  return message(details);
+};
+
+export const messageGenerator =
+  process.env.NODE_ENV === 'production' ? fallback : generatorFunction;
diff --git a/tools/ui/node_modules/workbox-core/src/models/messages/messages.ts b/tools/ui/node_modules/workbox-core/src/models/messages/messages.ts
new file mode 100644
index 0000000000000000000000000000000000000000..96c118ecede43d9bf04ceef905c2099e46ddec07
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/models/messages/messages.ts
@@ -0,0 +1,382 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../../_version.js';
+
+interface LoggableObject {
+  [key: string]: string | number;
+}
+interface MessageMap {
+  [messageID: string]: (param: LoggableObject) => string;
+}
+
+export const messages: MessageMap = {
+  'invalid-value': ({paramName, validValueDescription, value}) => {
+    if (!paramName || !validValueDescription) {
+      throw new Error(`Unexpected input to 'invalid-value' error.`);
+    }
+    return (
+      `The '${paramName}' parameter was given a value with an ` +
+      `unexpected value. ${validValueDescription} Received a value of ` +
+      `${JSON.stringify(value)}.`
+    );
+  },
+
+  'not-an-array': ({moduleName, className, funcName, paramName}) => {
+    if (!moduleName || !className || !funcName || !paramName) {
+      throw new Error(`Unexpected input to 'not-an-array' error.`);
+    }
+    return (
+      `The parameter '${paramName}' passed into ` +
+      `'${moduleName}.${className}.${funcName}()' must be an array.`
+    );
+  },
+
+  'incorrect-type': ({
+    expectedType,
+    paramName,
+    moduleName,
+    className,
+    funcName,
+  }) => {
+    if (!expectedType || !paramName || !moduleName || !funcName) {
+      throw new Error(`Unexpected input to 'incorrect-type' error.`);
+    }
+    const classNameStr = className ? `${className}.` : '';
+    return (
+      `The parameter '${paramName}' passed into ` +
+      `'${moduleName}.${classNameStr}` +
+      `${funcName}()' must be of type ${expectedType}.`
+    );
+  },
+
+  'incorrect-class': ({
+    expectedClassName,
+    paramName,
+    moduleName,
+    className,
+    funcName,
+    isReturnValueProblem,
+  }) => {
+    if (!expectedClassName || !moduleName || !funcName) {
+      throw new Error(`Unexpected input to 'incorrect-class' error.`);
+    }
+    const classNameStr = className ? `${className}.` : '';
+    if (isReturnValueProblem) {
+      return (
+        `The return value from ` +
+        `'${moduleName}.${classNameStr}${funcName}()' ` +
+        `must be an instance of class ${expectedClassName}.`
+      );
+    }
+
+    return (
+      `The parameter '${paramName}' passed into ` +
+      `'${moduleName}.${classNameStr}${funcName}()' ` +
+      `must be an instance of class ${expectedClassName}.`
+    );
+  },
+
+  'missing-a-method': ({
+    expectedMethod,
+    paramName,
+    moduleName,
+    className,
+    funcName,
+  }) => {
+    if (
+      !expectedMethod ||
+      !paramName ||
+      !moduleName ||
+      !className ||
+      !funcName
+    ) {
+      throw new Error(`Unexpected input to 'missing-a-method' error.`);
+    }
+    return (
+      `${moduleName}.${className}.${funcName}() expected the ` +
+      `'${paramName}' parameter to expose a '${expectedMethod}' method.`
+    );
+  },
+
+  'add-to-cache-list-unexpected-type': ({entry}) => {
+    return (
+      `An unexpected entry was passed to ` +
+      `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` +
+      `'${JSON.stringify(
+        entry,
+      )}' isn't supported. You must supply an array of ` +
+      `strings with one or more characters, objects with a url property or ` +
+      `Request objects.`
+    );
+  },
+
+  'add-to-cache-list-conflicting-entries': ({firstEntry, secondEntry}) => {
+    if (!firstEntry || !secondEntry) {
+      throw new Error(
+        `Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`,
+      );
+    }
+
+    return (
+      `Two of the entries passed to ` +
+      `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
+      `${firstEntry} but different revision details. Workbox is ` +
+      `unable to cache and version the asset correctly. Please remove one ` +
+      `of the entries.`
+    );
+  },
+
+  'plugin-error-request-will-fetch': ({thrownErrorMessage}) => {
+    if (!thrownErrorMessage) {
+      throw new Error(
+        `Unexpected input to ` + `'plugin-error-request-will-fetch', error.`,
+      );
+    }
+
+    return (
+      `An error was thrown by a plugins 'requestWillFetch()' method. ` +
+      `The thrown error message was: '${thrownErrorMessage}'.`
+    );
+  },
+
+  'invalid-cache-name': ({cacheNameId, value}) => {
+    if (!cacheNameId) {
+      throw new Error(
+        `Expected a 'cacheNameId' for error 'invalid-cache-name'`,
+      );
+    }
+
+    return (
+      `You must provide a name containing at least one character for ` +
+      `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` +
+      `'${JSON.stringify(value)}'`
+    );
+  },
+
+  'unregister-route-but-not-found-with-method': ({method}) => {
+    if (!method) {
+      throw new Error(
+        `Unexpected input to ` +
+          `'unregister-route-but-not-found-with-method' error.`,
+      );
+    }
+
+    return (
+      `The route you're trying to unregister was not  previously ` +
+      `registered for the method type '${method}'.`
+    );
+  },
+
+  'unregister-route-route-not-registered': () => {
+    return (
+      `The route you're trying to unregister was not previously ` +
+      `registered.`
+    );
+  },
+
+  'queue-replay-failed': ({name}) => {
+    return `Replaying the background sync queue '${name}' failed.`;
+  },
+
+  'duplicate-queue-name': ({name}) => {
+    return (
+      `The Queue name '${name}' is already being used. ` +
+      `All instances of backgroundSync.Queue must be given unique names.`
+    );
+  },
+
+  'expired-test-without-max-age': ({methodName, paramName}) => {
+    return (
+      `The '${methodName}()' method can only be used when the ` +
+      `'${paramName}' is used in the constructor.`
+    );
+  },
+
+  'unsupported-route-type': ({moduleName, className, funcName, paramName}) => {
+    return (
+      `The supplied '${paramName}' parameter was an unsupported type. ` +
+      `Please check the docs for ${moduleName}.${className}.${funcName} for ` +
+      `valid input types.`
+    );
+  },
+
+  'not-array-of-class': ({
+    value,
+    expectedClass,
+    moduleName,
+    className,
+    funcName,
+    paramName,
+  }) => {
+    return (
+      `The supplied '${paramName}' parameter must be an array of ` +
+      `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` +
+      `Please check the call to ${moduleName}.${className}.${funcName}() ` +
+      `to fix the issue.`
+    );
+  },
+
+  'max-entries-or-age-required': ({moduleName, className, funcName}) => {
+    return (
+      `You must define either config.maxEntries or config.maxAgeSeconds` +
+      `in ${moduleName}.${className}.${funcName}`
+    );
+  },
+
+  'statuses-or-headers-required': ({moduleName, className, funcName}) => {
+    return (
+      `You must define either config.statuses or config.headers` +
+      `in ${moduleName}.${className}.${funcName}`
+    );
+  },
+
+  'invalid-string': ({moduleName, funcName, paramName}) => {
+    if (!paramName || !moduleName || !funcName) {
+      throw new Error(`Unexpected input to 'invalid-string' error.`);
+    }
+    return (
+      `When using strings, the '${paramName}' parameter must start with ` +
+      `'http' (for cross-origin matches) or '/' (for same-origin matches). ` +
+      `Please see the docs for ${moduleName}.${funcName}() for ` +
+      `more info.`
+    );
+  },
+
+  'channel-name-required': () => {
+    return (
+      `You must provide a channelName to construct a ` +
+      `BroadcastCacheUpdate instance.`
+    );
+  },
+
+  'invalid-responses-are-same-args': () => {
+    return (
+      `The arguments passed into responsesAreSame() appear to be ` +
+      `invalid. Please ensure valid Responses are used.`
+    );
+  },
+
+  'expire-custom-caches-only': () => {
+    return (
+      `You must provide a 'cacheName' property when using the ` +
+      `expiration plugin with a runtime caching strategy.`
+    );
+  },
+
+  'unit-must-be-bytes': ({normalizedRangeHeader}) => {
+    if (!normalizedRangeHeader) {
+      throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);
+    }
+    return (
+      `The 'unit' portion of the Range header must be set to 'bytes'. ` +
+      `The Range header provided was "${normalizedRangeHeader}"`
+    );
+  },
+
+  'single-range-only': ({normalizedRangeHeader}) => {
+    if (!normalizedRangeHeader) {
+      throw new Error(`Unexpected input to 'single-range-only' error.`);
+    }
+    return (
+      `Multiple ranges are not supported. Please use a  single start ` +
+      `value, and optional end value. The Range header provided was ` +
+      `"${normalizedRangeHeader}"`
+    );
+  },
+
+  'invalid-range-values': ({normalizedRangeHeader}) => {
+    if (!normalizedRangeHeader) {
+      throw new Error(`Unexpected input to 'invalid-range-values' error.`);
+    }
+    return (
+      `The Range header is missing both start and end values. At least ` +
+      `one of those values is needed. The Range header provided was ` +
+      `"${normalizedRangeHeader}"`
+    );
+  },
+
+  'no-range-header': () => {
+    return `No Range header was found in the Request provided.`;
+  },
+
+  'range-not-satisfiable': ({size, start, end}) => {
+    return (
+      `The start (${start}) and end (${end}) values in the Range are ` +
+      `not satisfiable by the cached response, which is ${size} bytes.`
+    );
+  },
+
+  'attempt-to-cache-non-get-request': ({url, method}) => {
+    return (
+      `Unable to cache '${url}' because it is a '${method}' request and ` +
+      `only 'GET' requests can be cached.`
+    );
+  },
+
+  'cache-put-with-no-response': ({url}) => {
+    return (
+      `There was an attempt to cache '${url}' but the response was not ` +
+      `defined.`
+    );
+  },
+
+  'no-response': ({url, error}) => {
+    let message = `The strategy could not generate a response for '${url}'.`;
+    if (error) {
+      message += ` The underlying error is ${error}.`;
+    }
+    return message;
+  },
+
+  'bad-precaching-response': ({url, status}) => {
+    return (
+      `The precaching request for '${url}' failed` +
+      (status ? ` with an HTTP status of ${status}.` : `.`)
+    );
+  },
+
+  'non-precached-url': ({url}) => {
+    return (
+      `createHandlerBoundToURL('${url}') was called, but that URL is ` +
+      `not precached. Please pass in a URL that is precached instead.`
+    );
+  },
+
+  'add-to-cache-list-conflicting-integrities': ({url}) => {
+    return (
+      `Two of the entries passed to ` +
+      `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
+      `${url} with different integrity values. Please remove one of them.`
+    );
+  },
+
+  'missing-precache-entry': ({cacheName, url}) => {
+    return `Unable to find a precached response in ${cacheName} for ${url}.`;
+  },
+
+  'cross-origin-copy-response': ({origin}) => {
+    return (
+      `workbox-core.copyResponse() can only be used with same-origin ` +
+      `responses. It was passed a response with origin ${origin}.`
+    );
+  },
+
+  'opaque-streams-source': ({type}) => {
+    const message =
+      `One of the workbox-streams sources resulted in an ` +
+      `'${type}' response.`;
+    if (type === 'opaqueredirect') {
+      return (
+        `${message} Please do not use a navigation request that results ` +
+        `in a redirect as a source.`
+      );
+    }
+    return `${message} Please ensure your sources are CORS-enabled.`;
+  },
+};
diff --git a/tools/ui/node_modules/workbox-core/src/models/pluginEvents.ts b/tools/ui/node_modules/workbox-core/src/models/pluginEvents.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6690df46a4d90c3e0076342161297291cfe83cd1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/models/pluginEvents.ts
@@ -0,0 +1,19 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+export const enum pluginEvents {
+  CACHE_DID_UPDATE = 'cacheDidUpdate',
+  CACHE_KEY_WILL_BE_USED = 'cacheKeyWillBeUsed',
+  CACHE_WILL_UPDATE = 'cacheWillUpdate',
+  CACHED_RESPONSE_WILL_BE_USED = 'cachedResponseWillBeUsed',
+  FETCH_DID_FAIL = 'fetchDidFail',
+  FETCH_DID_SUCCEED = 'fetchDidSucceed',
+  REQUEST_WILL_FETCH = 'requestWillFetch',
+}
diff --git a/tools/ui/node_modules/workbox-core/src/models/quotaErrorCallbacks.ts b/tools/ui/node_modules/workbox-core/src/models/quotaErrorCallbacks.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0d3f9d0d2263bcf48fd9eac1ae468efabc4e496d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/models/quotaErrorCallbacks.ts
@@ -0,0 +1,16 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+// Callbacks to be executed whenever there's a quota error.
+// Can't change Function type right now.
+// eslint-disable-next-line @typescript-eslint/ban-types
+const quotaErrorCallbacks: Set = new Set();
+
+export {quotaErrorCallbacks};
diff --git a/tools/ui/node_modules/workbox-core/src/registerQuotaErrorCallback.ts b/tools/ui/node_modules/workbox-core/src/registerQuotaErrorCallback.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f94e804a3d0587e3315bd51a4eb7ea0c1de7f61a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/registerQuotaErrorCallback.ts
@@ -0,0 +1,39 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from './_private/logger.js';
+import {assert} from './_private/assert.js';
+import {quotaErrorCallbacks} from './models/quotaErrorCallbacks.js';
+import './_version.js';
+
+/**
+ * Adds a function to the set of quotaErrorCallbacks that will be executed if
+ * there's a quota error.
+ *
+ * @param {Function} callback
+ * @memberof workbox-core
+ */
+// Can't change Function type
+// eslint-disable-next-line @typescript-eslint/ban-types
+function registerQuotaErrorCallback(callback: Function): void {
+  if (process.env.NODE_ENV !== 'production') {
+    assert!.isType(callback, 'function', {
+      moduleName: 'workbox-core',
+      funcName: 'register',
+      paramName: 'callback',
+    });
+  }
+
+  quotaErrorCallbacks.add(callback);
+
+  if (process.env.NODE_ENV !== 'production') {
+    logger.log('Registered a callback to respond to quota errors.', callback);
+  }
+}
+
+export {registerQuotaErrorCallback};
diff --git a/tools/ui/node_modules/workbox-core/src/setCacheNameDetails.ts b/tools/ui/node_modules/workbox-core/src/setCacheNameDetails.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f24a06b4063428e3830a3fb3a96556a5710611f5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/setCacheNameDetails.ts
@@ -0,0 +1,69 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from './_private/assert.js';
+import {cacheNames, PartialCacheNameDetails} from './_private/cacheNames.js';
+import {WorkboxError} from './_private/WorkboxError.js';
+import './_version.js';
+
+/**
+ * Modifies the default cache names used by the Workbox packages.
+ * Cache names are generated as `--`.
+ *
+ * @param {Object} details
+ * @param {Object} [details.prefix] The string to add to the beginning of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.suffix] The string to add to the end of
+ *     the precache and runtime cache names.
+ * @param {Object} [details.precache] The cache name to use for precache
+ *     caching.
+ * @param {Object} [details.runtime] The cache name to use for runtime caching.
+ * @param {Object} [details.googleAnalytics] The cache name to use for
+ *     `workbox-google-analytics` caching.
+ *
+ * @memberof workbox-core
+ */
+function setCacheNameDetails(details: PartialCacheNameDetails): void {
+  if (process.env.NODE_ENV !== 'production') {
+    Object.keys(details).forEach((key) => {
+      assert!.isType(details[key], 'string', {
+        moduleName: 'workbox-core',
+        funcName: 'setCacheNameDetails',
+        paramName: `details.${key}`,
+      });
+    });
+
+    if ('precache' in details && details['precache']!.length === 0) {
+      throw new WorkboxError('invalid-cache-name', {
+        cacheNameId: 'precache',
+        value: details['precache'],
+      });
+    }
+
+    if ('runtime' in details && details['runtime']!.length === 0) {
+      throw new WorkboxError('invalid-cache-name', {
+        cacheNameId: 'runtime',
+        value: details['runtime'],
+      });
+    }
+
+    if (
+      'googleAnalytics' in details &&
+      details['googleAnalytics'].length === 0
+    ) {
+      throw new WorkboxError('invalid-cache-name', {
+        cacheNameId: 'googleAnalytics',
+        value: details['googleAnalytics'],
+      });
+    }
+  }
+
+  cacheNames.updateDetails(details);
+}
+
+export {setCacheNameDetails};
diff --git a/tools/ui/node_modules/workbox-core/src/skipWaiting.ts b/tools/ui/node_modules/workbox-core/src/skipWaiting.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5fc833fc186b5dcf8e25ec20b2706ae18904c7c8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/skipWaiting.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from './_private/logger.js';
+
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * This method is deprecated, and will be removed in Workbox v7.
+ *
+ * Calling self.skipWaiting() is equivalent, and should be used instead.
+ *
+ * @memberof workbox-core
+ */
+function skipWaiting(): void {
+  // Just call self.skipWaiting() directly.
+  // See https://github.com/GoogleChrome/workbox/issues/2525
+  if (process.env.NODE_ENV !== 'production') {
+    logger.warn(
+      `skipWaiting() from workbox-core is no longer recommended ` +
+        `and will be removed in Workbox v7. Using self.skipWaiting() instead ` +
+        `is equivalent.`,
+    );
+  }
+
+  void self.skipWaiting();
+}
+
+export {skipWaiting};
diff --git a/tools/ui/node_modules/workbox-core/src/types.ts b/tools/ui/node_modules/workbox-core/src/types.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7a8642f136ada58a5948ecf7de3df3c4f55617b4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/types.ts
@@ -0,0 +1,282 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.js';
+
+export interface MapLikeObject {
+  [key: string]: any;
+}
+
+/**
+ * Using a plain `MapLikeObject` for now, but could extend/restrict this
+ * in the future.
+ */
+export type PluginState = MapLikeObject;
+
+/**
+ * Options passed to a `RouteMatchCallback` function.
+ */
+export interface RouteMatchCallbackOptions {
+  event: ExtendableEvent;
+  request: Request;
+  sameOrigin: boolean;
+  url: URL;
+}
+
+/**
+ * The "match" callback is used to determine if a `Route` should apply for a
+ * particular URL and request. When matching occurs in response to a fetch
+ * event from the client, the `event` object is also supplied. However, since
+ * the match callback can be invoked outside of a fetch event, matching logic
+ * should not assume the `event` object will always be available.
+ * If the match callback returns a truthy value, the matching route's
+ * `RouteHandlerCallback` will be invoked immediately. If the value returned
+ * is a non-empty array or object, that value will be set on the handler's
+ * `options.params` argument.
+ */
+export interface RouteMatchCallback {
+  (options: RouteMatchCallbackOptions): any;
+}
+
+/**
+ * Options passed to a `RouteHandlerCallback` function.
+ */
+export declare interface RouteHandlerCallbackOptions {
+  event: ExtendableEvent;
+  request: Request;
+  url: URL;
+  params?: string[] | MapLikeObject;
+}
+
+/**
+ * Options passed to a `ManualHandlerCallback` function.
+ */
+export interface ManualHandlerCallbackOptions {
+  event: ExtendableEvent;
+  request: Request | string;
+}
+
+export type HandlerCallbackOptions =
+  | RouteHandlerCallbackOptions
+  | ManualHandlerCallbackOptions;
+
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL/Request
+ * to a `Route` via its `RouteMatchCallback`. This handler callback should
+ * return a `Promise` that resolves with a `Response`.
+ *
+ * If a non-empty array or object is returned by the `RouteMatchCallback` it
+ * will be passed in as this handler's `options.params` argument.
+ */
+export interface RouteHandlerCallback {
+  (options: RouteHandlerCallbackOptions): Promise;
+}
+
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL/Request
+ * to a `Route` via its `RouteMatchCallback`. This handler callback should
+ * return a `Promise` that resolves with a `Response`.
+ *
+ * If a non-empty array or object is returned by the `RouteMatchCallback` it
+ * will be passed in as this handler's `options.params` argument.
+ */
+export interface ManualHandlerCallback {
+  (options: ManualHandlerCallbackOptions): Promise;
+}
+
+/**
+ * An object with a `handle` method of type `RouteHandlerCallback`.
+ *
+ * A `Route` object can be created with either an `RouteHandlerCallback`
+ * function or this `RouteHandler` object. The benefit of the `RouteHandler`
+ * is it can be extended (as is done by the `workbox-strategies` package).
+ */
+export interface RouteHandlerObject {
+  handle: RouteHandlerCallback;
+}
+
+/**
+ * Either a `RouteHandlerCallback` or a `RouteHandlerObject`.
+ * Most APIs in `workbox-routing` that accept route handlers take either.
+ */
+export type RouteHandler = RouteHandlerCallback | RouteHandlerObject;
+
+export interface HandlerWillStartCallbackParam {
+  request: Request;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface HandlerWillStartCallback {
+  (param: HandlerWillStartCallbackParam): Promise;
+}
+
+export interface CacheDidUpdateCallbackParam {
+  cacheName: string;
+  newResponse: Response;
+  request: Request;
+  event: ExtendableEvent;
+  oldResponse?: Response | null;
+  state?: PluginState;
+}
+
+export interface CacheDidUpdateCallback {
+  (param: CacheDidUpdateCallbackParam): Promise;
+}
+
+export interface CacheKeyWillBeUsedCallbackParam {
+  mode: string;
+  request: Request;
+  event: ExtendableEvent;
+  params?: any;
+  state?: PluginState;
+}
+
+export interface CacheKeyWillBeUsedCallback {
+  (param: CacheKeyWillBeUsedCallbackParam): Promise;
+}
+
+export interface CacheWillUpdateCallbackParam {
+  request: Request;
+  response: Response;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface CacheWillUpdateCallback {
+  (param: CacheWillUpdateCallbackParam): Promise<
+    Response | void | null | undefined
+  >;
+}
+
+export interface CachedResponseWillBeUsedCallbackParam {
+  cacheName: string;
+  request: Request;
+  cachedResponse?: Response;
+  event: ExtendableEvent;
+  matchOptions?: CacheQueryOptions;
+  state?: PluginState;
+}
+
+export interface CachedResponseWillBeUsedCallback {
+  (param: CachedResponseWillBeUsedCallbackParam): Promise<
+    Response | void | null | undefined
+  >;
+}
+
+export interface FetchDidFailCallbackParam {
+  error: Error;
+  originalRequest: Request;
+  request: Request;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface FetchDidFailCallback {
+  (param: FetchDidFailCallbackParam): Promise;
+}
+
+export interface FetchDidSucceedCallbackParam {
+  request: Request;
+  response: Response;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface FetchDidSucceedCallback {
+  (param: FetchDidSucceedCallbackParam): Promise;
+}
+
+export interface RequestWillFetchCallbackParam {
+  request: Request;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface RequestWillFetchCallback {
+  (param: RequestWillFetchCallbackParam): Promise;
+}
+
+export interface HandlerWillRespondCallbackParam {
+  request: Request;
+  response: Response;
+  event: ExtendableEvent;
+  state?: PluginState;
+}
+
+export interface HandlerWillRespondCallback {
+  (param: HandlerWillRespondCallbackParam): Promise;
+}
+
+export interface HandlerDidErrorCallbackParam {
+  request: Request;
+  event: ExtendableEvent;
+  error: Error;
+  state?: PluginState;
+}
+
+export interface HandlerDidErrorCallback {
+  (param: HandlerDidErrorCallbackParam): Promise;
+}
+
+export interface HandlerDidRespondCallbackParam {
+  request: Request;
+  event: ExtendableEvent;
+  response?: Response;
+  state?: PluginState;
+}
+
+export interface HandlerDidRespondCallback {
+  (param: HandlerDidRespondCallbackParam): Promise;
+}
+
+export interface HandlerDidCompleteCallbackParam {
+  request: Request;
+  error?: Error;
+  event: ExtendableEvent;
+  response?: Response;
+  state?: PluginState;
+}
+
+export interface HandlerDidCompleteCallback {
+  (param: HandlerDidCompleteCallbackParam): Promise;
+}
+
+/**
+ * An object with optional lifecycle callback properties for the fetch and
+ * cache operations.
+ */
+export declare interface WorkboxPlugin {
+  cacheDidUpdate?: CacheDidUpdateCallback;
+  cachedResponseWillBeUsed?: CachedResponseWillBeUsedCallback;
+  cacheKeyWillBeUsed?: CacheKeyWillBeUsedCallback;
+  cacheWillUpdate?: CacheWillUpdateCallback;
+  fetchDidFail?: FetchDidFailCallback;
+  fetchDidSucceed?: FetchDidSucceedCallback;
+  handlerDidComplete?: HandlerDidCompleteCallback;
+  handlerDidError?: HandlerDidErrorCallback;
+  handlerDidRespond?: HandlerDidRespondCallback;
+  handlerWillRespond?: HandlerWillRespondCallback;
+  handlerWillStart?: HandlerWillStartCallback;
+  requestWillFetch?: RequestWillFetchCallback;
+}
+
+export interface WorkboxPluginCallbackParam {
+  cacheDidUpdate: CacheDidUpdateCallbackParam;
+  cachedResponseWillBeUsed: CachedResponseWillBeUsedCallbackParam;
+  cacheKeyWillBeUsed: CacheKeyWillBeUsedCallbackParam;
+  cacheWillUpdate: CacheWillUpdateCallbackParam;
+  fetchDidFail: FetchDidFailCallbackParam;
+  fetchDidSucceed: FetchDidSucceedCallbackParam;
+  handlerDidComplete: HandlerDidCompleteCallbackParam;
+  handlerDidError: HandlerDidErrorCallbackParam;
+  handlerDidRespond: HandlerDidRespondCallbackParam;
+  handlerWillRespond: HandlerWillRespondCallbackParam;
+  handlerWillStart: HandlerWillStartCallbackParam;
+  requestWillFetch: RequestWillFetchCallbackParam;
+}
diff --git a/tools/ui/node_modules/workbox-core/src/utils/pluginUtils.ts b/tools/ui/node_modules/workbox-core/src/utils/pluginUtils.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4fa8515440e4870c339a008b4c41bd1808794ff8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/utils/pluginUtils.ts
@@ -0,0 +1,16 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin} from '../types.js';
+import '../_version.js';
+
+export const pluginUtils = {
+  filter: (plugins: WorkboxPlugin[], callbackName: string): WorkboxPlugin[] => {
+    return plugins.filter((plugin) => callbackName in plugin);
+  },
+};
diff --git a/tools/ui/node_modules/workbox-core/src/utils/welcome.ts b/tools/ui/node_modules/workbox-core/src/utils/welcome.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8dfde13b3cf03d76d1b7c6535456a9ec2e3bb7a6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/src/utils/welcome.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from '../_private/logger.js';
+import '../_version.js';
+
+// A WorkboxCore instance must be exported before we can use the logger.
+// This is so it can get the current log level.
+if (process.env.NODE_ENV !== 'production') {
+  const padding = '   ';
+  logger.groupCollapsed('Welcome to Workbox!');
+  logger.log(
+    `You are currently using a development build. ` +
+      `By default this will switch to prod builds when not on localhost. ` +
+      `You can force this with workbox.setConfig({debug: true|false}).`,
+  );
+  logger.log(
+    `📖 Read the guides and documentation\n` +
+      `${padding}https://developers.google.com/web/tools/workbox/`,
+  );
+  logger.log(
+    `❓ Use the [workbox] tag on Stack Overflow to ask questions\n` +
+      `${padding}https://stackoverflow.com/questions/ask?tags=workbox`,
+  );
+  logger.log(
+    `🐛 Found a bug? Report it on GitHub\n` +
+      `${padding}https://github.com/GoogleChrome/workbox/issues/new`,
+  );
+  logger.groupEnd();
+}
diff --git a/tools/ui/node_modules/workbox-core/tsconfig.json b/tools/ui/node_modules/workbox-core/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..2a5af270c34a08b0a0d1f4a5fcd91fd96ee7d569
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/tsconfig.json
@@ -0,0 +1,10 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"]
+}
diff --git a/tools/ui/node_modules/workbox-core/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-core/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..72ca9d15a84f4485b3c4372e8e82eec4d714b3f8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","./src/_version.ts","./src/models/messages/messages.ts","./src/models/messages/messagegenerator.ts","./src/types.ts","./src/_private/workboxerror.ts","./src/_private/assert.ts","./src/_private/cachenames.ts","./src/_private/cachematchignoreparams.ts","./src/_private/canconstructreadablestream.ts","./src/_private/canconstructresponsefrombodystream.ts","./src/_private/dontwaitfor.ts","./src/_private/deferred.ts","./src/_private/logger.ts","./src/models/quotaerrorcallbacks.ts","./src/_private/executequotaerrorcallbacks.ts","./src/_private/getfriendlyurl.ts","./src/_private/timeout.ts","./src/_private/resultingclientexists.ts","./src/_private/waituntil.ts","./src/_private.ts","./src/cachenames.ts","./src/clientsclaim.ts","./src/copyresponse.ts","./src/registerquotaerrorcallback.ts","./src/setcachenamedetails.ts","./src/skipwaiting.ts","./src/index.ts","./src/models/pluginevents.ts","./src/utils/pluginutils.ts","./src/utils/welcome.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},{"version":"76991ae8f1cd927ac72dd1f476a8c54585542174d01843d4e4f84eaaaab68159","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"29d6ea2f571c5f7eef7defcdcc6ce1f1c5602214ac4f083c592acc40262c459a","signature":"86ab21b134f0acf12b38906ca91861a84b514b018e301daa0191f516b400cbc8"},{"version":"9ce2b34d11433046acc59d630d8fed1e224677a1865804a3e746a15f35566a84","signature":"726b37c934309f9c4387d9d70497ff6c06ae0258da6c76e717798512836973a8"},{"version":"046d1262c22c03c5f21adea385c26189949ed75188178361358a9c7cc9ce934f","signature":"f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222"},{"version":"5148b87fecf98a09f23664e7319b3cc2255de86cae5024e54860a2e40077d5b7","signature":"0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5"},{"version":"402c902760253858fa781b7c7512eaaf92331dcb0c14c2908eb58c5d292c890b","signature":"7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca"},{"version":"d00e82d97b8150efc4f6345095226e78e3377759ebed840c9711836197bd3735","signature":"dda5c129fa8b8e72bee6609a4fc48148f58f2f656d70a395d3122431193569f9"},{"version":"6723de6b176f15b815c42c1ea29f102bddc615d21f1825d58fd57c9d079ae352","signature":"9848c9644b2c1209f90ca5bf13f81d268365178241ba40bee6cf334643a8d5a0"},{"version":"b618a8d5f1e668f99ce447610d24b3b8f7705d28a75329121035dbec7113fd90","signature":"96804c81b1d2ede6f9a247b098b54423eede03752d4cc7b6a1872e0832e7f4e8"},{"version":"5a21d68a1733e61f4d89d3e4a61e50112765420d2f9011b8d4803d539010d618","signature":"37713c3cd87f55bd5b423dd4d33350deda33ad914a334d6f90ffc8adb4aa6e35"},{"version":"26fe67e5011e30d2839906ba3e71638b836098d9c3c50f97652bfcf48f86ada7","signature":"365f3bd8994af50572b562a002e0fa2e72e74f54ed996e2444ea3df562678f50"},{"version":"3cdb5ba092669a3057ae026a6e3a0e5ba31b3b3648002d8e931a4722047bd83f","signature":"88fa7615e71089c0cab3b688aae073a6e9dae6f489ec1357da407c155d2e9d84"},{"version":"143521ecbfbba444cb0b6f2d0fbeba5cf45271fa6f34a7f455e22f3165cce502","signature":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},{"version":"88669814b1d9742b7157e5958718c4d6ecaafe6926865856a68107e8c57b7584","signature":"75fa85c236a0ec4720a8895822e9299c56fc4003261f9a7c7cc0b07fd6c2fc5c"},{"version":"0bb4315303fd9e800020fe88079b93d89a4836c6e4b4f5afcd2703c1486f9bb6","signature":"4e7a6d022b2a963e993bec8a6e92bd6053f2e46495ef058b015cfd25fa6520b9"},{"version":"3be965456905eeacff988db2e6c9c389cd48c72b5f4c0552b28742663e6322f7","signature":"9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff"},{"version":"1e427be353c81435955f252f52d07924d6773b1191a07e04ea4664fda6c1352b","signature":"f69dd422840e809218633c76acb5eed2a6aa81914299f9b8d74101148526e27e"},{"version":"3591ad4e36ccd00c93ec00d52437c727e451f6d62c219c48d439cf43a667d87c","signature":"1b5906124bb3a63826d30d4ca5547143b0d6308e9db51ce453bd759ba88df530"},{"version":"2504c445cec6647d21f6a3c2e4f61cd8886e79939cf70dc09f5e8e6211e9d23c","signature":"70d9e4746e3ba572a12da28136b854e5503119e96c2524d99575d4b7c7379e70"},{"version":"9824f65480622bca9b853a2cb374ae2cde9f14735f8cce551a9149ba72c52edd","signature":"7dc01b2b44acee5ef4da2bac6af798da14931b910db91aef533cc8e409cf8615"},{"version":"3badb0817ba4cffca306c4dec09ac550cec3f9e2b2b779241064db4e65d48701","signature":"f406a080a40454600ea5de548e460909f189fa87467ec9313cc5d7370a940ba9"},{"version":"04021950a58dc5904262f711c3fbbc06c0c37805392d72be9b15341fd1936fc2","signature":"5d83f333ed1c52c79476d3384d7d1b1fb8e159d02ef2eac2ec5ca1041483fb8e"},{"version":"769b9372cdefe35089063ec429321d1768f0f7ad041a012f6f656a4af7ec318a","signature":"3a5d48aa1814dbcc6a6a1d22bb94c6870450e168c5fed6b73825590372b3edb3"},{"version":"9d05f24ad175326890f50869bd7098f890f525a98f2eb9f8d151b7a21511eddd","signature":"556061e3c5bf3a5786b46ad49fbbdc081f1f14b5c0ee0f7f0936abef2c55ae14"},{"version":"89d0d2e02f7fadeb1e6a883fa2ae23fda3dcd99f69e9cc9c8066bbbc231603b3","signature":"7f7cdd77fa845e53089f280845b7860f9b290686958005da29893484d731d30d"},{"version":"7707bb7d2bed638ed4d8dc4d0c3c55b2413999eef56ea2e4e907dcaf5ac9a5d0","signature":"880d02b872e33a0cbafc55bf85c7e6feca1e769b4100c61b4b9a6b0854f06499"},{"version":"4ab4556e2edf99be576ee957d3b072eca7681cf33a3513657c4b920247a48aef","signature":"5f50bad917dda03b516fb27e15e874b4b284041a5deaa90443c61e908b49d23f"},{"version":"938d8a6fdabc2b8e82de548e8759edc1af80a70c370f45f8b4807a95b327ce75","signature":"2aed7b2106c602496d0eb9a267433e63698d61e0d23b0f2b306e1b610e83628b"},{"version":"fffe4f3ff85e8fb8d9cabd94aa5a799cec9bcad6bc91dabc74221e9772357588","signature":"a8a5403266deade938f4712c1728ef7ce7bac8bbeeefddfc12471e31870375a1"},{"version":"03080088224de98fd04e96a24b1070629994bc348767b25605c819dbeadc8c18","signature":"cd393a3d0ce0539979cd3b8abc6ea47cd856031373291aeb588c2a76bfa862c1"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[91,133],[73,91,133],[73,74,75,76,77,91,133],[73,75,91,133],[82,84,91,133],[81,82,83,91,133],[91,133,146,182],[91,133,145,182,184],[91,133,207],[91,133,192],[91,133,196,197,198],[91,133,195],[91,133,197],[91,133,187,193,194,199,202,204,205,206],[91,133,194,200,201,207],[91,133,200,203],[91,133,194,195,200,207],[91,133,194,207],[91,133,188,189,190,191],[91,130,133],[91,132,133],[91,133,138,167],[91,133,134,139,145,146,153,164,175],[91,133,134,135,145,153],[86,87,88,91,133],[91,133,136,176],[91,133,137,138,146,154],[91,133,138,164,172],[91,133,139,141,145,153],[91,132,133,140],[91,133,141,142],[91,133,145],[91,133,143,145],[91,132,133,145],[91,133,145,146,147,164,175],[91,133,145,146,147,160,164,167],[91,128,133,180],[91,133,141,145,148,153,164,175],[91,133,145,146,148,149,153,164,172,175],[91,133,148,150,164,172,175],[91,133,145,151],[91,133,152,175,180],[91,133,141,145,153,164],[91,133,154],[91,133,155],[91,132,133,156],[91,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[91,133,158],[91,133,159],[91,133,145,160,161],[91,133,160,162,176,178],[91,133,145,164,165,167],[91,133,166,167],[91,133,164,165],[91,133,167],[91,133,168],[91,130,133,164],[91,133,145,170,171],[91,133,170,171],[91,133,138,153,164,172],[91,133,173],[133],[89,90,91,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[91,133,153,174],[91,133,148,159,175],[91,133,138,176],[91,133,164,177],[91,133,152,178],[91,133,179],[91,133,138,145,147,156,164,175,178,180],[91,133,164,181],[91,133,213,252],[91,133,213,237,252],[91,133,252],[91,133,213],[91,133,213,238,252],[91,133,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251],[91,133,238,252],[91,133,256],[91,133,182,259,260,261,262,263,264,265,266,267,268,269],[91,133,258,259,268],[91,133,259,268],[91,133,253,258,259,268],[91,133,258,259,260,261,262,263,264,265,266,267,269],[91,133,259],[91,133,138,258,268],[91,100,104,133,175],[91,100,133,164,175],[91,95,133],[91,97,100,133,172,175],[91,133,153,172],[91,133,182],[91,95,133,182],[91,97,100,133,153,175],[91,92,93,96,99,133,145,164,175],[91,100,107,133],[91,92,98,133],[91,100,121,122,133],[91,96,100,133,167,175,182],[91,121,133,182],[91,94,95,133,182],[91,100,133],[91,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,133],[91,100,115,133],[91,100,107,108,133],[91,98,100,108,109,133],[91,99,133],[91,92,95,100,133],[91,100,104,108,109,133],[91,104,133],[91,98,100,103,133,175],[91,92,97,100,107,133],[91,133,164],[91,95,100,121,133,180,182],[47,48,49,50,51,52,53,54,55,57,58,59,60,61,91,133],[46,47,91,133],[55,56,91,133],[59,91,133],[45,46,91,133],[49,91,133],[47,52,91,133],[46,62,63,64,65,66,67,68,91,133],[44,91,133],[48,55,56,91,133],[47,48,49,91,133],[55,91,133],[46,91,133],[47,48,49,50,51,52,53,54,55,57,58,59,60,61],[46],[46,62,63,64,65,66,67,68],[49]],"referencedMap":[[42,1],[75,2],[73,1],[78,3],[74,2],[79,1],[76,4],[77,2],[80,1],[85,5],[81,1],[84,6],[82,1],[183,7],[185,8],[186,1],[83,1],[187,1],[208,9],[193,10],[199,11],[197,1],[196,12],[198,13],[207,14],[202,15],[204,16],[205,17],[206,18],[200,1],[201,18],[203,18],[195,18],[194,1],[189,1],[188,1],[191,10],[192,19],[190,10],[184,1],[209,1],[130,20],[131,20],[132,21],[133,22],[134,23],[135,24],[86,1],[89,25],[87,1],[88,1],[136,26],[137,27],[138,28],[139,29],[140,30],[141,31],[142,31],[144,32],[143,33],[145,34],[146,35],[147,36],[129,37],[148,38],[149,39],[150,40],[151,41],[152,42],[153,43],[154,44],[155,45],[156,46],[157,47],[158,48],[159,49],[160,50],[161,50],[162,51],[163,1],[164,52],[166,53],[165,54],[167,55],[168,56],[169,57],[170,58],[171,59],[172,60],[173,61],[91,62],[90,1],[182,63],[174,64],[175,65],[176,66],[177,67],[178,68],[179,69],[180,70],[181,71],[210,1],[211,1],[212,1],[237,72],[238,73],[213,74],[216,74],[235,72],[236,72],[226,72],[225,75],[223,72],[218,72],[231,72],[229,72],[233,72],[217,72],[230,72],[234,72],[219,72],[220,72],[232,72],[214,72],[221,72],[222,72],[224,72],[228,72],[239,76],[227,72],[215,72],[252,77],[251,1],[246,76],[248,78],[247,76],[240,76],[241,76],[243,76],[245,76],[249,78],[250,78],[242,78],[244,78],[253,1],[254,1],[255,1],[257,79],[256,1],[270,80],[269,81],[260,82],[261,83],[268,84],[262,83],[263,82],[264,82],[265,82],[266,85],[259,86],[267,81],[258,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[107,87],[117,88],[106,87],[127,89],[98,90],[97,91],[126,92],[120,93],[125,94],[100,95],[114,96],[99,97],[123,98],[95,99],[94,92],[124,100],[96,101],[101,102],[102,1],[105,102],[92,1],[128,103],[118,104],[109,105],[110,106],[112,107],[108,108],[111,109],[121,92],[103,110],[104,111],[113,112],[93,113],[116,104],[115,102],[119,1],[122,114],[62,115],[48,116],[50,1],[49,1],[51,1],[52,1],[54,1],[53,1],[57,117],[58,1],[55,1],[60,118],[59,1],[61,1],[47,119],[43,1],[63,120],[64,1],[65,121],[69,122],[45,123],[44,1],[70,1],[56,1],[66,124],[67,125],[68,126],[46,1],[71,127],[72,126]],"exportedModulesMap":[[42,1],[75,2],[73,1],[78,3],[74,2],[79,1],[76,4],[77,2],[80,1],[85,5],[81,1],[84,6],[82,1],[183,7],[185,8],[186,1],[83,1],[187,1],[208,9],[193,10],[199,11],[197,1],[196,12],[198,13],[207,14],[202,15],[204,16],[205,17],[206,18],[200,1],[201,18],[203,18],[195,18],[194,1],[189,1],[188,1],[191,10],[192,19],[190,10],[184,1],[209,1],[130,20],[131,20],[132,21],[133,22],[134,23],[135,24],[86,1],[89,25],[87,1],[88,1],[136,26],[137,27],[138,28],[139,29],[140,30],[141,31],[142,31],[144,32],[143,33],[145,34],[146,35],[147,36],[129,37],[148,38],[149,39],[150,40],[151,41],[152,42],[153,43],[154,44],[155,45],[156,46],[157,47],[158,48],[159,49],[160,50],[161,50],[162,51],[163,1],[164,52],[166,53],[165,54],[167,55],[168,56],[169,57],[170,58],[171,59],[172,60],[173,61],[91,62],[90,1],[182,63],[174,64],[175,65],[176,66],[177,67],[178,68],[179,69],[180,70],[181,71],[210,1],[211,1],[212,1],[237,72],[238,73],[213,74],[216,74],[235,72],[236,72],[226,72],[225,75],[223,72],[218,72],[231,72],[229,72],[233,72],[217,72],[230,72],[234,72],[219,72],[220,72],[232,72],[214,72],[221,72],[222,72],[224,72],[228,72],[239,76],[227,72],[215,72],[252,77],[251,1],[246,76],[248,78],[247,76],[240,76],[241,76],[243,76],[245,76],[249,78],[250,78],[242,78],[244,78],[253,1],[254,1],[255,1],[257,79],[256,1],[270,80],[269,81],[260,82],[261,83],[268,84],[262,83],[263,82],[264,82],[265,82],[266,85],[259,86],[267,81],[258,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[107,87],[117,88],[106,87],[127,89],[98,90],[97,91],[126,92],[120,93],[125,94],[100,95],[114,96],[99,97],[123,98],[95,99],[94,92],[124,100],[96,101],[101,102],[102,1],[105,102],[92,1],[128,103],[118,104],[109,105],[110,106],[112,107],[108,108],[111,109],[121,92],[103,110],[104,111],[113,112],[93,113],[116,104],[115,102],[119,1],[122,114],[62,128],[48,129],[47,129],[69,130],[67,131],[71,129]],"semanticDiagnosticsPerFile":[42,75,73,78,74,79,76,77,80,85,81,84,82,183,185,186,83,187,208,193,199,197,196,198,207,202,204,205,206,200,201,203,195,194,189,188,191,192,190,184,209,130,131,132,133,134,135,86,89,87,88,136,137,138,139,140,141,142,144,143,145,146,147,129,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,165,167,168,169,170,171,172,173,91,90,182,174,175,176,177,178,179,180,181,210,211,212,237,238,213,216,235,236,226,225,223,218,231,229,233,217,230,234,219,220,232,214,221,222,224,228,239,227,215,252,251,246,248,247,240,241,243,245,249,250,242,244,253,254,255,257,256,270,269,260,261,268,262,263,264,265,266,259,267,258,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,107,117,106,127,98,97,126,120,125,100,114,99,123,95,94,124,96,101,102,105,92,128,118,109,110,112,108,111,121,103,104,113,93,116,115,119,122,62,48,50,49,51,52,54,53,57,58,55,60,59,61,47,43,63,64,65,69,45,44,70,56,66,67,68,46,71,72],"latestChangedDtsFile":"./utils/welcome.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/types.d.ts b/tools/ui/node_modules/workbox-core/types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..feefe0ceebd20114f22ee130fffb6f6b3b78dcd1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/types.d.ts
@@ -0,0 +1,231 @@
+import './_version.js';
+export interface MapLikeObject {
+    [key: string]: any;
+}
+/**
+ * Using a plain `MapLikeObject` for now, but could extend/restrict this
+ * in the future.
+ */
+export type PluginState = MapLikeObject;
+/**
+ * Options passed to a `RouteMatchCallback` function.
+ */
+export interface RouteMatchCallbackOptions {
+    event: ExtendableEvent;
+    request: Request;
+    sameOrigin: boolean;
+    url: URL;
+}
+/**
+ * The "match" callback is used to determine if a `Route` should apply for a
+ * particular URL and request. When matching occurs in response to a fetch
+ * event from the client, the `event` object is also supplied. However, since
+ * the match callback can be invoked outside of a fetch event, matching logic
+ * should not assume the `event` object will always be available.
+ * If the match callback returns a truthy value, the matching route's
+ * `RouteHandlerCallback` will be invoked immediately. If the value returned
+ * is a non-empty array or object, that value will be set on the handler's
+ * `options.params` argument.
+ */
+export interface RouteMatchCallback {
+    (options: RouteMatchCallbackOptions): any;
+}
+/**
+ * Options passed to a `RouteHandlerCallback` function.
+ */
+export declare interface RouteHandlerCallbackOptions {
+    event: ExtendableEvent;
+    request: Request;
+    url: URL;
+    params?: string[] | MapLikeObject;
+}
+/**
+ * Options passed to a `ManualHandlerCallback` function.
+ */
+export interface ManualHandlerCallbackOptions {
+    event: ExtendableEvent;
+    request: Request | string;
+}
+export type HandlerCallbackOptions = RouteHandlerCallbackOptions | ManualHandlerCallbackOptions;
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL/Request
+ * to a `Route` via its `RouteMatchCallback`. This handler callback should
+ * return a `Promise` that resolves with a `Response`.
+ *
+ * If a non-empty array or object is returned by the `RouteMatchCallback` it
+ * will be passed in as this handler's `options.params` argument.
+ */
+export interface RouteHandlerCallback {
+    (options: RouteHandlerCallbackOptions): Promise;
+}
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL/Request
+ * to a `Route` via its `RouteMatchCallback`. This handler callback should
+ * return a `Promise` that resolves with a `Response`.
+ *
+ * If a non-empty array or object is returned by the `RouteMatchCallback` it
+ * will be passed in as this handler's `options.params` argument.
+ */
+export interface ManualHandlerCallback {
+    (options: ManualHandlerCallbackOptions): Promise;
+}
+/**
+ * An object with a `handle` method of type `RouteHandlerCallback`.
+ *
+ * A `Route` object can be created with either an `RouteHandlerCallback`
+ * function or this `RouteHandler` object. The benefit of the `RouteHandler`
+ * is it can be extended (as is done by the `workbox-strategies` package).
+ */
+export interface RouteHandlerObject {
+    handle: RouteHandlerCallback;
+}
+/**
+ * Either a `RouteHandlerCallback` or a `RouteHandlerObject`.
+ * Most APIs in `workbox-routing` that accept route handlers take either.
+ */
+export type RouteHandler = RouteHandlerCallback | RouteHandlerObject;
+export interface HandlerWillStartCallbackParam {
+    request: Request;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface HandlerWillStartCallback {
+    (param: HandlerWillStartCallbackParam): Promise;
+}
+export interface CacheDidUpdateCallbackParam {
+    cacheName: string;
+    newResponse: Response;
+    request: Request;
+    event: ExtendableEvent;
+    oldResponse?: Response | null;
+    state?: PluginState;
+}
+export interface CacheDidUpdateCallback {
+    (param: CacheDidUpdateCallbackParam): Promise;
+}
+export interface CacheKeyWillBeUsedCallbackParam {
+    mode: string;
+    request: Request;
+    event: ExtendableEvent;
+    params?: any;
+    state?: PluginState;
+}
+export interface CacheKeyWillBeUsedCallback {
+    (param: CacheKeyWillBeUsedCallbackParam): Promise;
+}
+export interface CacheWillUpdateCallbackParam {
+    request: Request;
+    response: Response;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface CacheWillUpdateCallback {
+    (param: CacheWillUpdateCallbackParam): Promise;
+}
+export interface CachedResponseWillBeUsedCallbackParam {
+    cacheName: string;
+    request: Request;
+    cachedResponse?: Response;
+    event: ExtendableEvent;
+    matchOptions?: CacheQueryOptions;
+    state?: PluginState;
+}
+export interface CachedResponseWillBeUsedCallback {
+    (param: CachedResponseWillBeUsedCallbackParam): Promise;
+}
+export interface FetchDidFailCallbackParam {
+    error: Error;
+    originalRequest: Request;
+    request: Request;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface FetchDidFailCallback {
+    (param: FetchDidFailCallbackParam): Promise;
+}
+export interface FetchDidSucceedCallbackParam {
+    request: Request;
+    response: Response;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface FetchDidSucceedCallback {
+    (param: FetchDidSucceedCallbackParam): Promise;
+}
+export interface RequestWillFetchCallbackParam {
+    request: Request;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface RequestWillFetchCallback {
+    (param: RequestWillFetchCallbackParam): Promise;
+}
+export interface HandlerWillRespondCallbackParam {
+    request: Request;
+    response: Response;
+    event: ExtendableEvent;
+    state?: PluginState;
+}
+export interface HandlerWillRespondCallback {
+    (param: HandlerWillRespondCallbackParam): Promise;
+}
+export interface HandlerDidErrorCallbackParam {
+    request: Request;
+    event: ExtendableEvent;
+    error: Error;
+    state?: PluginState;
+}
+export interface HandlerDidErrorCallback {
+    (param: HandlerDidErrorCallbackParam): Promise;
+}
+export interface HandlerDidRespondCallbackParam {
+    request: Request;
+    event: ExtendableEvent;
+    response?: Response;
+    state?: PluginState;
+}
+export interface HandlerDidRespondCallback {
+    (param: HandlerDidRespondCallbackParam): Promise;
+}
+export interface HandlerDidCompleteCallbackParam {
+    request: Request;
+    error?: Error;
+    event: ExtendableEvent;
+    response?: Response;
+    state?: PluginState;
+}
+export interface HandlerDidCompleteCallback {
+    (param: HandlerDidCompleteCallbackParam): Promise;
+}
+/**
+ * An object with optional lifecycle callback properties for the fetch and
+ * cache operations.
+ */
+export declare interface WorkboxPlugin {
+    cacheDidUpdate?: CacheDidUpdateCallback;
+    cachedResponseWillBeUsed?: CachedResponseWillBeUsedCallback;
+    cacheKeyWillBeUsed?: CacheKeyWillBeUsedCallback;
+    cacheWillUpdate?: CacheWillUpdateCallback;
+    fetchDidFail?: FetchDidFailCallback;
+    fetchDidSucceed?: FetchDidSucceedCallback;
+    handlerDidComplete?: HandlerDidCompleteCallback;
+    handlerDidError?: HandlerDidErrorCallback;
+    handlerDidRespond?: HandlerDidRespondCallback;
+    handlerWillRespond?: HandlerWillRespondCallback;
+    handlerWillStart?: HandlerWillStartCallback;
+    requestWillFetch?: RequestWillFetchCallback;
+}
+export interface WorkboxPluginCallbackParam {
+    cacheDidUpdate: CacheDidUpdateCallbackParam;
+    cachedResponseWillBeUsed: CachedResponseWillBeUsedCallbackParam;
+    cacheKeyWillBeUsed: CacheKeyWillBeUsedCallbackParam;
+    cacheWillUpdate: CacheWillUpdateCallbackParam;
+    fetchDidFail: FetchDidFailCallbackParam;
+    fetchDidSucceed: FetchDidSucceedCallbackParam;
+    handlerDidComplete: HandlerDidCompleteCallbackParam;
+    handlerDidError: HandlerDidErrorCallbackParam;
+    handlerDidRespond: HandlerDidRespondCallbackParam;
+    handlerWillRespond: HandlerWillRespondCallbackParam;
+    handlerWillStart: HandlerWillStartCallbackParam;
+    requestWillFetch: RequestWillFetchCallbackParam;
+}
diff --git a/tools/ui/node_modules/workbox-core/types.js b/tools/ui/node_modules/workbox-core/types.js
new file mode 100644
index 0000000000000000000000000000000000000000..49de87b42b8868039022123f24c28be28fce527f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/types.js
@@ -0,0 +1,8 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import './_version.js';
diff --git a/tools/ui/node_modules/workbox-core/types.mjs b/tools/ui/node_modules/workbox-core/types.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..8234c6c66d449dc48f9750e84bb1d48ae0207673
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/types.mjs
@@ -0,0 +1 @@
+export * from './types.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/utils/pluginUtils.d.ts b/tools/ui/node_modules/workbox-core/utils/pluginUtils.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aeb8812dfeb63c3efbbb63fe482e3610f330ea4d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/pluginUtils.d.ts
@@ -0,0 +1,5 @@
+import { WorkboxPlugin } from '../types.js';
+import '../_version.js';
+export declare const pluginUtils: {
+    filter: (plugins: WorkboxPlugin[], callbackName: string) => WorkboxPlugin[];
+};
diff --git a/tools/ui/node_modules/workbox-core/utils/pluginUtils.js b/tools/ui/node_modules/workbox-core/utils/pluginUtils.js
new file mode 100644
index 0000000000000000000000000000000000000000..10d20f165fd44724eb97209194714d8b0ed7bdcb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/pluginUtils.js
@@ -0,0 +1,13 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+export const pluginUtils = {
+    filter: (plugins, callbackName) => {
+        return plugins.filter((plugin) => callbackName in plugin);
+    },
+};
diff --git a/tools/ui/node_modules/workbox-core/utils/pluginUtils.mjs b/tools/ui/node_modules/workbox-core/utils/pluginUtils.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..ceace2c3201ad9e2c51f5859fb7dfd81c286cfe2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/pluginUtils.mjs
@@ -0,0 +1 @@
+export * from './pluginUtils.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-core/utils/welcome.d.ts b/tools/ui/node_modules/workbox-core/utils/welcome.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6886ce2389d4577da196a9cbd6dc44d787f81016
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/welcome.d.ts
@@ -0,0 +1 @@
+import '../_version.js';
diff --git a/tools/ui/node_modules/workbox-core/utils/welcome.js b/tools/ui/node_modules/workbox-core/utils/welcome.js
new file mode 100644
index 0000000000000000000000000000000000000000..8f65d4e85758f7c589363969ecf38911f944bf5f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/welcome.js
@@ -0,0 +1,25 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from '../_private/logger.js';
+import '../_version.js';
+// A WorkboxCore instance must be exported before we can use the logger.
+// This is so it can get the current log level.
+if (process.env.NODE_ENV !== 'production') {
+    const padding = '   ';
+    logger.groupCollapsed('Welcome to Workbox!');
+    logger.log(`You are currently using a development build. ` +
+        `By default this will switch to prod builds when not on localhost. ` +
+        `You can force this with workbox.setConfig({debug: true|false}).`);
+    logger.log(`📖 Read the guides and documentation\n` +
+        `${padding}https://developers.google.com/web/tools/workbox/`);
+    logger.log(`❓ Use the [workbox] tag on Stack Overflow to ask questions\n` +
+        `${padding}https://stackoverflow.com/questions/ask?tags=workbox`);
+    logger.log(`🐛 Found a bug? Report it on GitHub\n` +
+        `${padding}https://github.com/GoogleChrome/workbox/issues/new`);
+    logger.groupEnd();
+}
diff --git a/tools/ui/node_modules/workbox-core/utils/welcome.mjs b/tools/ui/node_modules/workbox-core/utils/welcome.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..c23bdfc0bf2e89d87921e1acebf9d72b36cc09ac
--- /dev/null
+++ b/tools/ui/node_modules/workbox-core/utils/welcome.mjs
@@ -0,0 +1 @@
+export * from './welcome.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/CacheExpiration.d.ts b/tools/ui/node_modules/workbox-expiration/CacheExpiration.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f066df5c0b84d9b61d293374f77333fe036780a8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/CacheExpiration.d.ts
@@ -0,0 +1,66 @@
+import './_version.js';
+interface CacheExpirationConfig {
+    maxEntries?: number;
+    maxAgeSeconds?: number;
+    matchOptions?: CacheQueryOptions;
+}
+/**
+ * The `CacheExpiration` class allows you define an expiration and / or
+ * limit on the number of responses stored in a
+ * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
+ *
+ * @memberof workbox-expiration
+ */
+declare class CacheExpiration {
+    private _isRunning;
+    private _rerunRequested;
+    private readonly _maxEntries?;
+    private readonly _maxAgeSeconds?;
+    private readonly _matchOptions?;
+    private readonly _cacheName;
+    private readonly _timestampModel;
+    /**
+     * To construct a new CacheExpiration instance you must provide at least
+     * one of the `config` properties.
+     *
+     * @param {string} cacheName Name of the cache to apply restrictions to.
+     * @param {Object} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     */
+    constructor(cacheName: string, config?: CacheExpirationConfig);
+    /**
+     * Expires entries for the given cache and given criteria.
+     */
+    expireEntries(): Promise;
+    /**
+     * Update the timestamp for the given URL. This ensures the when
+     * removing entries based on maximum entries, most recently used
+     * is accurate or when expiring, the timestamp is up-to-date.
+     *
+     * @param {string} url
+     */
+    updateTimestamp(url: string): Promise;
+    /**
+     * Can be used to check if a URL has expired or not before it's used.
+     *
+     * This requires a look up from IndexedDB, so can be slow.
+     *
+     * Note: This method will not remove the cached entry, call
+     * `expireEntries()` to remove indexedDB and Cache entries.
+     *
+     * @param {string} url
+     * @return {boolean}
+     */
+    isURLExpired(url: string): Promise;
+    /**
+     * Removes the IndexedDB object store used to keep track of cache expiration
+     * metadata.
+     */
+    delete(): Promise;
+}
+export { CacheExpiration };
diff --git a/tools/ui/node_modules/workbox-expiration/CacheExpiration.js b/tools/ui/node_modules/workbox-expiration/CacheExpiration.js
new file mode 100644
index 0000000000000000000000000000000000000000..45947959a96696f04f7256b7de65ab7e89fb38d1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/CacheExpiration.js
@@ -0,0 +1,169 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { CacheTimestampsModel } from './models/CacheTimestampsModel.js';
+import './_version.js';
+/**
+ * The `CacheExpiration` class allows you define an expiration and / or
+ * limit on the number of responses stored in a
+ * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
+ *
+ * @memberof workbox-expiration
+ */
+class CacheExpiration {
+    /**
+     * To construct a new CacheExpiration instance you must provide at least
+     * one of the `config` properties.
+     *
+     * @param {string} cacheName Name of the cache to apply restrictions to.
+     * @param {Object} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     */
+    constructor(cacheName, config = {}) {
+        this._isRunning = false;
+        this._rerunRequested = false;
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isType(cacheName, 'string', {
+                moduleName: 'workbox-expiration',
+                className: 'CacheExpiration',
+                funcName: 'constructor',
+                paramName: 'cacheName',
+            });
+            if (!(config.maxEntries || config.maxAgeSeconds)) {
+                throw new WorkboxError('max-entries-or-age-required', {
+                    moduleName: 'workbox-expiration',
+                    className: 'CacheExpiration',
+                    funcName: 'constructor',
+                });
+            }
+            if (config.maxEntries) {
+                assert.isType(config.maxEntries, 'number', {
+                    moduleName: 'workbox-expiration',
+                    className: 'CacheExpiration',
+                    funcName: 'constructor',
+                    paramName: 'config.maxEntries',
+                });
+            }
+            if (config.maxAgeSeconds) {
+                assert.isType(config.maxAgeSeconds, 'number', {
+                    moduleName: 'workbox-expiration',
+                    className: 'CacheExpiration',
+                    funcName: 'constructor',
+                    paramName: 'config.maxAgeSeconds',
+                });
+            }
+        }
+        this._maxEntries = config.maxEntries;
+        this._maxAgeSeconds = config.maxAgeSeconds;
+        this._matchOptions = config.matchOptions;
+        this._cacheName = cacheName;
+        this._timestampModel = new CacheTimestampsModel(cacheName);
+    }
+    /**
+     * Expires entries for the given cache and given criteria.
+     */
+    async expireEntries() {
+        if (this._isRunning) {
+            this._rerunRequested = true;
+            return;
+        }
+        this._isRunning = true;
+        const minTimestamp = this._maxAgeSeconds
+            ? Date.now() - this._maxAgeSeconds * 1000
+            : 0;
+        const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);
+        // Delete URLs from the cache
+        const cache = await self.caches.open(this._cacheName);
+        for (const url of urlsExpired) {
+            await cache.delete(url, this._matchOptions);
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            if (urlsExpired.length > 0) {
+                logger.groupCollapsed(`Expired ${urlsExpired.length} ` +
+                    `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` +
+                    `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` +
+                    `'${this._cacheName}' cache.`);
+                logger.log(`Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`);
+                urlsExpired.forEach((url) => logger.log(`    ${url}`));
+                logger.groupEnd();
+            }
+            else {
+                logger.debug(`Cache expiration ran and found no entries to remove.`);
+            }
+        }
+        this._isRunning = false;
+        if (this._rerunRequested) {
+            this._rerunRequested = false;
+            dontWaitFor(this.expireEntries());
+        }
+    }
+    /**
+     * Update the timestamp for the given URL. This ensures the when
+     * removing entries based on maximum entries, most recently used
+     * is accurate or when expiring, the timestamp is up-to-date.
+     *
+     * @param {string} url
+     */
+    async updateTimestamp(url) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isType(url, 'string', {
+                moduleName: 'workbox-expiration',
+                className: 'CacheExpiration',
+                funcName: 'updateTimestamp',
+                paramName: 'url',
+            });
+        }
+        await this._timestampModel.setTimestamp(url, Date.now());
+    }
+    /**
+     * Can be used to check if a URL has expired or not before it's used.
+     *
+     * This requires a look up from IndexedDB, so can be slow.
+     *
+     * Note: This method will not remove the cached entry, call
+     * `expireEntries()` to remove indexedDB and Cache entries.
+     *
+     * @param {string} url
+     * @return {boolean}
+     */
+    async isURLExpired(url) {
+        if (!this._maxAgeSeconds) {
+            if (process.env.NODE_ENV !== 'production') {
+                throw new WorkboxError(`expired-test-without-max-age`, {
+                    methodName: 'isURLExpired',
+                    paramName: 'maxAgeSeconds',
+                });
+            }
+            return false;
+        }
+        else {
+            const timestamp = await this._timestampModel.getTimestamp(url);
+            const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;
+            return timestamp !== undefined ? timestamp < expireOlderThan : true;
+        }
+    }
+    /**
+     * Removes the IndexedDB object store used to keep track of cache expiration
+     * metadata.
+     */
+    async delete() {
+        // Make sure we don't attempt another rerun if we're called in the middle of
+        // a cache expiration.
+        this._rerunRequested = false;
+        await this._timestampModel.expireEntries(Infinity); // Expires all.
+    }
+}
+export { CacheExpiration };
diff --git a/tools/ui/node_modules/workbox-expiration/CacheExpiration.mjs b/tools/ui/node_modules/workbox-expiration/CacheExpiration.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..528bff2c1b624395d772cfddd5e8e40f320cbb5a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/CacheExpiration.mjs
@@ -0,0 +1 @@
+export * from './CacheExpiration.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.d.ts b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c307639d31b047951c57497b03fc11e992408bc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.d.ts
@@ -0,0 +1,122 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+export interface ExpirationPluginOptions {
+    maxEntries?: number;
+    maxAgeSeconds?: number;
+    matchOptions?: CacheQueryOptions;
+    purgeOnQuotaError?: boolean;
+}
+/**
+ * This plugin can be used in a `workbox-strategy` to regularly enforce a
+ * limit on the age and / or the number of cached requests.
+ *
+ * It can only be used with `workbox-strategy` instances that have a
+ * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).
+ * In other words, it can't be used to expire entries in strategy that uses the
+ * default runtime cache name.
+ *
+ * Whenever a cached response is used or updated, this plugin will look
+ * at the associated cache and remove any old or extra responses.
+ *
+ * When using `maxAgeSeconds`, responses may be used *once* after expiring
+ * because the expiration clean up will not have occurred until *after* the
+ * cached response has been used. If the response has a "Date" header, then
+ * a light weight expiration check is performed and the response will not be
+ * used immediately.
+ *
+ * When using `maxEntries`, the entry least-recently requested will be removed
+ * from the cache first.
+ *
+ * @memberof workbox-expiration
+ */
+declare class ExpirationPlugin implements WorkboxPlugin {
+    private readonly _config;
+    private readonly _maxAgeSeconds?;
+    private _cacheExpirations;
+    /**
+     * @param {ExpirationPluginOptions} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to
+     * automatic deletion if the available storage quota has been exceeded.
+     */
+    constructor(config?: ExpirationPluginOptions);
+    /**
+     * A simple helper method to return a CacheExpiration instance for a given
+     * cache name.
+     *
+     * @param {string} cacheName
+     * @return {CacheExpiration}
+     *
+     * @private
+     */
+    private _getCacheExpiration;
+    /**
+     * A "lifecycle" callback that will be triggered automatically by the
+     * `workbox-strategies` handlers when a `Response` is about to be returned
+     * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to
+     * the handler. It allows the `Response` to be inspected for freshness and
+     * prevents it from being used if the `Response`'s `Date` header value is
+     * older than the configured `maxAgeSeconds`.
+     *
+     * @param {Object} options
+     * @param {string} options.cacheName Name of the cache the response is in.
+     * @param {Response} options.cachedResponse The `Response` object that's been
+     *     read from a cache and whose freshness should be checked.
+     * @return {Response} Either the `cachedResponse`, if it's
+     *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.
+     *
+     * @private
+     */
+    cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'];
+    /**
+     * @param {Response} cachedResponse
+     * @return {boolean}
+     *
+     * @private
+     */
+    private _isResponseDateFresh;
+    /**
+     * This method will extract the data header and parse it into a useful
+     * value.
+     *
+     * @param {Response} cachedResponse
+     * @return {number|null}
+     *
+     * @private
+     */
+    private _getDateHeaderTimestamp;
+    /**
+     * A "lifecycle" callback that will be triggered automatically by the
+     * `workbox-strategies` handlers when an entry is added to a cache.
+     *
+     * @param {Object} options
+     * @param {string} options.cacheName Name of the cache that was updated.
+     * @param {string} options.request The Request for the cached entry.
+     *
+     * @private
+     */
+    cacheDidUpdate: WorkboxPlugin['cacheDidUpdate'];
+    /**
+     * This is a helper method that performs two operations:
+     *
+     * - Deletes *all* the underlying Cache instances associated with this plugin
+     * instance, by calling caches.delete() on your behalf.
+     * - Deletes the metadata from IndexedDB used to keep track of expiration
+     * details for each Cache instance.
+     *
+     * When using cache expiration, calling this method is preferable to calling
+     * `caches.delete()` directly, since this will ensure that the IndexedDB
+     * metadata is also cleanly removed and open IndexedDB instances are deleted.
+     *
+     * Note that if you're *not* using cache expiration for a given cache, calling
+     * `caches.delete()` and passing in the cache's name should be sufficient.
+     * There is no Workbox-specific method needed for cleanup in that case.
+     */
+    deleteCacheAndMetadata(): Promise;
+}
+export { ExpirationPlugin };
diff --git a/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.js b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d7a46e482679d03fd7d3421b7309c907493760f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.js
@@ -0,0 +1,254 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { registerQuotaErrorCallback } from 'workbox-core/registerQuotaErrorCallback.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { CacheExpiration } from './CacheExpiration.js';
+import './_version.js';
+/**
+ * This plugin can be used in a `workbox-strategy` to regularly enforce a
+ * limit on the age and / or the number of cached requests.
+ *
+ * It can only be used with `workbox-strategy` instances that have a
+ * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).
+ * In other words, it can't be used to expire entries in strategy that uses the
+ * default runtime cache name.
+ *
+ * Whenever a cached response is used or updated, this plugin will look
+ * at the associated cache and remove any old or extra responses.
+ *
+ * When using `maxAgeSeconds`, responses may be used *once* after expiring
+ * because the expiration clean up will not have occurred until *after* the
+ * cached response has been used. If the response has a "Date" header, then
+ * a light weight expiration check is performed and the response will not be
+ * used immediately.
+ *
+ * When using `maxEntries`, the entry least-recently requested will be removed
+ * from the cache first.
+ *
+ * @memberof workbox-expiration
+ */
+class ExpirationPlugin {
+    /**
+     * @param {ExpirationPluginOptions} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to
+     * automatic deletion if the available storage quota has been exceeded.
+     */
+    constructor(config = {}) {
+        /**
+         * A "lifecycle" callback that will be triggered automatically by the
+         * `workbox-strategies` handlers when a `Response` is about to be returned
+         * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to
+         * the handler. It allows the `Response` to be inspected for freshness and
+         * prevents it from being used if the `Response`'s `Date` header value is
+         * older than the configured `maxAgeSeconds`.
+         *
+         * @param {Object} options
+         * @param {string} options.cacheName Name of the cache the response is in.
+         * @param {Response} options.cachedResponse The `Response` object that's been
+         *     read from a cache and whose freshness should be checked.
+         * @return {Response} Either the `cachedResponse`, if it's
+         *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.
+         *
+         * @private
+         */
+        this.cachedResponseWillBeUsed = async ({ event, request, cacheName, cachedResponse, }) => {
+            if (!cachedResponse) {
+                return null;
+            }
+            const isFresh = this._isResponseDateFresh(cachedResponse);
+            // Expire entries to ensure that even if the expiration date has
+            // expired, it'll only be used once.
+            const cacheExpiration = this._getCacheExpiration(cacheName);
+            dontWaitFor(cacheExpiration.expireEntries());
+            // Update the metadata for the request URL to the current timestamp,
+            // but don't `await` it as we don't want to block the response.
+            const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);
+            if (event) {
+                try {
+                    event.waitUntil(updateTimestampDone);
+                }
+                catch (error) {
+                    if (process.env.NODE_ENV !== 'production') {
+                        // The event may not be a fetch event; only log the URL if it is.
+                        if ('request' in event) {
+                            logger.warn(`Unable to ensure service worker stays alive when ` +
+                                `updating cache entry for ` +
+                                `'${getFriendlyURL(event.request.url)}'.`);
+                        }
+                    }
+                }
+            }
+            return isFresh ? cachedResponse : null;
+        };
+        /**
+         * A "lifecycle" callback that will be triggered automatically by the
+         * `workbox-strategies` handlers when an entry is added to a cache.
+         *
+         * @param {Object} options
+         * @param {string} options.cacheName Name of the cache that was updated.
+         * @param {string} options.request The Request for the cached entry.
+         *
+         * @private
+         */
+        this.cacheDidUpdate = async ({ cacheName, request, }) => {
+            if (process.env.NODE_ENV !== 'production') {
+                assert.isType(cacheName, 'string', {
+                    moduleName: 'workbox-expiration',
+                    className: 'Plugin',
+                    funcName: 'cacheDidUpdate',
+                    paramName: 'cacheName',
+                });
+                assert.isInstance(request, Request, {
+                    moduleName: 'workbox-expiration',
+                    className: 'Plugin',
+                    funcName: 'cacheDidUpdate',
+                    paramName: 'request',
+                });
+            }
+            const cacheExpiration = this._getCacheExpiration(cacheName);
+            await cacheExpiration.updateTimestamp(request.url);
+            await cacheExpiration.expireEntries();
+        };
+        if (process.env.NODE_ENV !== 'production') {
+            if (!(config.maxEntries || config.maxAgeSeconds)) {
+                throw new WorkboxError('max-entries-or-age-required', {
+                    moduleName: 'workbox-expiration',
+                    className: 'Plugin',
+                    funcName: 'constructor',
+                });
+            }
+            if (config.maxEntries) {
+                assert.isType(config.maxEntries, 'number', {
+                    moduleName: 'workbox-expiration',
+                    className: 'Plugin',
+                    funcName: 'constructor',
+                    paramName: 'config.maxEntries',
+                });
+            }
+            if (config.maxAgeSeconds) {
+                assert.isType(config.maxAgeSeconds, 'number', {
+                    moduleName: 'workbox-expiration',
+                    className: 'Plugin',
+                    funcName: 'constructor',
+                    paramName: 'config.maxAgeSeconds',
+                });
+            }
+        }
+        this._config = config;
+        this._maxAgeSeconds = config.maxAgeSeconds;
+        this._cacheExpirations = new Map();
+        if (config.purgeOnQuotaError) {
+            registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());
+        }
+    }
+    /**
+     * A simple helper method to return a CacheExpiration instance for a given
+     * cache name.
+     *
+     * @param {string} cacheName
+     * @return {CacheExpiration}
+     *
+     * @private
+     */
+    _getCacheExpiration(cacheName) {
+        if (cacheName === cacheNames.getRuntimeName()) {
+            throw new WorkboxError('expire-custom-caches-only');
+        }
+        let cacheExpiration = this._cacheExpirations.get(cacheName);
+        if (!cacheExpiration) {
+            cacheExpiration = new CacheExpiration(cacheName, this._config);
+            this._cacheExpirations.set(cacheName, cacheExpiration);
+        }
+        return cacheExpiration;
+    }
+    /**
+     * @param {Response} cachedResponse
+     * @return {boolean}
+     *
+     * @private
+     */
+    _isResponseDateFresh(cachedResponse) {
+        if (!this._maxAgeSeconds) {
+            // We aren't expiring by age, so return true, it's fresh
+            return true;
+        }
+        // Check if the 'date' header will suffice a quick expiration check.
+        // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for
+        // discussion.
+        const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);
+        if (dateHeaderTimestamp === null) {
+            // Unable to parse date, so assume it's fresh.
+            return true;
+        }
+        // If we have a valid headerTime, then our response is fresh iff the
+        // headerTime plus maxAgeSeconds is greater than the current time.
+        const now = Date.now();
+        return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;
+    }
+    /**
+     * This method will extract the data header and parse it into a useful
+     * value.
+     *
+     * @param {Response} cachedResponse
+     * @return {number|null}
+     *
+     * @private
+     */
+    _getDateHeaderTimestamp(cachedResponse) {
+        if (!cachedResponse.headers.has('date')) {
+            return null;
+        }
+        const dateHeader = cachedResponse.headers.get('date');
+        const parsedDate = new Date(dateHeader);
+        const headerTime = parsedDate.getTime();
+        // If the Date header was invalid for some reason, parsedDate.getTime()
+        // will return NaN.
+        if (isNaN(headerTime)) {
+            return null;
+        }
+        return headerTime;
+    }
+    /**
+     * This is a helper method that performs two operations:
+     *
+     * - Deletes *all* the underlying Cache instances associated with this plugin
+     * instance, by calling caches.delete() on your behalf.
+     * - Deletes the metadata from IndexedDB used to keep track of expiration
+     * details for each Cache instance.
+     *
+     * When using cache expiration, calling this method is preferable to calling
+     * `caches.delete()` directly, since this will ensure that the IndexedDB
+     * metadata is also cleanly removed and open IndexedDB instances are deleted.
+     *
+     * Note that if you're *not* using cache expiration for a given cache, calling
+     * `caches.delete()` and passing in the cache's name should be sufficient.
+     * There is no Workbox-specific method needed for cleanup in that case.
+     */
+    async deleteCacheAndMetadata() {
+        // Do this one at a time instead of all at once via `Promise.all()` to
+        // reduce the chance of inconsistency if a promise rejects.
+        for (const [cacheName, cacheExpiration] of this._cacheExpirations) {
+            await self.caches.delete(cacheName);
+            await cacheExpiration.delete();
+        }
+        // Reset this._cacheExpirations to its initial state.
+        this._cacheExpirations = new Map();
+    }
+}
+export { ExpirationPlugin };
diff --git a/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.mjs b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..505c404cf9d731b63bbe31b37925dc89637b2ce5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/ExpirationPlugin.mjs
@@ -0,0 +1 @@
+export * from './ExpirationPlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/LICENSE b/tools/ui/node_modules/workbox-expiration/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-expiration/README.md b/tools/ui/node_modules/workbox-expiration/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9f3b1962771f4b7fc28fe5e256d5d7e57a4d26b8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-expiration
diff --git a/tools/ui/node_modules/workbox-expiration/_version.d.ts b/tools/ui/node_modules/workbox-expiration/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-expiration/_version.js b/tools/ui/node_modules/workbox-expiration/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..a223a66467ee7ddfb7d5b9d068a6a287ae21c655
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:expiration:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-expiration/_version.mjs b/tools/ui/node_modules/workbox-expiration/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..f9d8bae4842f12230b5ccc58521a47a443c1ab6a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:expiration:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..bb392bd4f89a7eb62c985f572a1a71aa67b86bbd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js
@@ -0,0 +1,848 @@
+this.workbox = this.workbox || {};
+this.workbox.expiration = (function (exports, assert_js, dontWaitFor_js, logger_js, WorkboxError_js, cacheNames_js, getFriendlyURL_js, registerQuotaErrorCallback_js) {
+  'use strict';
+
+  function _extends() {
+    return _extends = Object.assign ? Object.assign.bind() : function (n) {
+      for (var e = 1; e < arguments.length; e++) {
+        var t = arguments[e];
+        for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
+      }
+      return n;
+    }, _extends.apply(null, arguments);
+  }
+
+  const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c);
+  let idbProxyableTypes;
+  let cursorAdvanceMethods;
+  // This is a function to prevent it throwing up in node environments.
+  function getIdbProxyableTypes() {
+    return idbProxyableTypes || (idbProxyableTypes = [IDBDatabase, IDBObjectStore, IDBIndex, IDBCursor, IDBTransaction]);
+  }
+  // This is a function to prevent it throwing up in node environments.
+  function getCursorAdvanceMethods() {
+    return cursorAdvanceMethods || (cursorAdvanceMethods = [IDBCursor.prototype.advance, IDBCursor.prototype.continue, IDBCursor.prototype.continuePrimaryKey]);
+  }
+  const cursorRequestMap = new WeakMap();
+  const transactionDoneMap = new WeakMap();
+  const transactionStoreNamesMap = new WeakMap();
+  const transformCache = new WeakMap();
+  const reverseTransformCache = new WeakMap();
+  function promisifyRequest(request) {
+    const promise = new Promise((resolve, reject) => {
+      const unlisten = () => {
+        request.removeEventListener('success', success);
+        request.removeEventListener('error', error);
+      };
+      const success = () => {
+        resolve(wrap(request.result));
+        unlisten();
+      };
+      const error = () => {
+        reject(request.error);
+        unlisten();
+      };
+      request.addEventListener('success', success);
+      request.addEventListener('error', error);
+    });
+    promise.then(value => {
+      // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval
+      // (see wrapFunction).
+      if (value instanceof IDBCursor) {
+        cursorRequestMap.set(value, request);
+      }
+      // Catching to avoid "Uncaught Promise exceptions"
+    }).catch(() => {});
+    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This
+    // is because we create many promises from a single IDBRequest.
+    reverseTransformCache.set(promise, request);
+    return promise;
+  }
+  function cacheDonePromiseForTransaction(tx) {
+    // Early bail if we've already created a done promise for this transaction.
+    if (transactionDoneMap.has(tx)) return;
+    const done = new Promise((resolve, reject) => {
+      const unlisten = () => {
+        tx.removeEventListener('complete', complete);
+        tx.removeEventListener('error', error);
+        tx.removeEventListener('abort', error);
+      };
+      const complete = () => {
+        resolve();
+        unlisten();
+      };
+      const error = () => {
+        reject(tx.error || new DOMException('AbortError', 'AbortError'));
+        unlisten();
+      };
+      tx.addEventListener('complete', complete);
+      tx.addEventListener('error', error);
+      tx.addEventListener('abort', error);
+    });
+    // Cache it for later retrieval.
+    transactionDoneMap.set(tx, done);
+  }
+  let idbProxyTraps = {
+    get(target, prop, receiver) {
+      if (target instanceof IDBTransaction) {
+        // Special handling for transaction.done.
+        if (prop === 'done') return transactionDoneMap.get(target);
+        // Polyfill for objectStoreNames because of Edge.
+        if (prop === 'objectStoreNames') {
+          return target.objectStoreNames || transactionStoreNamesMap.get(target);
+        }
+        // Make tx.store return the only store in the transaction, or undefined if there are many.
+        if (prop === 'store') {
+          return receiver.objectStoreNames[1] ? undefined : receiver.objectStore(receiver.objectStoreNames[0]);
+        }
+      }
+      // Else transform whatever we get back.
+      return wrap(target[prop]);
+    },
+    set(target, prop, value) {
+      target[prop] = value;
+      return true;
+    },
+    has(target, prop) {
+      if (target instanceof IDBTransaction && (prop === 'done' || prop === 'store')) {
+        return true;
+      }
+      return prop in target;
+    }
+  };
+  function replaceTraps(callback) {
+    idbProxyTraps = callback(idbProxyTraps);
+  }
+  function wrapFunction(func) {
+    // Due to expected object equality (which is enforced by the caching in `wrap`), we
+    // only create one new func per func.
+    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.
+    if (func === IDBDatabase.prototype.transaction && !('objectStoreNames' in IDBTransaction.prototype)) {
+      return function (storeNames, ...args) {
+        const tx = func.call(unwrap(this), storeNames, ...args);
+        transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);
+        return wrap(tx);
+      };
+    }
+    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In
+    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the
+    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense
+    // with real promises, so each advance methods returns a new promise for the cursor object, or
+    // undefined if the end of the cursor has been reached.
+    if (getCursorAdvanceMethods().includes(func)) {
+      return function (...args) {
+        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
+        // the original object.
+        func.apply(unwrap(this), args);
+        return wrap(cursorRequestMap.get(this));
+      };
+    }
+    return function (...args) {
+      // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
+      // the original object.
+      return wrap(func.apply(unwrap(this), args));
+    };
+  }
+  function transformCachableValue(value) {
+    if (typeof value === 'function') return wrapFunction(value);
+    // This doesn't return, it just creates a 'done' promise for the transaction,
+    // which is later returned for transaction.done (see idbObjectHandler).
+    if (value instanceof IDBTransaction) cacheDonePromiseForTransaction(value);
+    if (instanceOfAny(value, getIdbProxyableTypes())) return new Proxy(value, idbProxyTraps);
+    // Return the same value back if we're not going to transform it.
+    return value;
+  }
+  function wrap(value) {
+    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because
+    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.
+    if (value instanceof IDBRequest) return promisifyRequest(value);
+    // If we've already transformed this value before, reuse the transformed value.
+    // This is faster, but it also provides object equality.
+    if (transformCache.has(value)) return transformCache.get(value);
+    const newValue = transformCachableValue(value);
+    // Not all types are transformed.
+    // These may be primitive types, so they can't be WeakMap keys.
+    if (newValue !== value) {
+      transformCache.set(value, newValue);
+      reverseTransformCache.set(newValue, value);
+    }
+    return newValue;
+  }
+  const unwrap = value => reverseTransformCache.get(value);
+
+  /**
+   * Open a database.
+   *
+   * @param name Name of the database.
+   * @param version Schema version.
+   * @param callbacks Additional callbacks.
+   */
+  function openDB(name, version, {
+    blocked,
+    upgrade,
+    blocking,
+    terminated
+  } = {}) {
+    const request = indexedDB.open(name, version);
+    const openPromise = wrap(request);
+    if (upgrade) {
+      request.addEventListener('upgradeneeded', event => {
+        upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));
+      });
+    }
+    if (blocked) request.addEventListener('blocked', () => blocked());
+    openPromise.then(db => {
+      if (terminated) db.addEventListener('close', () => terminated());
+      if (blocking) db.addEventListener('versionchange', () => blocking());
+    }).catch(() => {});
+    return openPromise;
+  }
+  /**
+   * Delete a database.
+   *
+   * @param name Name of the database.
+   */
+  function deleteDB(name, {
+    blocked
+  } = {}) {
+    const request = indexedDB.deleteDatabase(name);
+    if (blocked) request.addEventListener('blocked', () => blocked());
+    return wrap(request).then(() => undefined);
+  }
+  const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];
+  const writeMethods = ['put', 'add', 'delete', 'clear'];
+  const cachedMethods = new Map();
+  function getMethod(target, prop) {
+    if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === 'string')) {
+      return;
+    }
+    if (cachedMethods.get(prop)) return cachedMethods.get(prop);
+    const targetFuncName = prop.replace(/FromIndex$/, '');
+    const useIndex = prop !== targetFuncName;
+    const isWrite = writeMethods.includes(targetFuncName);
+    if (
+    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
+    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || !(isWrite || readMethods.includes(targetFuncName))) {
+      return;
+    }
+    const method = async function (storeName, ...args) {
+      // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(
+      const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');
+      let target = tx.store;
+      if (useIndex) target = target.index(args.shift());
+      // Must reject if op rejects.
+      // If it's a write operation, must reject if tx.done rejects.
+      // Must reject with op rejection first.
+      // Must resolve with op value.
+      // Must handle both promises (no unhandled rejections)
+      return (await Promise.all([target[targetFuncName](...args), isWrite && tx.done]))[0];
+    };
+    cachedMethods.set(prop, method);
+    return method;
+  }
+  replaceTraps(oldTraps => _extends({}, oldTraps, {
+    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),
+    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop)
+  }));
+
+  // @ts-ignore
+  try {
+    self['workbox:expiration:7.4.0'] && _();
+  } catch (e) {}
+
+  /*
+    Copyright 2018 Google LLC
+
+    Use of this source code is governed by an MIT-style
+    license that can be found in the LICENSE file or at
+    https://opensource.org/licenses/MIT.
+  */
+  const DB_NAME = 'workbox-expiration';
+  const CACHE_OBJECT_STORE = 'cache-entries';
+  const normalizeURL = unNormalizedUrl => {
+    const url = new URL(unNormalizedUrl, location.href);
+    url.hash = '';
+    return url.href;
+  };
+  /**
+   * Returns the timestamp model.
+   *
+   * @private
+   */
+  class CacheTimestampsModel {
+    /**
+     *
+     * @param {string} cacheName
+     *
+     * @private
+     */
+    constructor(cacheName) {
+      this._db = null;
+      this._cacheName = cacheName;
+    }
+    /**
+     * Performs an upgrade of indexedDB.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    _upgradeDb(db) {
+      // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we
+      // have to use the `id` keyPath here and create our own values (a
+      // concatenation of `url + cacheName`) instead of simply using
+      // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.
+      const objStore = db.createObjectStore(CACHE_OBJECT_STORE, {
+        keyPath: 'id'
+      });
+      // TODO(philipwalton): once we don't have to support EdgeHTML, we can
+      // create a single index with the keyPath `['cacheName', 'timestamp']`
+      // instead of doing both these indexes.
+      objStore.createIndex('cacheName', 'cacheName', {
+        unique: false
+      });
+      objStore.createIndex('timestamp', 'timestamp', {
+        unique: false
+      });
+    }
+    /**
+     * Performs an upgrade of indexedDB and deletes deprecated DBs.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    _upgradeDbAndDeleteOldDbs(db) {
+      this._upgradeDb(db);
+      if (this._cacheName) {
+        void deleteDB(this._cacheName);
+      }
+    }
+    /**
+     * @param {string} url
+     * @param {number} timestamp
+     *
+     * @private
+     */
+    async setTimestamp(url, timestamp) {
+      url = normalizeURL(url);
+      const entry = {
+        url,
+        timestamp,
+        cacheName: this._cacheName,
+        // Creating an ID from the URL and cache name won't be necessary once
+        // Edge switches to Chromium and all browsers we support work with
+        // array keyPaths.
+        id: this._getId(url)
+      };
+      const db = await this.getDb();
+      const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {
+        durability: 'relaxed'
+      });
+      await tx.store.put(entry);
+      await tx.done;
+    }
+    /**
+     * Returns the timestamp stored for a given URL.
+     *
+     * @param {string} url
+     * @return {number | undefined}
+     *
+     * @private
+     */
+    async getTimestamp(url) {
+      const db = await this.getDb();
+      const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));
+      return entry === null || entry === void 0 ? void 0 : entry.timestamp;
+    }
+    /**
+     * Iterates through all the entries in the object store (from newest to
+     * oldest) and removes entries once either `maxCount` is reached or the
+     * entry's timestamp is less than `minTimestamp`.
+     *
+     * @param {number} minTimestamp
+     * @param {number} maxCount
+     * @return {Array}
+     *
+     * @private
+     */
+    async expireEntries(minTimestamp, maxCount) {
+      const db = await this.getDb();
+      let cursor = await db.transaction(CACHE_OBJECT_STORE).store.index('timestamp').openCursor(null, 'prev');
+      const entriesToDelete = [];
+      let entriesNotDeletedCount = 0;
+      while (cursor) {
+        const result = cursor.value;
+        // TODO(philipwalton): once we can use a multi-key index, we
+        // won't have to check `cacheName` here.
+        if (result.cacheName === this._cacheName) {
+          // Delete an entry if it's older than the max age or
+          // if we already have the max number allowed.
+          if (minTimestamp && result.timestamp < minTimestamp || maxCount && entriesNotDeletedCount >= maxCount) {
+            // TODO(philipwalton): we should be able to delete the
+            // entry right here, but doing so causes an iteration
+            // bug in Safari stable (fixed in TP). Instead we can
+            // store the keys of the entries to delete, and then
+            // delete the separate transactions.
+            // https://github.com/GoogleChrome/workbox/issues/1978
+            // cursor.delete();
+            // We only need to return the URL, not the whole entry.
+            entriesToDelete.push(cursor.value);
+          } else {
+            entriesNotDeletedCount++;
+          }
+        }
+        cursor = await cursor.continue();
+      }
+      // TODO(philipwalton): once the Safari bug in the following issue is fixed,
+      // we should be able to remove this loop and do the entry deletion in the
+      // cursor loop above:
+      // https://github.com/GoogleChrome/workbox/issues/1978
+      const urlsDeleted = [];
+      for (const entry of entriesToDelete) {
+        await db.delete(CACHE_OBJECT_STORE, entry.id);
+        urlsDeleted.push(entry.url);
+      }
+      return urlsDeleted;
+    }
+    /**
+     * Takes a URL and returns an ID that will be unique in the object store.
+     *
+     * @param {string} url
+     * @return {string}
+     *
+     * @private
+     */
+    _getId(url) {
+      // Creating an ID from the URL and cache name won't be necessary once
+      // Edge switches to Chromium and all browsers we support work with
+      // array keyPaths.
+      return this._cacheName + '|' + normalizeURL(url);
+    }
+    /**
+     * Returns an open connection to the database.
+     *
+     * @private
+     */
+    async getDb() {
+      if (!this._db) {
+        this._db = await openDB(DB_NAME, 1, {
+          upgrade: this._upgradeDbAndDeleteOldDbs.bind(this)
+        });
+      }
+      return this._db;
+    }
+  }
+
+  /*
+    Copyright 2018 Google LLC
+
+    Use of this source code is governed by an MIT-style
+    license that can be found in the LICENSE file or at
+    https://opensource.org/licenses/MIT.
+  */
+  /**
+   * The `CacheExpiration` class allows you define an expiration and / or
+   * limit on the number of responses stored in a
+   * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
+   *
+   * @memberof workbox-expiration
+   */
+  class CacheExpiration {
+    /**
+     * To construct a new CacheExpiration instance you must provide at least
+     * one of the `config` properties.
+     *
+     * @param {string} cacheName Name of the cache to apply restrictions to.
+     * @param {Object} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     */
+    constructor(cacheName, config = {}) {
+      this._isRunning = false;
+      this._rerunRequested = false;
+      {
+        assert_js.assert.isType(cacheName, 'string', {
+          moduleName: 'workbox-expiration',
+          className: 'CacheExpiration',
+          funcName: 'constructor',
+          paramName: 'cacheName'
+        });
+        if (!(config.maxEntries || config.maxAgeSeconds)) {
+          throw new WorkboxError_js.WorkboxError('max-entries-or-age-required', {
+            moduleName: 'workbox-expiration',
+            className: 'CacheExpiration',
+            funcName: 'constructor'
+          });
+        }
+        if (config.maxEntries) {
+          assert_js.assert.isType(config.maxEntries, 'number', {
+            moduleName: 'workbox-expiration',
+            className: 'CacheExpiration',
+            funcName: 'constructor',
+            paramName: 'config.maxEntries'
+          });
+        }
+        if (config.maxAgeSeconds) {
+          assert_js.assert.isType(config.maxAgeSeconds, 'number', {
+            moduleName: 'workbox-expiration',
+            className: 'CacheExpiration',
+            funcName: 'constructor',
+            paramName: 'config.maxAgeSeconds'
+          });
+        }
+      }
+      this._maxEntries = config.maxEntries;
+      this._maxAgeSeconds = config.maxAgeSeconds;
+      this._matchOptions = config.matchOptions;
+      this._cacheName = cacheName;
+      this._timestampModel = new CacheTimestampsModel(cacheName);
+    }
+    /**
+     * Expires entries for the given cache and given criteria.
+     */
+    async expireEntries() {
+      if (this._isRunning) {
+        this._rerunRequested = true;
+        return;
+      }
+      this._isRunning = true;
+      const minTimestamp = this._maxAgeSeconds ? Date.now() - this._maxAgeSeconds * 1000 : 0;
+      const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);
+      // Delete URLs from the cache
+      const cache = await self.caches.open(this._cacheName);
+      for (const url of urlsExpired) {
+        await cache.delete(url, this._matchOptions);
+      }
+      {
+        if (urlsExpired.length > 0) {
+          logger_js.logger.groupCollapsed(`Expired ${urlsExpired.length} ` + `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` + `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` + `'${this._cacheName}' cache.`);
+          logger_js.logger.log(`Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`);
+          urlsExpired.forEach(url => logger_js.logger.log(`    ${url}`));
+          logger_js.logger.groupEnd();
+        } else {
+          logger_js.logger.debug(`Cache expiration ran and found no entries to remove.`);
+        }
+      }
+      this._isRunning = false;
+      if (this._rerunRequested) {
+        this._rerunRequested = false;
+        dontWaitFor_js.dontWaitFor(this.expireEntries());
+      }
+    }
+    /**
+     * Update the timestamp for the given URL. This ensures the when
+     * removing entries based on maximum entries, most recently used
+     * is accurate or when expiring, the timestamp is up-to-date.
+     *
+     * @param {string} url
+     */
+    async updateTimestamp(url) {
+      {
+        assert_js.assert.isType(url, 'string', {
+          moduleName: 'workbox-expiration',
+          className: 'CacheExpiration',
+          funcName: 'updateTimestamp',
+          paramName: 'url'
+        });
+      }
+      await this._timestampModel.setTimestamp(url, Date.now());
+    }
+    /**
+     * Can be used to check if a URL has expired or not before it's used.
+     *
+     * This requires a look up from IndexedDB, so can be slow.
+     *
+     * Note: This method will not remove the cached entry, call
+     * `expireEntries()` to remove indexedDB and Cache entries.
+     *
+     * @param {string} url
+     * @return {boolean}
+     */
+    async isURLExpired(url) {
+      if (!this._maxAgeSeconds) {
+        {
+          throw new WorkboxError_js.WorkboxError(`expired-test-without-max-age`, {
+            methodName: 'isURLExpired',
+            paramName: 'maxAgeSeconds'
+          });
+        }
+      } else {
+        const timestamp = await this._timestampModel.getTimestamp(url);
+        const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;
+        return timestamp !== undefined ? timestamp < expireOlderThan : true;
+      }
+    }
+    /**
+     * Removes the IndexedDB object store used to keep track of cache expiration
+     * metadata.
+     */
+    async delete() {
+      // Make sure we don't attempt another rerun if we're called in the middle of
+      // a cache expiration.
+      this._rerunRequested = false;
+      await this._timestampModel.expireEntries(Infinity); // Expires all.
+    }
+  }
+
+  /*
+    Copyright 2018 Google LLC
+
+    Use of this source code is governed by an MIT-style
+    license that can be found in the LICENSE file or at
+    https://opensource.org/licenses/MIT.
+  */
+  /**
+   * This plugin can be used in a `workbox-strategy` to regularly enforce a
+   * limit on the age and / or the number of cached requests.
+   *
+   * It can only be used with `workbox-strategy` instances that have a
+   * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).
+   * In other words, it can't be used to expire entries in strategy that uses the
+   * default runtime cache name.
+   *
+   * Whenever a cached response is used or updated, this plugin will look
+   * at the associated cache and remove any old or extra responses.
+   *
+   * When using `maxAgeSeconds`, responses may be used *once* after expiring
+   * because the expiration clean up will not have occurred until *after* the
+   * cached response has been used. If the response has a "Date" header, then
+   * a light weight expiration check is performed and the response will not be
+   * used immediately.
+   *
+   * When using `maxEntries`, the entry least-recently requested will be removed
+   * from the cache first.
+   *
+   * @memberof workbox-expiration
+   */
+  class ExpirationPlugin {
+    /**
+     * @param {ExpirationPluginOptions} config
+     * @param {number} [config.maxEntries] The maximum number of entries to cache.
+     * Entries used the least will be removed as the maximum is reached.
+     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+     * it's treated as stale and removed.
+     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+     * that will be used when calling `delete()` on the cache.
+     * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to
+     * automatic deletion if the available storage quota has been exceeded.
+     */
+    constructor(config = {}) {
+      /**
+       * A "lifecycle" callback that will be triggered automatically by the
+       * `workbox-strategies` handlers when a `Response` is about to be returned
+       * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to
+       * the handler. It allows the `Response` to be inspected for freshness and
+       * prevents it from being used if the `Response`'s `Date` header value is
+       * older than the configured `maxAgeSeconds`.
+       *
+       * @param {Object} options
+       * @param {string} options.cacheName Name of the cache the response is in.
+       * @param {Response} options.cachedResponse The `Response` object that's been
+       *     read from a cache and whose freshness should be checked.
+       * @return {Response} Either the `cachedResponse`, if it's
+       *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.
+       *
+       * @private
+       */
+      this.cachedResponseWillBeUsed = async ({
+        event,
+        request,
+        cacheName,
+        cachedResponse
+      }) => {
+        if (!cachedResponse) {
+          return null;
+        }
+        const isFresh = this._isResponseDateFresh(cachedResponse);
+        // Expire entries to ensure that even if the expiration date has
+        // expired, it'll only be used once.
+        const cacheExpiration = this._getCacheExpiration(cacheName);
+        dontWaitFor_js.dontWaitFor(cacheExpiration.expireEntries());
+        // Update the metadata for the request URL to the current timestamp,
+        // but don't `await` it as we don't want to block the response.
+        const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);
+        if (event) {
+          try {
+            event.waitUntil(updateTimestampDone);
+          } catch (error) {
+            {
+              // The event may not be a fetch event; only log the URL if it is.
+              if ('request' in event) {
+                logger_js.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache entry for ` + `'${getFriendlyURL_js.getFriendlyURL(event.request.url)}'.`);
+              }
+            }
+          }
+        }
+        return isFresh ? cachedResponse : null;
+      };
+      /**
+       * A "lifecycle" callback that will be triggered automatically by the
+       * `workbox-strategies` handlers when an entry is added to a cache.
+       *
+       * @param {Object} options
+       * @param {string} options.cacheName Name of the cache that was updated.
+       * @param {string} options.request The Request for the cached entry.
+       *
+       * @private
+       */
+      this.cacheDidUpdate = async ({
+        cacheName,
+        request
+      }) => {
+        {
+          assert_js.assert.isType(cacheName, 'string', {
+            moduleName: 'workbox-expiration',
+            className: 'Plugin',
+            funcName: 'cacheDidUpdate',
+            paramName: 'cacheName'
+          });
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-expiration',
+            className: 'Plugin',
+            funcName: 'cacheDidUpdate',
+            paramName: 'request'
+          });
+        }
+        const cacheExpiration = this._getCacheExpiration(cacheName);
+        await cacheExpiration.updateTimestamp(request.url);
+        await cacheExpiration.expireEntries();
+      };
+      {
+        if (!(config.maxEntries || config.maxAgeSeconds)) {
+          throw new WorkboxError_js.WorkboxError('max-entries-or-age-required', {
+            moduleName: 'workbox-expiration',
+            className: 'Plugin',
+            funcName: 'constructor'
+          });
+        }
+        if (config.maxEntries) {
+          assert_js.assert.isType(config.maxEntries, 'number', {
+            moduleName: 'workbox-expiration',
+            className: 'Plugin',
+            funcName: 'constructor',
+            paramName: 'config.maxEntries'
+          });
+        }
+        if (config.maxAgeSeconds) {
+          assert_js.assert.isType(config.maxAgeSeconds, 'number', {
+            moduleName: 'workbox-expiration',
+            className: 'Plugin',
+            funcName: 'constructor',
+            paramName: 'config.maxAgeSeconds'
+          });
+        }
+      }
+      this._config = config;
+      this._maxAgeSeconds = config.maxAgeSeconds;
+      this._cacheExpirations = new Map();
+      if (config.purgeOnQuotaError) {
+        registerQuotaErrorCallback_js.registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());
+      }
+    }
+    /**
+     * A simple helper method to return a CacheExpiration instance for a given
+     * cache name.
+     *
+     * @param {string} cacheName
+     * @return {CacheExpiration}
+     *
+     * @private
+     */
+    _getCacheExpiration(cacheName) {
+      if (cacheName === cacheNames_js.cacheNames.getRuntimeName()) {
+        throw new WorkboxError_js.WorkboxError('expire-custom-caches-only');
+      }
+      let cacheExpiration = this._cacheExpirations.get(cacheName);
+      if (!cacheExpiration) {
+        cacheExpiration = new CacheExpiration(cacheName, this._config);
+        this._cacheExpirations.set(cacheName, cacheExpiration);
+      }
+      return cacheExpiration;
+    }
+    /**
+     * @param {Response} cachedResponse
+     * @return {boolean}
+     *
+     * @private
+     */
+    _isResponseDateFresh(cachedResponse) {
+      if (!this._maxAgeSeconds) {
+        // We aren't expiring by age, so return true, it's fresh
+        return true;
+      }
+      // Check if the 'date' header will suffice a quick expiration check.
+      // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for
+      // discussion.
+      const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);
+      if (dateHeaderTimestamp === null) {
+        // Unable to parse date, so assume it's fresh.
+        return true;
+      }
+      // If we have a valid headerTime, then our response is fresh iff the
+      // headerTime plus maxAgeSeconds is greater than the current time.
+      const now = Date.now();
+      return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;
+    }
+    /**
+     * This method will extract the data header and parse it into a useful
+     * value.
+     *
+     * @param {Response} cachedResponse
+     * @return {number|null}
+     *
+     * @private
+     */
+    _getDateHeaderTimestamp(cachedResponse) {
+      if (!cachedResponse.headers.has('date')) {
+        return null;
+      }
+      const dateHeader = cachedResponse.headers.get('date');
+      const parsedDate = new Date(dateHeader);
+      const headerTime = parsedDate.getTime();
+      // If the Date header was invalid for some reason, parsedDate.getTime()
+      // will return NaN.
+      if (isNaN(headerTime)) {
+        return null;
+      }
+      return headerTime;
+    }
+    /**
+     * This is a helper method that performs two operations:
+     *
+     * - Deletes *all* the underlying Cache instances associated with this plugin
+     * instance, by calling caches.delete() on your behalf.
+     * - Deletes the metadata from IndexedDB used to keep track of expiration
+     * details for each Cache instance.
+     *
+     * When using cache expiration, calling this method is preferable to calling
+     * `caches.delete()` directly, since this will ensure that the IndexedDB
+     * metadata is also cleanly removed and open IndexedDB instances are deleted.
+     *
+     * Note that if you're *not* using cache expiration for a given cache, calling
+     * `caches.delete()` and passing in the cache's name should be sufficient.
+     * There is no Workbox-specific method needed for cleanup in that case.
+     */
+    async deleteCacheAndMetadata() {
+      // Do this one at a time instead of all at once via `Promise.all()` to
+      // reduce the chance of inconsistency if a promise rejects.
+      for (const [cacheName, cacheExpiration] of this._cacheExpirations) {
+        await self.caches.delete(cacheName);
+        await cacheExpiration.delete();
+      }
+      // Reset this._cacheExpirations to its initial state.
+      this._cacheExpirations = new Map();
+    }
+  }
+
+  exports.CacheExpiration = CacheExpiration;
+  exports.ExpirationPlugin = ExpirationPlugin;
+
+  return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core);
+//# sourceMappingURL=workbox-expiration.dev.js.map
diff --git a/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js.map b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..36795d2103c550b2acf607156a042b6e6d1e51ef
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-expiration.dev.js","sources":["../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../_version.js","../models/CacheTimestampsModel.js","../CacheExpiration.js","../ExpirationPlugin.js"],"sourcesContent":["const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n    return (idbProxyableTypes ||\n        (idbProxyableTypes = [\n            IDBDatabase,\n            IDBObjectStore,\n            IDBIndex,\n            IDBCursor,\n            IDBTransaction,\n        ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n    return (cursorAdvanceMethods ||\n        (cursorAdvanceMethods = [\n            IDBCursor.prototype.advance,\n            IDBCursor.prototype.continue,\n            IDBCursor.prototype.continuePrimaryKey,\n        ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n    const promise = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            request.removeEventListener('success', success);\n            request.removeEventListener('error', error);\n        };\n        const success = () => {\n            resolve(wrap(request.result));\n            unlisten();\n        };\n        const error = () => {\n            reject(request.error);\n            unlisten();\n        };\n        request.addEventListener('success', success);\n        request.addEventListener('error', error);\n    });\n    promise\n        .then((value) => {\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n        // (see wrapFunction).\n        if (value instanceof IDBCursor) {\n            cursorRequestMap.set(value, request);\n        }\n        // Catching to avoid \"Uncaught Promise exceptions\"\n    })\n        .catch(() => { });\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n    // is because we create many promises from a single IDBRequest.\n    reverseTransformCache.set(promise, request);\n    return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n    // Early bail if we've already created a done promise for this transaction.\n    if (transactionDoneMap.has(tx))\n        return;\n    const done = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            tx.removeEventListener('complete', complete);\n            tx.removeEventListener('error', error);\n            tx.removeEventListener('abort', error);\n        };\n        const complete = () => {\n            resolve();\n            unlisten();\n        };\n        const error = () => {\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\n            unlisten();\n        };\n        tx.addEventListener('complete', complete);\n        tx.addEventListener('error', error);\n        tx.addEventListener('abort', error);\n    });\n    // Cache it for later retrieval.\n    transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n    get(target, prop, receiver) {\n        if (target instanceof IDBTransaction) {\n            // Special handling for transaction.done.\n            if (prop === 'done')\n                return transactionDoneMap.get(target);\n            // Polyfill for objectStoreNames because of Edge.\n            if (prop === 'objectStoreNames') {\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\n            }\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\n            if (prop === 'store') {\n                return receiver.objectStoreNames[1]\n                    ? undefined\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\n            }\n        }\n        // Else transform whatever we get back.\n        return wrap(target[prop]);\n    },\n    set(target, prop, value) {\n        target[prop] = value;\n        return true;\n    },\n    has(target, prop) {\n        if (target instanceof IDBTransaction &&\n            (prop === 'done' || prop === 'store')) {\n            return true;\n        }\n        return prop in target;\n    },\n};\nfunction replaceTraps(callback) {\n    idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\n    // only create one new func per func.\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n    if (func === IDBDatabase.prototype.transaction &&\n        !('objectStoreNames' in IDBTransaction.prototype)) {\n        return function (storeNames, ...args) {\n            const tx = func.call(unwrap(this), storeNames, ...args);\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n            return wrap(tx);\n        };\n    }\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\n    // undefined if the end of the cursor has been reached.\n    if (getCursorAdvanceMethods().includes(func)) {\n        return function (...args) {\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n            // the original object.\n            func.apply(unwrap(this), args);\n            return wrap(cursorRequestMap.get(this));\n        };\n    }\n    return function (...args) {\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n        // the original object.\n        return wrap(func.apply(unwrap(this), args));\n    };\n}\nfunction transformCachableValue(value) {\n    if (typeof value === 'function')\n        return wrapFunction(value);\n    // This doesn't return, it just creates a 'done' promise for the transaction,\n    // which is later returned for transaction.done (see idbObjectHandler).\n    if (value instanceof IDBTransaction)\n        cacheDonePromiseForTransaction(value);\n    if (instanceOfAny(value, getIdbProxyableTypes()))\n        return new Proxy(value, idbProxyTraps);\n    // Return the same value back if we're not going to transform it.\n    return value;\n}\nfunction wrap(value) {\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n    if (value instanceof IDBRequest)\n        return promisifyRequest(value);\n    // If we've already transformed this value before, reuse the transformed value.\n    // This is faster, but it also provides object equality.\n    if (transformCache.has(value))\n        return transformCache.get(value);\n    const newValue = transformCachableValue(value);\n    // Not all types are transformed.\n    // These may be primitive types, so they can't be WeakMap keys.\n    if (newValue !== value) {\n        transformCache.set(value, newValue);\n        reverseTransformCache.set(newValue, value);\n    }\n    return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n    const request = indexedDB.open(name, version);\n    const openPromise = wrap(request);\n    if (upgrade) {\n        request.addEventListener('upgradeneeded', (event) => {\n            upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\n        });\n    }\n    if (blocked)\n        request.addEventListener('blocked', () => blocked());\n    openPromise\n        .then((db) => {\n        if (terminated)\n            db.addEventListener('close', () => terminated());\n        if (blocking)\n            db.addEventListener('versionchange', () => blocking());\n    })\n        .catch(() => { });\n    return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n    const request = indexedDB.deleteDatabase(name);\n    if (blocked)\n        request.addEventListener('blocked', () => blocked());\n    return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n    if (!(target instanceof IDBDatabase &&\n        !(prop in target) &&\n        typeof prop === 'string')) {\n        return;\n    }\n    if (cachedMethods.get(prop))\n        return cachedMethods.get(prop);\n    const targetFuncName = prop.replace(/FromIndex$/, '');\n    const useIndex = prop !== targetFuncName;\n    const isWrite = writeMethods.includes(targetFuncName);\n    if (\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n        !(isWrite || readMethods.includes(targetFuncName))) {\n        return;\n    }\n    const method = async function (storeName, ...args) {\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n        let target = tx.store;\n        if (useIndex)\n            target = target.index(args.shift());\n        // Must reject if op rejects.\n        // If it's a write operation, must reject if tx.done rejects.\n        // Must reject with op rejection first.\n        // Must resolve with op value.\n        // Must handle both promises (no unhandled rejections)\n        return (await Promise.all([\n            target[targetFuncName](...args),\n            isWrite && tx.done,\n        ]))[0];\n    };\n    cachedMethods.set(prop, method);\n    return method;\n}\nreplaceTraps((oldTraps) => ({\n    ...oldTraps,\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:expiration:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { openDB, deleteDB } from 'idb';\nimport '../_version.js';\nconst DB_NAME = 'workbox-expiration';\nconst CACHE_OBJECT_STORE = 'cache-entries';\nconst normalizeURL = (unNormalizedUrl) => {\n    const url = new URL(unNormalizedUrl, location.href);\n    url.hash = '';\n    return url.href;\n};\n/**\n * Returns the timestamp model.\n *\n * @private\n */\nclass CacheTimestampsModel {\n    /**\n     *\n     * @param {string} cacheName\n     *\n     * @private\n     */\n    constructor(cacheName) {\n        this._db = null;\n        this._cacheName = cacheName;\n    }\n    /**\n     * Performs an upgrade of indexedDB.\n     *\n     * @param {IDBPDatabase} db\n     *\n     * @private\n     */\n    _upgradeDb(db) {\n        // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we\n        // have to use the `id` keyPath here and create our own values (a\n        // concatenation of `url + cacheName`) instead of simply using\n        // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.\n        const objStore = db.createObjectStore(CACHE_OBJECT_STORE, { keyPath: 'id' });\n        // TODO(philipwalton): once we don't have to support EdgeHTML, we can\n        // create a single index with the keyPath `['cacheName', 'timestamp']`\n        // instead of doing both these indexes.\n        objStore.createIndex('cacheName', 'cacheName', { unique: false });\n        objStore.createIndex('timestamp', 'timestamp', { unique: false });\n    }\n    /**\n     * Performs an upgrade of indexedDB and deletes deprecated DBs.\n     *\n     * @param {IDBPDatabase} db\n     *\n     * @private\n     */\n    _upgradeDbAndDeleteOldDbs(db) {\n        this._upgradeDb(db);\n        if (this._cacheName) {\n            void deleteDB(this._cacheName);\n        }\n    }\n    /**\n     * @param {string} url\n     * @param {number} timestamp\n     *\n     * @private\n     */\n    async setTimestamp(url, timestamp) {\n        url = normalizeURL(url);\n        const entry = {\n            url,\n            timestamp,\n            cacheName: this._cacheName,\n            // Creating an ID from the URL and cache name won't be necessary once\n            // Edge switches to Chromium and all browsers we support work with\n            // array keyPaths.\n            id: this._getId(url),\n        };\n        const db = await this.getDb();\n        const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {\n            durability: 'relaxed',\n        });\n        await tx.store.put(entry);\n        await tx.done;\n    }\n    /**\n     * Returns the timestamp stored for a given URL.\n     *\n     * @param {string} url\n     * @return {number | undefined}\n     *\n     * @private\n     */\n    async getTimestamp(url) {\n        const db = await this.getDb();\n        const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));\n        return entry === null || entry === void 0 ? void 0 : entry.timestamp;\n    }\n    /**\n     * Iterates through all the entries in the object store (from newest to\n     * oldest) and removes entries once either `maxCount` is reached or the\n     * entry's timestamp is less than `minTimestamp`.\n     *\n     * @param {number} minTimestamp\n     * @param {number} maxCount\n     * @return {Array}\n     *\n     * @private\n     */\n    async expireEntries(minTimestamp, maxCount) {\n        const db = await this.getDb();\n        let cursor = await db\n            .transaction(CACHE_OBJECT_STORE)\n            .store.index('timestamp')\n            .openCursor(null, 'prev');\n        const entriesToDelete = [];\n        let entriesNotDeletedCount = 0;\n        while (cursor) {\n            const result = cursor.value;\n            // TODO(philipwalton): once we can use a multi-key index, we\n            // won't have to check `cacheName` here.\n            if (result.cacheName === this._cacheName) {\n                // Delete an entry if it's older than the max age or\n                // if we already have the max number allowed.\n                if ((minTimestamp && result.timestamp < minTimestamp) ||\n                    (maxCount && entriesNotDeletedCount >= maxCount)) {\n                    // TODO(philipwalton): we should be able to delete the\n                    // entry right here, but doing so causes an iteration\n                    // bug in Safari stable (fixed in TP). Instead we can\n                    // store the keys of the entries to delete, and then\n                    // delete the separate transactions.\n                    // https://github.com/GoogleChrome/workbox/issues/1978\n                    // cursor.delete();\n                    // We only need to return the URL, not the whole entry.\n                    entriesToDelete.push(cursor.value);\n                }\n                else {\n                    entriesNotDeletedCount++;\n                }\n            }\n            cursor = await cursor.continue();\n        }\n        // TODO(philipwalton): once the Safari bug in the following issue is fixed,\n        // we should be able to remove this loop and do the entry deletion in the\n        // cursor loop above:\n        // https://github.com/GoogleChrome/workbox/issues/1978\n        const urlsDeleted = [];\n        for (const entry of entriesToDelete) {\n            await db.delete(CACHE_OBJECT_STORE, entry.id);\n            urlsDeleted.push(entry.url);\n        }\n        return urlsDeleted;\n    }\n    /**\n     * Takes a URL and returns an ID that will be unique in the object store.\n     *\n     * @param {string} url\n     * @return {string}\n     *\n     * @private\n     */\n    _getId(url) {\n        // Creating an ID from the URL and cache name won't be necessary once\n        // Edge switches to Chromium and all browsers we support work with\n        // array keyPaths.\n        return this._cacheName + '|' + normalizeURL(url);\n    }\n    /**\n     * Returns an open connection to the database.\n     *\n     * @private\n     */\n    async getDb() {\n        if (!this._db) {\n            this._db = await openDB(DB_NAME, 1, {\n                upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),\n            });\n        }\n        return this._db;\n    }\n}\nexport { CacheTimestampsModel };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheTimestampsModel } from './models/CacheTimestampsModel.js';\nimport './_version.js';\n/**\n * The `CacheExpiration` class allows you define an expiration and / or\n * limit on the number of responses stored in a\n * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).\n *\n * @memberof workbox-expiration\n */\nclass CacheExpiration {\n    /**\n     * To construct a new CacheExpiration instance you must provide at least\n     * one of the `config` properties.\n     *\n     * @param {string} cacheName Name of the cache to apply restrictions to.\n     * @param {Object} config\n     * @param {number} [config.maxEntries] The maximum number of entries to cache.\n     * Entries used the least will be removed as the maximum is reached.\n     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n     * it's treated as stale and removed.\n     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n     * that will be used when calling `delete()` on the cache.\n     */\n    constructor(cacheName, config = {}) {\n        this._isRunning = false;\n        this._rerunRequested = false;\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(cacheName, 'string', {\n                moduleName: 'workbox-expiration',\n                className: 'CacheExpiration',\n                funcName: 'constructor',\n                paramName: 'cacheName',\n            });\n            if (!(config.maxEntries || config.maxAgeSeconds)) {\n                throw new WorkboxError('max-entries-or-age-required', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.maxEntries) {\n                assert.isType(config.maxEntries, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                    paramName: 'config.maxEntries',\n                });\n            }\n            if (config.maxAgeSeconds) {\n                assert.isType(config.maxAgeSeconds, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                    paramName: 'config.maxAgeSeconds',\n                });\n            }\n        }\n        this._maxEntries = config.maxEntries;\n        this._maxAgeSeconds = config.maxAgeSeconds;\n        this._matchOptions = config.matchOptions;\n        this._cacheName = cacheName;\n        this._timestampModel = new CacheTimestampsModel(cacheName);\n    }\n    /**\n     * Expires entries for the given cache and given criteria.\n     */\n    async expireEntries() {\n        if (this._isRunning) {\n            this._rerunRequested = true;\n            return;\n        }\n        this._isRunning = true;\n        const minTimestamp = this._maxAgeSeconds\n            ? Date.now() - this._maxAgeSeconds * 1000\n            : 0;\n        const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);\n        // Delete URLs from the cache\n        const cache = await self.caches.open(this._cacheName);\n        for (const url of urlsExpired) {\n            await cache.delete(url, this._matchOptions);\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (urlsExpired.length > 0) {\n                logger.groupCollapsed(`Expired ${urlsExpired.length} ` +\n                    `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` +\n                    `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` +\n                    `'${this._cacheName}' cache.`);\n                logger.log(`Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`);\n                urlsExpired.forEach((url) => logger.log(`    ${url}`));\n                logger.groupEnd();\n            }\n            else {\n                logger.debug(`Cache expiration ran and found no entries to remove.`);\n            }\n        }\n        this._isRunning = false;\n        if (this._rerunRequested) {\n            this._rerunRequested = false;\n            dontWaitFor(this.expireEntries());\n        }\n    }\n    /**\n     * Update the timestamp for the given URL. This ensures the when\n     * removing entries based on maximum entries, most recently used\n     * is accurate or when expiring, the timestamp is up-to-date.\n     *\n     * @param {string} url\n     */\n    async updateTimestamp(url) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(url, 'string', {\n                moduleName: 'workbox-expiration',\n                className: 'CacheExpiration',\n                funcName: 'updateTimestamp',\n                paramName: 'url',\n            });\n        }\n        await this._timestampModel.setTimestamp(url, Date.now());\n    }\n    /**\n     * Can be used to check if a URL has expired or not before it's used.\n     *\n     * This requires a look up from IndexedDB, so can be slow.\n     *\n     * Note: This method will not remove the cached entry, call\n     * `expireEntries()` to remove indexedDB and Cache entries.\n     *\n     * @param {string} url\n     * @return {boolean}\n     */\n    async isURLExpired(url) {\n        if (!this._maxAgeSeconds) {\n            if (process.env.NODE_ENV !== 'production') {\n                throw new WorkboxError(`expired-test-without-max-age`, {\n                    methodName: 'isURLExpired',\n                    paramName: 'maxAgeSeconds',\n                });\n            }\n            return false;\n        }\n        else {\n            const timestamp = await this._timestampModel.getTimestamp(url);\n            const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;\n            return timestamp !== undefined ? timestamp < expireOlderThan : true;\n        }\n    }\n    /**\n     * Removes the IndexedDB object store used to keep track of cache expiration\n     * metadata.\n     */\n    async delete() {\n        // Make sure we don't attempt another rerun if we're called in the middle of\n        // a cache expiration.\n        this._rerunRequested = false;\n        await this._timestampModel.expireEntries(Infinity); // Expires all.\n    }\n}\nexport { CacheExpiration };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { registerQuotaErrorCallback } from 'workbox-core/registerQuotaErrorCallback.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheExpiration } from './CacheExpiration.js';\nimport './_version.js';\n/**\n * This plugin can be used in a `workbox-strategy` to regularly enforce a\n * limit on the age and / or the number of cached requests.\n *\n * It can only be used with `workbox-strategy` instances that have a\n * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).\n * In other words, it can't be used to expire entries in strategy that uses the\n * default runtime cache name.\n *\n * Whenever a cached response is used or updated, this plugin will look\n * at the associated cache and remove any old or extra responses.\n *\n * When using `maxAgeSeconds`, responses may be used *once* after expiring\n * because the expiration clean up will not have occurred until *after* the\n * cached response has been used. If the response has a \"Date\" header, then\n * a light weight expiration check is performed and the response will not be\n * used immediately.\n *\n * When using `maxEntries`, the entry least-recently requested will be removed\n * from the cache first.\n *\n * @memberof workbox-expiration\n */\nclass ExpirationPlugin {\n    /**\n     * @param {ExpirationPluginOptions} config\n     * @param {number} [config.maxEntries] The maximum number of entries to cache.\n     * Entries used the least will be removed as the maximum is reached.\n     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n     * it's treated as stale and removed.\n     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n     * that will be used when calling `delete()` on the cache.\n     * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to\n     * automatic deletion if the available storage quota has been exceeded.\n     */\n    constructor(config = {}) {\n        /**\n         * A \"lifecycle\" callback that will be triggered automatically by the\n         * `workbox-strategies` handlers when a `Response` is about to be returned\n         * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to\n         * the handler. It allows the `Response` to be inspected for freshness and\n         * prevents it from being used if the `Response`'s `Date` header value is\n         * older than the configured `maxAgeSeconds`.\n         *\n         * @param {Object} options\n         * @param {string} options.cacheName Name of the cache the response is in.\n         * @param {Response} options.cachedResponse The `Response` object that's been\n         *     read from a cache and whose freshness should be checked.\n         * @return {Response} Either the `cachedResponse`, if it's\n         *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.\n         *\n         * @private\n         */\n        this.cachedResponseWillBeUsed = async ({ event, request, cacheName, cachedResponse, }) => {\n            if (!cachedResponse) {\n                return null;\n            }\n            const isFresh = this._isResponseDateFresh(cachedResponse);\n            // Expire entries to ensure that even if the expiration date has\n            // expired, it'll only be used once.\n            const cacheExpiration = this._getCacheExpiration(cacheName);\n            dontWaitFor(cacheExpiration.expireEntries());\n            // Update the metadata for the request URL to the current timestamp,\n            // but don't `await` it as we don't want to block the response.\n            const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);\n            if (event) {\n                try {\n                    event.waitUntil(updateTimestampDone);\n                }\n                catch (error) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // The event may not be a fetch event; only log the URL if it is.\n                        if ('request' in event) {\n                            logger.warn(`Unable to ensure service worker stays alive when ` +\n                                `updating cache entry for ` +\n                                `'${getFriendlyURL(event.request.url)}'.`);\n                        }\n                    }\n                }\n            }\n            return isFresh ? cachedResponse : null;\n        };\n        /**\n         * A \"lifecycle\" callback that will be triggered automatically by the\n         * `workbox-strategies` handlers when an entry is added to a cache.\n         *\n         * @param {Object} options\n         * @param {string} options.cacheName Name of the cache that was updated.\n         * @param {string} options.request The Request for the cached entry.\n         *\n         * @private\n         */\n        this.cacheDidUpdate = async ({ cacheName, request, }) => {\n            if (process.env.NODE_ENV !== 'production') {\n                assert.isType(cacheName, 'string', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'cacheDidUpdate',\n                    paramName: 'cacheName',\n                });\n                assert.isInstance(request, Request, {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'cacheDidUpdate',\n                    paramName: 'request',\n                });\n            }\n            const cacheExpiration = this._getCacheExpiration(cacheName);\n            await cacheExpiration.updateTimestamp(request.url);\n            await cacheExpiration.expireEntries();\n        };\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(config.maxEntries || config.maxAgeSeconds)) {\n                throw new WorkboxError('max-entries-or-age-required', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.maxEntries) {\n                assert.isType(config.maxEntries, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                    paramName: 'config.maxEntries',\n                });\n            }\n            if (config.maxAgeSeconds) {\n                assert.isType(config.maxAgeSeconds, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                    paramName: 'config.maxAgeSeconds',\n                });\n            }\n        }\n        this._config = config;\n        this._maxAgeSeconds = config.maxAgeSeconds;\n        this._cacheExpirations = new Map();\n        if (config.purgeOnQuotaError) {\n            registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());\n        }\n    }\n    /**\n     * A simple helper method to return a CacheExpiration instance for a given\n     * cache name.\n     *\n     * @param {string} cacheName\n     * @return {CacheExpiration}\n     *\n     * @private\n     */\n    _getCacheExpiration(cacheName) {\n        if (cacheName === cacheNames.getRuntimeName()) {\n            throw new WorkboxError('expire-custom-caches-only');\n        }\n        let cacheExpiration = this._cacheExpirations.get(cacheName);\n        if (!cacheExpiration) {\n            cacheExpiration = new CacheExpiration(cacheName, this._config);\n            this._cacheExpirations.set(cacheName, cacheExpiration);\n        }\n        return cacheExpiration;\n    }\n    /**\n     * @param {Response} cachedResponse\n     * @return {boolean}\n     *\n     * @private\n     */\n    _isResponseDateFresh(cachedResponse) {\n        if (!this._maxAgeSeconds) {\n            // We aren't expiring by age, so return true, it's fresh\n            return true;\n        }\n        // Check if the 'date' header will suffice a quick expiration check.\n        // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for\n        // discussion.\n        const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);\n        if (dateHeaderTimestamp === null) {\n            // Unable to parse date, so assume it's fresh.\n            return true;\n        }\n        // If we have a valid headerTime, then our response is fresh iff the\n        // headerTime plus maxAgeSeconds is greater than the current time.\n        const now = Date.now();\n        return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;\n    }\n    /**\n     * This method will extract the data header and parse it into a useful\n     * value.\n     *\n     * @param {Response} cachedResponse\n     * @return {number|null}\n     *\n     * @private\n     */\n    _getDateHeaderTimestamp(cachedResponse) {\n        if (!cachedResponse.headers.has('date')) {\n            return null;\n        }\n        const dateHeader = cachedResponse.headers.get('date');\n        const parsedDate = new Date(dateHeader);\n        const headerTime = parsedDate.getTime();\n        // If the Date header was invalid for some reason, parsedDate.getTime()\n        // will return NaN.\n        if (isNaN(headerTime)) {\n            return null;\n        }\n        return headerTime;\n    }\n    /**\n     * This is a helper method that performs two operations:\n     *\n     * - Deletes *all* the underlying Cache instances associated with this plugin\n     * instance, by calling caches.delete() on your behalf.\n     * - Deletes the metadata from IndexedDB used to keep track of expiration\n     * details for each Cache instance.\n     *\n     * When using cache expiration, calling this method is preferable to calling\n     * `caches.delete()` directly, since this will ensure that the IndexedDB\n     * metadata is also cleanly removed and open IndexedDB instances are deleted.\n     *\n     * Note that if you're *not* using cache expiration for a given cache, calling\n     * `caches.delete()` and passing in the cache's name should be sufficient.\n     * There is no Workbox-specific method needed for cleanup in that case.\n     */\n    async deleteCacheAndMetadata() {\n        // Do this one at a time instead of all at once via `Promise.all()` to\n        // reduce the chance of inconsistency if a promise rejects.\n        for (const [cacheName, cacheExpiration] of this._cacheExpirations) {\n            await self.caches.delete(cacheName);\n            await cacheExpiration.delete();\n        }\n        // Reset this._cacheExpirations to its initial state.\n        this._cacheExpirations = new Map();\n    }\n}\nexport { ExpirationPlugin };\n"],"names":["instanceOfAny","object","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","getIdbProxyableTypes","IDBDatabase","IDBObjectStore","IDBIndex","IDBCursor","IDBTransaction","getCursorAdvanceMethods","prototype","advance","continue","continuePrimaryKey","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","promisifyRequest","request","promise","Promise","resolve","reject","unlisten","removeEventListener","success","error","wrap","result","addEventListener","then","value","set","catch","cacheDonePromiseForTransaction","tx","has","done","complete","DOMException","idbProxyTraps","get","target","prop","receiver","objectStoreNames","undefined","objectStore","replaceTraps","callback","wrapFunction","func","transaction","storeNames","args","call","unwrap","sort","includes","apply","transformCachableValue","Proxy","IDBRequest","newValue","openDB","name","version","blocked","upgrade","blocking","terminated","indexedDB","open","openPromise","event","oldVersion","newVersion","db","deleteDB","deleteDatabase","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","storeName","store","index","shift","all","oldTraps","_extends","self","_","e","DB_NAME","CACHE_OBJECT_STORE","normalizeURL","unNormalizedUrl","url","URL","location","href","hash","CacheTimestampsModel","constructor","cacheName","_db","_cacheName","_upgradeDb","objStore","createObjectStore","keyPath","createIndex","unique","_upgradeDbAndDeleteOldDbs","setTimestamp","timestamp","entry","id","_getId","getDb","durability","put","getTimestamp","expireEntries","minTimestamp","maxCount","cursor","openCursor","entriesToDelete","entriesNotDeletedCount","push","urlsDeleted","delete","bind","CacheExpiration","config","_isRunning","_rerunRequested","assert","isType","moduleName","className","funcName","paramName","maxEntries","maxAgeSeconds","WorkboxError","_maxEntries","_maxAgeSeconds","_matchOptions","matchOptions","_timestampModel","Date","now","urlsExpired","cache","caches","length","logger","groupCollapsed","log","forEach","groupEnd","debug","dontWaitFor","updateTimestamp","isURLExpired","methodName","expireOlderThan","Infinity","ExpirationPlugin","cachedResponseWillBeUsed","cachedResponse","isFresh","_isResponseDateFresh","cacheExpiration","_getCacheExpiration","updateTimestampDone","waitUntil","warn","getFriendlyURL","cacheDidUpdate","isInstance","Request","_config","_cacheExpirations","purgeOnQuotaError","registerQuotaErrorCallback","deleteCacheAndMetadata","cacheNames","getRuntimeName","dateHeaderTimestamp","_getDateHeaderTimestamp","headers","dateHeader","parsedDate","headerTime","getTime","isNaN"],"mappings":";;;;;;;;;;;;;;EAAA,MAAMA,aAAa,GAAGA,CAACC,MAAM,EAAEC,YAAY,KAAKA,YAAY,CAACC,IAAI,CAAEC,CAAC,IAAKH,MAAM,YAAYG,CAAC,CAAC;EAE7F,IAAIC,iBAAiB;EACrB,IAAIC,oBAAoB;EACxB;EACA,SAASC,oBAAoBA,GAAG;EAC5B,EAAA,OAAQF,iBAAiB,KACpBA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C,IAAI,CAACA,cAAc,CAACqB,OAAO,CAACpK,GAAG,CAAC,MAAM,CAAC,EAAE;EACrC,MAAA,OAAO,IAAI;EACf,IAAA;MACA,MAAMqK,UAAU,GAAGtB,cAAc,CAACqB,OAAO,CAAC/J,GAAG,CAAC,MAAM,CAAC;EACrD,IAAA,MAAMiK,UAAU,GAAG,IAAI3C,IAAI,CAAC0C,UAAU,CAAC;EACvC,IAAA,MAAME,UAAU,GAAGD,UAAU,CAACE,OAAO,EAAE;EACvC;EACA;EACA,IAAA,IAAIC,KAAK,CAACF,UAAU,CAAC,EAAE;EACnB,MAAA,OAAO,IAAI;EACf,IAAA;EACA,IAAA,OAAOA,UAAU;EACrB,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAMR,sBAAsBA,GAAG;EAC3B;EACA;MACA,KAAK,MAAM,CAACpF,SAAS,EAAEuE,eAAe,CAAC,IAAI,IAAI,CAACU,iBAAiB,EAAE;EAC/D,MAAA,MAAM/F,IAAI,CAACkE,MAAM,CAACxB,MAAM,CAAC5B,SAAS,CAAC;EACnC,MAAA,MAAMuE,eAAe,CAAC3C,MAAM,EAAE;EAClC,IAAA;EACA;EACA,IAAA,IAAI,CAACqD,iBAAiB,GAAG,IAAI7G,GAAG,EAAE;EACtC,EAAA;EACJ;;;;;;;;;;;","x_google_ignoreList":[0,1]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..f7f36f24f93f2fbe045a59662b3f1ed509a6081b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.expiration=function(t,e,n,s,i){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.some((e=>t instanceof e));let o,c;const u=new WeakMap,h=new WeakMap,f=new WeakMap,l=new WeakMap,d=new WeakMap;let w={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return h.get(t);if("objectStoreNames"===e)return t.objectStoreNames||f.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(t[e])},set:(t,e,n)=>(t[e]=n,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function p(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(c||(c=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(b(this),e),m(u.get(this))}:function(...e){return m(t.apply(b(this),e))}:function(e,...n){const s=t.call(b(this),e,...n);return f.set(s,e.sort?e.sort():[e]),m(s)}}function D(t){return"function"==typeof t?p(t):(t instanceof IDBTransaction&&function(t){if(h.has(t))return;const e=new Promise(((e,n)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",r),t.removeEventListener("abort",r)},i=()=>{e(),s()},r=()=>{n(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",r),t.addEventListener("abort",r)}));h.set(t,e)}(t),a(t,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,w):t)}function m(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,n)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",r)},i=()=>{e(m(t.result)),s()},r=()=>{n(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",r)}));return e.then((e=>{e instanceof IDBCursor&&u.set(e,t)})).catch((()=>{})),d.set(e,t),e}(t);if(l.has(t))return l.get(t);const e=D(t);return e!==t&&(l.set(t,e),d.set(e,t)),e}const b=t=>d.get(t);const y=["get","getKey","getAll","getAllKeys","count"],I=["put","add","delete","clear"],B=new Map;function g(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(B.get(e))return B.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,i=I.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!i&&!y.includes(n))return;const r=async function(t,...e){const r=this.transaction(t,i?"readwrite":"readonly");let a=r.store;return s&&(a=a.index(e.shift())),(await Promise.all([a[n](...e),i&&r.done]))[0]};return B.set(e,r),r}w=(t=>r({},t,{get:(e,n,s)=>g(e,n)||t.get(e,n,s),has:(e,n)=>!!g(e,n)||t.has(e,n)}))(w);try{self["workbox:expiration:7.4.0"]&&_()}catch(t){}const x="cache-entries",k=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class v{constructor(t){this.A=null,this.G=t}J(t){const e=t.createObjectStore(x,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}V(t){this.J(t),this.G&&function(t,{blocked:e}={}){const n=indexedDB.deleteDatabase(t);e&&n.addEventListener("blocked",(()=>e())),m(n).then((()=>{}))}(this.G)}async setTimestamp(t,e){const n={url:t=k(t),timestamp:e,cacheName:this.G,id:this.X(t)},s=(await this.getDb()).transaction(x,"readwrite",{durability:"relaxed"});await s.store.put(n),await s.done}async getTimestamp(t){const e=await this.getDb(),n=await e.get(x,this.X(t));return null==n?void 0:n.timestamp}async expireEntries(t,e){const n=await this.getDb();let s=await n.transaction(x).store.index("timestamp").openCursor(null,"prev");const i=[];let r=0;for(;s;){const n=s.value;n.cacheName===this.G&&(t&&n.timestamp=e?i.push(s.value):r++),s=await s.continue()}const a=[];for(const t of i)await n.delete(x,t.id),a.push(t.url);return a}X(t){return this.G+"|"+k(t)}async getDb(){return this.A||(this.A=await function(t,e,{blocked:n,upgrade:s,blocking:i,terminated:r}={}){const a=indexedDB.open(t,e),o=m(a);return s&&a.addEventListener("upgradeneeded",(t=>{s(m(a.result),t.oldVersion,t.newVersion,m(a.transaction))})),n&&a.addEventListener("blocked",(()=>n())),o.then((t=>{r&&t.addEventListener("close",(()=>r())),i&&t.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),o}("workbox-expiration",1,{upgrade:this.V.bind(this)})),this.A}}class M{constructor(t,e={}){this.Y=!1,this.Z=!1,this.tt=e.maxEntries,this.et=e.maxAgeSeconds,this.nt=e.matchOptions,this.G=t,this.st=new v(t)}async expireEntries(){if(this.Y)return void(this.Z=!0);this.Y=!0;const t=this.et?Date.now()-1e3*this.et:0,n=await this.st.expireEntries(t,this.tt),s=await self.caches.open(this.G);for(const t of n)await s.delete(t,this.nt);this.Y=!1,this.Z&&(this.Z=!1,e.dontWaitFor(this.expireEntries()))}async updateTimestamp(t){await this.st.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.et){const e=await this.st.getTimestamp(t),n=Date.now()-1e3*this.et;return void 0===e||e{if(!i)return null;const r=this.it(i),a=this.rt(s);e.dontWaitFor(a.expireEntries());const o=a.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch(t){}return r?i:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const n=this.rt(t);await n.updateTimestamp(e.url),await n.expireEntries()},this.ot=t,this.et=t.maxAgeSeconds,this.ct=new Map,t.purgeOnQuotaError&&s.registerQuotaErrorCallback((()=>this.deleteCacheAndMetadata()))}rt(t){if(t===n.cacheNames.getRuntimeName())throw new i.WorkboxError("expire-custom-caches-only");let e=this.ct.get(t);return e||(e=new M(t,this.ot),this.ct.set(t,e)),e}it(t){if(!this.et)return!0;const e=this.ut(t);if(null===e)return!0;return e>=Date.now()-1e3*this.et}ut(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),n=new Date(e).getTime();return isNaN(n)?null:n}async deleteCacheAndMetadata(){for(const[t,e]of this.ct)await self.caches.delete(t),await e.delete();this.ct=new Map}},t}({},workbox.core._private,workbox.core._private,workbox.core,workbox.core._private);
+//# sourceMappingURL=workbox-expiration.prod.js.map
diff --git a/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js.map b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a171c0c42b99c929fceefa031b23a81b3b30ca97
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/build/workbox-expiration.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-expiration.prod.js","sources":["../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../_version.js","../models/CacheTimestampsModel.js","../CacheExpiration.js","../ExpirationPlugin.js"],"sourcesContent":["const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n    return (idbProxyableTypes ||\n        (idbProxyableTypes = [\n            IDBDatabase,\n            IDBObjectStore,\n            IDBIndex,\n            IDBCursor,\n            IDBTransaction,\n        ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n    return (cursorAdvanceMethods ||\n        (cursorAdvanceMethods = [\n            IDBCursor.prototype.advance,\n            IDBCursor.prototype.continue,\n            IDBCursor.prototype.continuePrimaryKey,\n        ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n    const promise = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            request.removeEventListener('success', success);\n            request.removeEventListener('error', error);\n        };\n        const success = () => {\n            resolve(wrap(request.result));\n            unlisten();\n        };\n        const error = () => {\n            reject(request.error);\n            unlisten();\n        };\n        request.addEventListener('success', success);\n        request.addEventListener('error', error);\n    });\n    promise\n        .then((value) => {\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n        // (see wrapFunction).\n        if (value instanceof IDBCursor) {\n            cursorRequestMap.set(value, request);\n        }\n        // Catching to avoid \"Uncaught Promise exceptions\"\n    })\n        .catch(() => { });\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n    // is because we create many promises from a single IDBRequest.\n    reverseTransformCache.set(promise, request);\n    return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n    // Early bail if we've already created a done promise for this transaction.\n    if (transactionDoneMap.has(tx))\n        return;\n    const done = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            tx.removeEventListener('complete', complete);\n            tx.removeEventListener('error', error);\n            tx.removeEventListener('abort', error);\n        };\n        const complete = () => {\n            resolve();\n            unlisten();\n        };\n        const error = () => {\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\n            unlisten();\n        };\n        tx.addEventListener('complete', complete);\n        tx.addEventListener('error', error);\n        tx.addEventListener('abort', error);\n    });\n    // Cache it for later retrieval.\n    transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n    get(target, prop, receiver) {\n        if (target instanceof IDBTransaction) {\n            // Special handling for transaction.done.\n            if (prop === 'done')\n                return transactionDoneMap.get(target);\n            // Polyfill for objectStoreNames because of Edge.\n            if (prop === 'objectStoreNames') {\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\n            }\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\n            if (prop === 'store') {\n                return receiver.objectStoreNames[1]\n                    ? undefined\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\n            }\n        }\n        // Else transform whatever we get back.\n        return wrap(target[prop]);\n    },\n    set(target, prop, value) {\n        target[prop] = value;\n        return true;\n    },\n    has(target, prop) {\n        if (target instanceof IDBTransaction &&\n            (prop === 'done' || prop === 'store')) {\n            return true;\n        }\n        return prop in target;\n    },\n};\nfunction replaceTraps(callback) {\n    idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\n    // only create one new func per func.\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n    if (func === IDBDatabase.prototype.transaction &&\n        !('objectStoreNames' in IDBTransaction.prototype)) {\n        return function (storeNames, ...args) {\n            const tx = func.call(unwrap(this), storeNames, ...args);\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n            return wrap(tx);\n        };\n    }\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\n    // undefined if the end of the cursor has been reached.\n    if (getCursorAdvanceMethods().includes(func)) {\n        return function (...args) {\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n            // the original object.\n            func.apply(unwrap(this), args);\n            return wrap(cursorRequestMap.get(this));\n        };\n    }\n    return function (...args) {\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n        // the original object.\n        return wrap(func.apply(unwrap(this), args));\n    };\n}\nfunction transformCachableValue(value) {\n    if (typeof value === 'function')\n        return wrapFunction(value);\n    // This doesn't return, it just creates a 'done' promise for the transaction,\n    // which is later returned for transaction.done (see idbObjectHandler).\n    if (value instanceof IDBTransaction)\n        cacheDonePromiseForTransaction(value);\n    if (instanceOfAny(value, getIdbProxyableTypes()))\n        return new Proxy(value, idbProxyTraps);\n    // Return the same value back if we're not going to transform it.\n    return value;\n}\nfunction wrap(value) {\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n    if (value instanceof IDBRequest)\n        return promisifyRequest(value);\n    // If we've already transformed this value before, reuse the transformed value.\n    // This is faster, but it also provides object equality.\n    if (transformCache.has(value))\n        return transformCache.get(value);\n    const newValue = transformCachableValue(value);\n    // Not all types are transformed.\n    // These may be primitive types, so they can't be WeakMap keys.\n    if (newValue !== value) {\n        transformCache.set(value, newValue);\n        reverseTransformCache.set(newValue, value);\n    }\n    return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n    const request = indexedDB.open(name, version);\n    const openPromise = wrap(request);\n    if (upgrade) {\n        request.addEventListener('upgradeneeded', (event) => {\n            upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));\n        });\n    }\n    if (blocked)\n        request.addEventListener('blocked', () => blocked());\n    openPromise\n        .then((db) => {\n        if (terminated)\n            db.addEventListener('close', () => terminated());\n        if (blocking)\n            db.addEventListener('versionchange', () => blocking());\n    })\n        .catch(() => { });\n    return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n    const request = indexedDB.deleteDatabase(name);\n    if (blocked)\n        request.addEventListener('blocked', () => blocked());\n    return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n    if (!(target instanceof IDBDatabase &&\n        !(prop in target) &&\n        typeof prop === 'string')) {\n        return;\n    }\n    if (cachedMethods.get(prop))\n        return cachedMethods.get(prop);\n    const targetFuncName = prop.replace(/FromIndex$/, '');\n    const useIndex = prop !== targetFuncName;\n    const isWrite = writeMethods.includes(targetFuncName);\n    if (\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n        !(isWrite || readMethods.includes(targetFuncName))) {\n        return;\n    }\n    const method = async function (storeName, ...args) {\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n        let target = tx.store;\n        if (useIndex)\n            target = target.index(args.shift());\n        // Must reject if op rejects.\n        // If it's a write operation, must reject if tx.done rejects.\n        // Must reject with op rejection first.\n        // Must resolve with op value.\n        // Must handle both promises (no unhandled rejections)\n        return (await Promise.all([\n            target[targetFuncName](...args),\n            isWrite && tx.done,\n        ]))[0];\n    };\n    cachedMethods.set(prop, method);\n    return method;\n}\nreplaceTraps((oldTraps) => ({\n    ...oldTraps,\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:expiration:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { openDB, deleteDB } from 'idb';\nimport '../_version.js';\nconst DB_NAME = 'workbox-expiration';\nconst CACHE_OBJECT_STORE = 'cache-entries';\nconst normalizeURL = (unNormalizedUrl) => {\n    const url = new URL(unNormalizedUrl, location.href);\n    url.hash = '';\n    return url.href;\n};\n/**\n * Returns the timestamp model.\n *\n * @private\n */\nclass CacheTimestampsModel {\n    /**\n     *\n     * @param {string} cacheName\n     *\n     * @private\n     */\n    constructor(cacheName) {\n        this._db = null;\n        this._cacheName = cacheName;\n    }\n    /**\n     * Performs an upgrade of indexedDB.\n     *\n     * @param {IDBPDatabase} db\n     *\n     * @private\n     */\n    _upgradeDb(db) {\n        // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we\n        // have to use the `id` keyPath here and create our own values (a\n        // concatenation of `url + cacheName`) instead of simply using\n        // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.\n        const objStore = db.createObjectStore(CACHE_OBJECT_STORE, { keyPath: 'id' });\n        // TODO(philipwalton): once we don't have to support EdgeHTML, we can\n        // create a single index with the keyPath `['cacheName', 'timestamp']`\n        // instead of doing both these indexes.\n        objStore.createIndex('cacheName', 'cacheName', { unique: false });\n        objStore.createIndex('timestamp', 'timestamp', { unique: false });\n    }\n    /**\n     * Performs an upgrade of indexedDB and deletes deprecated DBs.\n     *\n     * @param {IDBPDatabase} db\n     *\n     * @private\n     */\n    _upgradeDbAndDeleteOldDbs(db) {\n        this._upgradeDb(db);\n        if (this._cacheName) {\n            void deleteDB(this._cacheName);\n        }\n    }\n    /**\n     * @param {string} url\n     * @param {number} timestamp\n     *\n     * @private\n     */\n    async setTimestamp(url, timestamp) {\n        url = normalizeURL(url);\n        const entry = {\n            url,\n            timestamp,\n            cacheName: this._cacheName,\n            // Creating an ID from the URL and cache name won't be necessary once\n            // Edge switches to Chromium and all browsers we support work with\n            // array keyPaths.\n            id: this._getId(url),\n        };\n        const db = await this.getDb();\n        const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {\n            durability: 'relaxed',\n        });\n        await tx.store.put(entry);\n        await tx.done;\n    }\n    /**\n     * Returns the timestamp stored for a given URL.\n     *\n     * @param {string} url\n     * @return {number | undefined}\n     *\n     * @private\n     */\n    async getTimestamp(url) {\n        const db = await this.getDb();\n        const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));\n        return entry === null || entry === void 0 ? void 0 : entry.timestamp;\n    }\n    /**\n     * Iterates through all the entries in the object store (from newest to\n     * oldest) and removes entries once either `maxCount` is reached or the\n     * entry's timestamp is less than `minTimestamp`.\n     *\n     * @param {number} minTimestamp\n     * @param {number} maxCount\n     * @return {Array}\n     *\n     * @private\n     */\n    async expireEntries(minTimestamp, maxCount) {\n        const db = await this.getDb();\n        let cursor = await db\n            .transaction(CACHE_OBJECT_STORE)\n            .store.index('timestamp')\n            .openCursor(null, 'prev');\n        const entriesToDelete = [];\n        let entriesNotDeletedCount = 0;\n        while (cursor) {\n            const result = cursor.value;\n            // TODO(philipwalton): once we can use a multi-key index, we\n            // won't have to check `cacheName` here.\n            if (result.cacheName === this._cacheName) {\n                // Delete an entry if it's older than the max age or\n                // if we already have the max number allowed.\n                if ((minTimestamp && result.timestamp < minTimestamp) ||\n                    (maxCount && entriesNotDeletedCount >= maxCount)) {\n                    // TODO(philipwalton): we should be able to delete the\n                    // entry right here, but doing so causes an iteration\n                    // bug in Safari stable (fixed in TP). Instead we can\n                    // store the keys of the entries to delete, and then\n                    // delete the separate transactions.\n                    // https://github.com/GoogleChrome/workbox/issues/1978\n                    // cursor.delete();\n                    // We only need to return the URL, not the whole entry.\n                    entriesToDelete.push(cursor.value);\n                }\n                else {\n                    entriesNotDeletedCount++;\n                }\n            }\n            cursor = await cursor.continue();\n        }\n        // TODO(philipwalton): once the Safari bug in the following issue is fixed,\n        // we should be able to remove this loop and do the entry deletion in the\n        // cursor loop above:\n        // https://github.com/GoogleChrome/workbox/issues/1978\n        const urlsDeleted = [];\n        for (const entry of entriesToDelete) {\n            await db.delete(CACHE_OBJECT_STORE, entry.id);\n            urlsDeleted.push(entry.url);\n        }\n        return urlsDeleted;\n    }\n    /**\n     * Takes a URL and returns an ID that will be unique in the object store.\n     *\n     * @param {string} url\n     * @return {string}\n     *\n     * @private\n     */\n    _getId(url) {\n        // Creating an ID from the URL and cache name won't be necessary once\n        // Edge switches to Chromium and all browsers we support work with\n        // array keyPaths.\n        return this._cacheName + '|' + normalizeURL(url);\n    }\n    /**\n     * Returns an open connection to the database.\n     *\n     * @private\n     */\n    async getDb() {\n        if (!this._db) {\n            this._db = await openDB(DB_NAME, 1, {\n                upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),\n            });\n        }\n        return this._db;\n    }\n}\nexport { CacheTimestampsModel };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheTimestampsModel } from './models/CacheTimestampsModel.js';\nimport './_version.js';\n/**\n * The `CacheExpiration` class allows you define an expiration and / or\n * limit on the number of responses stored in a\n * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).\n *\n * @memberof workbox-expiration\n */\nclass CacheExpiration {\n    /**\n     * To construct a new CacheExpiration instance you must provide at least\n     * one of the `config` properties.\n     *\n     * @param {string} cacheName Name of the cache to apply restrictions to.\n     * @param {Object} config\n     * @param {number} [config.maxEntries] The maximum number of entries to cache.\n     * Entries used the least will be removed as the maximum is reached.\n     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n     * it's treated as stale and removed.\n     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n     * that will be used when calling `delete()` on the cache.\n     */\n    constructor(cacheName, config = {}) {\n        this._isRunning = false;\n        this._rerunRequested = false;\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(cacheName, 'string', {\n                moduleName: 'workbox-expiration',\n                className: 'CacheExpiration',\n                funcName: 'constructor',\n                paramName: 'cacheName',\n            });\n            if (!(config.maxEntries || config.maxAgeSeconds)) {\n                throw new WorkboxError('max-entries-or-age-required', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.maxEntries) {\n                assert.isType(config.maxEntries, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                    paramName: 'config.maxEntries',\n                });\n            }\n            if (config.maxAgeSeconds) {\n                assert.isType(config.maxAgeSeconds, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'CacheExpiration',\n                    funcName: 'constructor',\n                    paramName: 'config.maxAgeSeconds',\n                });\n            }\n        }\n        this._maxEntries = config.maxEntries;\n        this._maxAgeSeconds = config.maxAgeSeconds;\n        this._matchOptions = config.matchOptions;\n        this._cacheName = cacheName;\n        this._timestampModel = new CacheTimestampsModel(cacheName);\n    }\n    /**\n     * Expires entries for the given cache and given criteria.\n     */\n    async expireEntries() {\n        if (this._isRunning) {\n            this._rerunRequested = true;\n            return;\n        }\n        this._isRunning = true;\n        const minTimestamp = this._maxAgeSeconds\n            ? Date.now() - this._maxAgeSeconds * 1000\n            : 0;\n        const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);\n        // Delete URLs from the cache\n        const cache = await self.caches.open(this._cacheName);\n        for (const url of urlsExpired) {\n            await cache.delete(url, this._matchOptions);\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (urlsExpired.length > 0) {\n                logger.groupCollapsed(`Expired ${urlsExpired.length} ` +\n                    `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` +\n                    `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` +\n                    `'${this._cacheName}' cache.`);\n                logger.log(`Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`);\n                urlsExpired.forEach((url) => logger.log(`    ${url}`));\n                logger.groupEnd();\n            }\n            else {\n                logger.debug(`Cache expiration ran and found no entries to remove.`);\n            }\n        }\n        this._isRunning = false;\n        if (this._rerunRequested) {\n            this._rerunRequested = false;\n            dontWaitFor(this.expireEntries());\n        }\n    }\n    /**\n     * Update the timestamp for the given URL. This ensures the when\n     * removing entries based on maximum entries, most recently used\n     * is accurate or when expiring, the timestamp is up-to-date.\n     *\n     * @param {string} url\n     */\n    async updateTimestamp(url) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(url, 'string', {\n                moduleName: 'workbox-expiration',\n                className: 'CacheExpiration',\n                funcName: 'updateTimestamp',\n                paramName: 'url',\n            });\n        }\n        await this._timestampModel.setTimestamp(url, Date.now());\n    }\n    /**\n     * Can be used to check if a URL has expired or not before it's used.\n     *\n     * This requires a look up from IndexedDB, so can be slow.\n     *\n     * Note: This method will not remove the cached entry, call\n     * `expireEntries()` to remove indexedDB and Cache entries.\n     *\n     * @param {string} url\n     * @return {boolean}\n     */\n    async isURLExpired(url) {\n        if (!this._maxAgeSeconds) {\n            if (process.env.NODE_ENV !== 'production') {\n                throw new WorkboxError(`expired-test-without-max-age`, {\n                    methodName: 'isURLExpired',\n                    paramName: 'maxAgeSeconds',\n                });\n            }\n            return false;\n        }\n        else {\n            const timestamp = await this._timestampModel.getTimestamp(url);\n            const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;\n            return timestamp !== undefined ? timestamp < expireOlderThan : true;\n        }\n    }\n    /**\n     * Removes the IndexedDB object store used to keep track of cache expiration\n     * metadata.\n     */\n    async delete() {\n        // Make sure we don't attempt another rerun if we're called in the middle of\n        // a cache expiration.\n        this._rerunRequested = false;\n        await this._timestampModel.expireEntries(Infinity); // Expires all.\n    }\n}\nexport { CacheExpiration };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { registerQuotaErrorCallback } from 'workbox-core/registerQuotaErrorCallback.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheExpiration } from './CacheExpiration.js';\nimport './_version.js';\n/**\n * This plugin can be used in a `workbox-strategy` to regularly enforce a\n * limit on the age and / or the number of cached requests.\n *\n * It can only be used with `workbox-strategy` instances that have a\n * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).\n * In other words, it can't be used to expire entries in strategy that uses the\n * default runtime cache name.\n *\n * Whenever a cached response is used or updated, this plugin will look\n * at the associated cache and remove any old or extra responses.\n *\n * When using `maxAgeSeconds`, responses may be used *once* after expiring\n * because the expiration clean up will not have occurred until *after* the\n * cached response has been used. If the response has a \"Date\" header, then\n * a light weight expiration check is performed and the response will not be\n * used immediately.\n *\n * When using `maxEntries`, the entry least-recently requested will be removed\n * from the cache first.\n *\n * @memberof workbox-expiration\n */\nclass ExpirationPlugin {\n    /**\n     * @param {ExpirationPluginOptions} config\n     * @param {number} [config.maxEntries] The maximum number of entries to cache.\n     * Entries used the least will be removed as the maximum is reached.\n     * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n     * it's treated as stale and removed.\n     * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n     * that will be used when calling `delete()` on the cache.\n     * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to\n     * automatic deletion if the available storage quota has been exceeded.\n     */\n    constructor(config = {}) {\n        /**\n         * A \"lifecycle\" callback that will be triggered automatically by the\n         * `workbox-strategies` handlers when a `Response` is about to be returned\n         * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to\n         * the handler. It allows the `Response` to be inspected for freshness and\n         * prevents it from being used if the `Response`'s `Date` header value is\n         * older than the configured `maxAgeSeconds`.\n         *\n         * @param {Object} options\n         * @param {string} options.cacheName Name of the cache the response is in.\n         * @param {Response} options.cachedResponse The `Response` object that's been\n         *     read from a cache and whose freshness should be checked.\n         * @return {Response} Either the `cachedResponse`, if it's\n         *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.\n         *\n         * @private\n         */\n        this.cachedResponseWillBeUsed = async ({ event, request, cacheName, cachedResponse, }) => {\n            if (!cachedResponse) {\n                return null;\n            }\n            const isFresh = this._isResponseDateFresh(cachedResponse);\n            // Expire entries to ensure that even if the expiration date has\n            // expired, it'll only be used once.\n            const cacheExpiration = this._getCacheExpiration(cacheName);\n            dontWaitFor(cacheExpiration.expireEntries());\n            // Update the metadata for the request URL to the current timestamp,\n            // but don't `await` it as we don't want to block the response.\n            const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);\n            if (event) {\n                try {\n                    event.waitUntil(updateTimestampDone);\n                }\n                catch (error) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // The event may not be a fetch event; only log the URL if it is.\n                        if ('request' in event) {\n                            logger.warn(`Unable to ensure service worker stays alive when ` +\n                                `updating cache entry for ` +\n                                `'${getFriendlyURL(event.request.url)}'.`);\n                        }\n                    }\n                }\n            }\n            return isFresh ? cachedResponse : null;\n        };\n        /**\n         * A \"lifecycle\" callback that will be triggered automatically by the\n         * `workbox-strategies` handlers when an entry is added to a cache.\n         *\n         * @param {Object} options\n         * @param {string} options.cacheName Name of the cache that was updated.\n         * @param {string} options.request The Request for the cached entry.\n         *\n         * @private\n         */\n        this.cacheDidUpdate = async ({ cacheName, request, }) => {\n            if (process.env.NODE_ENV !== 'production') {\n                assert.isType(cacheName, 'string', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'cacheDidUpdate',\n                    paramName: 'cacheName',\n                });\n                assert.isInstance(request, Request, {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'cacheDidUpdate',\n                    paramName: 'request',\n                });\n            }\n            const cacheExpiration = this._getCacheExpiration(cacheName);\n            await cacheExpiration.updateTimestamp(request.url);\n            await cacheExpiration.expireEntries();\n        };\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(config.maxEntries || config.maxAgeSeconds)) {\n                throw new WorkboxError('max-entries-or-age-required', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                });\n            }\n            if (config.maxEntries) {\n                assert.isType(config.maxEntries, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                    paramName: 'config.maxEntries',\n                });\n            }\n            if (config.maxAgeSeconds) {\n                assert.isType(config.maxAgeSeconds, 'number', {\n                    moduleName: 'workbox-expiration',\n                    className: 'Plugin',\n                    funcName: 'constructor',\n                    paramName: 'config.maxAgeSeconds',\n                });\n            }\n        }\n        this._config = config;\n        this._maxAgeSeconds = config.maxAgeSeconds;\n        this._cacheExpirations = new Map();\n        if (config.purgeOnQuotaError) {\n            registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());\n        }\n    }\n    /**\n     * A simple helper method to return a CacheExpiration instance for a given\n     * cache name.\n     *\n     * @param {string} cacheName\n     * @return {CacheExpiration}\n     *\n     * @private\n     */\n    _getCacheExpiration(cacheName) {\n        if (cacheName === cacheNames.getRuntimeName()) {\n            throw new WorkboxError('expire-custom-caches-only');\n        }\n        let cacheExpiration = this._cacheExpirations.get(cacheName);\n        if (!cacheExpiration) {\n            cacheExpiration = new CacheExpiration(cacheName, this._config);\n            this._cacheExpirations.set(cacheName, cacheExpiration);\n        }\n        return cacheExpiration;\n    }\n    /**\n     * @param {Response} cachedResponse\n     * @return {boolean}\n     *\n     * @private\n     */\n    _isResponseDateFresh(cachedResponse) {\n        if (!this._maxAgeSeconds) {\n            // We aren't expiring by age, so return true, it's fresh\n            return true;\n        }\n        // Check if the 'date' header will suffice a quick expiration check.\n        // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for\n        // discussion.\n        const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);\n        if (dateHeaderTimestamp === null) {\n            // Unable to parse date, so assume it's fresh.\n            return true;\n        }\n        // If we have a valid headerTime, then our response is fresh iff the\n        // headerTime plus maxAgeSeconds is greater than the current time.\n        const now = Date.now();\n        return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;\n    }\n    /**\n     * This method will extract the data header and parse it into a useful\n     * value.\n     *\n     * @param {Response} cachedResponse\n     * @return {number|null}\n     *\n     * @private\n     */\n    _getDateHeaderTimestamp(cachedResponse) {\n        if (!cachedResponse.headers.has('date')) {\n            return null;\n        }\n        const dateHeader = cachedResponse.headers.get('date');\n        const parsedDate = new Date(dateHeader);\n        const headerTime = parsedDate.getTime();\n        // If the Date header was invalid for some reason, parsedDate.getTime()\n        // will return NaN.\n        if (isNaN(headerTime)) {\n            return null;\n        }\n        return headerTime;\n    }\n    /**\n     * This is a helper method that performs two operations:\n     *\n     * - Deletes *all* the underlying Cache instances associated with this plugin\n     * instance, by calling caches.delete() on your behalf.\n     * - Deletes the metadata from IndexedDB used to keep track of expiration\n     * details for each Cache instance.\n     *\n     * When using cache expiration, calling this method is preferable to calling\n     * `caches.delete()` directly, since this will ensure that the IndexedDB\n     * metadata is also cleanly removed and open IndexedDB instances are deleted.\n     *\n     * Note that if you're *not* using cache expiration for a given cache, calling\n     * `caches.delete()` and passing in the cache's name should be sufficient.\n     * There is no Workbox-specific method needed for cleanup in that case.\n     */\n    async deleteCacheAndMetadata() {\n        // Do this one at a time instead of all at once via `Promise.all()` to\n        // reduce the chance of inconsistency if a promise rejects.\n        for (const [cacheName, cacheExpiration] of this._cacheExpirations) {\n            await self.caches.delete(cacheName);\n            await cacheExpiration.delete();\n        }\n        // Reset this._cacheExpirations to its initial state.\n        this._cacheExpirations = new Map();\n    }\n}\nexport { ExpirationPlugin };\n"],"names":["instanceOfAny","object","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","Promise","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","Proxy","IDBRequest","request","promise","success","result","then","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","all","oldTraps","_extends","callback","self","_","e","CACHE_OBJECT_STORE","normalizeURL","unNormalizedUrl","url","URL","location","href","hash","CacheTimestampsModel","constructor","cacheName","_db","_cacheName","_upgradeDb","db","objStore","createObjectStore","keyPath","createIndex","unique","_upgradeDbAndDeleteOldDbs","name","blocked","indexedDB","deleteDatabase","deleteDB","timestamp","entry","id","_getId","getDb","durability","put","minTimestamp","maxCount","cursor","openCursor","entriesToDelete","entriesNotDeletedCount","push","urlsDeleted","delete","version","upgrade","blocking","terminated","open","openPromise","event","oldVersion","newVersion","openDB","bind","CacheExpiration","config","_isRunning","_rerunRequested","_maxEntries","maxEntries","_maxAgeSeconds","maxAgeSeconds","_matchOptions","matchOptions","_timestampModel","Date","now","urlsExpired","expireEntries","cache","caches","dontWaitFor","setTimestamp","getTimestamp","expireOlderThan","Infinity","cachedResponseWillBeUsed","cachedResponse","isFresh","_isResponseDateFresh","cacheExpiration","_getCacheExpiration","updateTimestampDone","updateTimestamp","waitUntil","cacheDidUpdate","_config","_cacheExpirations","purgeOnQuotaError","registerQuotaErrorCallback","deleteCacheAndMetadata","cacheNames","getRuntimeName","WorkboxError","dateHeaderTimestamp","_getDateHeaderTimestamp","headers","dateHeader","headerTime","getTime","isNaN"],"mappings":"+SAAA,MAAMA,EAAgBA,CAACC,EAAQC,IAAiBA,EAAaC,MAAMC,GAAMH,aAAkBG,IAE3F,IAAIC,EACAC,EAqBJ,MAAMC,EAAmB,IAAIC,QACvBC,EAAqB,IAAID,QACzBE,EAA2B,IAAIF,QAC/BG,EAAiB,IAAIH,QACrBI,EAAwB,IAAIJ,QA0DlC,IAAIK,EAAgB,CAChBC,IAAIC,EAAQC,EAAMC,GACd,GAAIF,aAAkBG,eAAgB,CAElC,GAAa,SAATF,EACA,OAAOP,EAAmBK,IAAIC,GAElC,GAAa,qBAATC,EACA,OAAOD,EAAOI,kBAAoBT,EAAyBI,IAAIC,GAGnE,GAAa,UAATC,EACA,OAAOC,EAASE,iBAAiB,QAC3BC,EACAH,EAASI,YAAYJ,EAASE,iBAAiB,GAE7D,CAEA,OAAOG,EAAKP,EAAOC,GAC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AI6E,EAAWqE,IAEnCA,CACX,CAOAD,GAAqBF,GACjB,IAAK/H,KAAK8G,GAEN,OAAO,EAKX,MAAMkC,EAAsBhJ,KAAKiJ,GAAwBlB,GACzD,GAA4B,OAAxBiB,EAEA,OAAO,EAKX,OAAOA,GADK7B,KAAKC,MACyC,IAAtBpH,KAAK8G,EAC7C,CAUAmC,GAAwBlB,GACpB,IAAKA,EAAemB,QAAQhK,IAAI,QAC5B,OAAO,KAEX,MAAMiK,EAAapB,EAAemB,QAAQ3K,IAAI,QAExC6K,EADa,IAAIjC,KAAKgC,GACEE,UAG9B,OAAIC,MAAMF,GACC,KAEJA,CACX,CAiBA7G,+BAGI,IAAK,MAAOsB,EAAWqE,KAAoBlI,KAAKyI,SACtCzF,KAAKwE,OAAO5B,OAAO/B,SACnBqE,EAAgBtC,SAG1B5F,KAAKyI,GAAoB,IAAIzG,GACjC","x_google_ignoreList":[0,1]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/index.d.ts b/tools/ui/node_modules/workbox-expiration/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3b9a9b0518bf4bb51eefc4fe60c70d968cc98384
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/index.d.ts
@@ -0,0 +1,7 @@
+import { CacheExpiration } from './CacheExpiration.js';
+import { ExpirationPlugin, ExpirationPluginOptions } from './ExpirationPlugin.js';
+import './_version.js';
+/**
+ * @module workbox-expiration
+ */
+export { CacheExpiration, ExpirationPlugin, ExpirationPluginOptions };
diff --git a/tools/ui/node_modules/workbox-expiration/index.js b/tools/ui/node_modules/workbox-expiration/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a5a0729cb598355d05bfc4c3e5bcfb3788b1bde
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/index.js
@@ -0,0 +1,14 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { CacheExpiration } from './CacheExpiration.js';
+import { ExpirationPlugin } from './ExpirationPlugin.js';
+import './_version.js';
+/**
+ * @module workbox-expiration
+ */
+export { CacheExpiration, ExpirationPlugin };
diff --git a/tools/ui/node_modules/workbox-expiration/index.mjs b/tools/ui/node_modules/workbox-expiration/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.d.ts b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a392ee5e8a208d3ce6982e852d06e59a86a36bd4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.d.ts
@@ -0,0 +1,77 @@
+import '../_version.js';
+/**
+ * Returns the timestamp model.
+ *
+ * @private
+ */
+declare class CacheTimestampsModel {
+    private readonly _cacheName;
+    private _db;
+    /**
+     *
+     * @param {string} cacheName
+     *
+     * @private
+     */
+    constructor(cacheName: string);
+    /**
+     * Performs an upgrade of indexedDB.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    private _upgradeDb;
+    /**
+     * Performs an upgrade of indexedDB and deletes deprecated DBs.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    private _upgradeDbAndDeleteOldDbs;
+    /**
+     * @param {string} url
+     * @param {number} timestamp
+     *
+     * @private
+     */
+    setTimestamp(url: string, timestamp: number): Promise;
+    /**
+     * Returns the timestamp stored for a given URL.
+     *
+     * @param {string} url
+     * @return {number | undefined}
+     *
+     * @private
+     */
+    getTimestamp(url: string): Promise;
+    /**
+     * Iterates through all the entries in the object store (from newest to
+     * oldest) and removes entries once either `maxCount` is reached or the
+     * entry's timestamp is less than `minTimestamp`.
+     *
+     * @param {number} minTimestamp
+     * @param {number} maxCount
+     * @return {Array}
+     *
+     * @private
+     */
+    expireEntries(minTimestamp: number, maxCount?: number): Promise;
+    /**
+     * Takes a URL and returns an ID that will be unique in the object store.
+     *
+     * @param {string} url
+     * @return {string}
+     *
+     * @private
+     */
+    private _getId;
+    /**
+     * Returns an open connection to the database.
+     *
+     * @private
+     */
+    private getDb;
+}
+export { CacheTimestampsModel };
diff --git a/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.js b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.js
new file mode 100644
index 0000000000000000000000000000000000000000..1206e76b46e8e88d065f3eee3a7c4046a76fc847
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.js
@@ -0,0 +1,185 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { openDB, deleteDB } from 'idb';
+import '../_version.js';
+const DB_NAME = 'workbox-expiration';
+const CACHE_OBJECT_STORE = 'cache-entries';
+const normalizeURL = (unNormalizedUrl) => {
+    const url = new URL(unNormalizedUrl, location.href);
+    url.hash = '';
+    return url.href;
+};
+/**
+ * Returns the timestamp model.
+ *
+ * @private
+ */
+class CacheTimestampsModel {
+    /**
+     *
+     * @param {string} cacheName
+     *
+     * @private
+     */
+    constructor(cacheName) {
+        this._db = null;
+        this._cacheName = cacheName;
+    }
+    /**
+     * Performs an upgrade of indexedDB.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    _upgradeDb(db) {
+        // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we
+        // have to use the `id` keyPath here and create our own values (a
+        // concatenation of `url + cacheName`) instead of simply using
+        // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.
+        const objStore = db.createObjectStore(CACHE_OBJECT_STORE, { keyPath: 'id' });
+        // TODO(philipwalton): once we don't have to support EdgeHTML, we can
+        // create a single index with the keyPath `['cacheName', 'timestamp']`
+        // instead of doing both these indexes.
+        objStore.createIndex('cacheName', 'cacheName', { unique: false });
+        objStore.createIndex('timestamp', 'timestamp', { unique: false });
+    }
+    /**
+     * Performs an upgrade of indexedDB and deletes deprecated DBs.
+     *
+     * @param {IDBPDatabase} db
+     *
+     * @private
+     */
+    _upgradeDbAndDeleteOldDbs(db) {
+        this._upgradeDb(db);
+        if (this._cacheName) {
+            void deleteDB(this._cacheName);
+        }
+    }
+    /**
+     * @param {string} url
+     * @param {number} timestamp
+     *
+     * @private
+     */
+    async setTimestamp(url, timestamp) {
+        url = normalizeURL(url);
+        const entry = {
+            url,
+            timestamp,
+            cacheName: this._cacheName,
+            // Creating an ID from the URL and cache name won't be necessary once
+            // Edge switches to Chromium and all browsers we support work with
+            // array keyPaths.
+            id: this._getId(url),
+        };
+        const db = await this.getDb();
+        const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {
+            durability: 'relaxed',
+        });
+        await tx.store.put(entry);
+        await tx.done;
+    }
+    /**
+     * Returns the timestamp stored for a given URL.
+     *
+     * @param {string} url
+     * @return {number | undefined}
+     *
+     * @private
+     */
+    async getTimestamp(url) {
+        const db = await this.getDb();
+        const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));
+        return entry === null || entry === void 0 ? void 0 : entry.timestamp;
+    }
+    /**
+     * Iterates through all the entries in the object store (from newest to
+     * oldest) and removes entries once either `maxCount` is reached or the
+     * entry's timestamp is less than `minTimestamp`.
+     *
+     * @param {number} minTimestamp
+     * @param {number} maxCount
+     * @return {Array}
+     *
+     * @private
+     */
+    async expireEntries(minTimestamp, maxCount) {
+        const db = await this.getDb();
+        let cursor = await db
+            .transaction(CACHE_OBJECT_STORE)
+            .store.index('timestamp')
+            .openCursor(null, 'prev');
+        const entriesToDelete = [];
+        let entriesNotDeletedCount = 0;
+        while (cursor) {
+            const result = cursor.value;
+            // TODO(philipwalton): once we can use a multi-key index, we
+            // won't have to check `cacheName` here.
+            if (result.cacheName === this._cacheName) {
+                // Delete an entry if it's older than the max age or
+                // if we already have the max number allowed.
+                if ((minTimestamp && result.timestamp < minTimestamp) ||
+                    (maxCount && entriesNotDeletedCount >= maxCount)) {
+                    // TODO(philipwalton): we should be able to delete the
+                    // entry right here, but doing so causes an iteration
+                    // bug in Safari stable (fixed in TP). Instead we can
+                    // store the keys of the entries to delete, and then
+                    // delete the separate transactions.
+                    // https://github.com/GoogleChrome/workbox/issues/1978
+                    // cursor.delete();
+                    // We only need to return the URL, not the whole entry.
+                    entriesToDelete.push(cursor.value);
+                }
+                else {
+                    entriesNotDeletedCount++;
+                }
+            }
+            cursor = await cursor.continue();
+        }
+        // TODO(philipwalton): once the Safari bug in the following issue is fixed,
+        // we should be able to remove this loop and do the entry deletion in the
+        // cursor loop above:
+        // https://github.com/GoogleChrome/workbox/issues/1978
+        const urlsDeleted = [];
+        for (const entry of entriesToDelete) {
+            await db.delete(CACHE_OBJECT_STORE, entry.id);
+            urlsDeleted.push(entry.url);
+        }
+        return urlsDeleted;
+    }
+    /**
+     * Takes a URL and returns an ID that will be unique in the object store.
+     *
+     * @param {string} url
+     * @return {string}
+     *
+     * @private
+     */
+    _getId(url) {
+        // Creating an ID from the URL and cache name won't be necessary once
+        // Edge switches to Chromium and all browsers we support work with
+        // array keyPaths.
+        return this._cacheName + '|' + normalizeURL(url);
+    }
+    /**
+     * Returns an open connection to the database.
+     *
+     * @private
+     */
+    async getDb() {
+        if (!this._db) {
+            this._db = await openDB(DB_NAME, 1, {
+                upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),
+            });
+        }
+        return this._db;
+    }
+}
+export { CacheTimestampsModel };
diff --git a/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.mjs b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..a0292d8239695a5b2d0261660c715fddf8f6bfda
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/models/CacheTimestampsModel.mjs
@@ -0,0 +1 @@
+export * from './CacheTimestampsModel.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/package.json b/tools/ui/node_modules/workbox-expiration/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..b58cddac88d3c12a27e32b6fae9db91a0826860e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/package.json
@@ -0,0 +1,32 @@
+{
+  "name": "workbox-expiration",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "A service worker helper library that expires cached responses based on age or maximum number of entries.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "workbox-plugin"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.expiration",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "idb": "^7.0.1",
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-expiration/src/CacheExpiration.ts b/tools/ui/node_modules/workbox-expiration/src/CacheExpiration.ts
new file mode 100644
index 0000000000000000000000000000000000000000..954f4305dbb13f4202b5e214db4dcdc91c804b69
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/src/CacheExpiration.ts
@@ -0,0 +1,205 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {dontWaitFor} from 'workbox-core/_private/dontWaitFor.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {CacheTimestampsModel} from './models/CacheTimestampsModel.js';
+
+import './_version.js';
+
+interface CacheExpirationConfig {
+  maxEntries?: number;
+  maxAgeSeconds?: number;
+  matchOptions?: CacheQueryOptions;
+}
+
+/**
+ * The `CacheExpiration` class allows you define an expiration and / or
+ * limit on the number of responses stored in a
+ * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
+ *
+ * @memberof workbox-expiration
+ */
+class CacheExpiration {
+  private _isRunning = false;
+  private _rerunRequested = false;
+  private readonly _maxEntries?: number;
+  private readonly _maxAgeSeconds?: number;
+  private readonly _matchOptions?: CacheQueryOptions;
+  private readonly _cacheName: string;
+  private readonly _timestampModel: CacheTimestampsModel;
+
+  /**
+   * To construct a new CacheExpiration instance you must provide at least
+   * one of the `config` properties.
+   *
+   * @param {string} cacheName Name of the cache to apply restrictions to.
+   * @param {Object} config
+   * @param {number} [config.maxEntries] The maximum number of entries to cache.
+   * Entries used the least will be removed as the maximum is reached.
+   * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+   * it's treated as stale and removed.
+   * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+   * that will be used when calling `delete()` on the cache.
+   */
+  constructor(cacheName: string, config: CacheExpirationConfig = {}) {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(cacheName, 'string', {
+        moduleName: 'workbox-expiration',
+        className: 'CacheExpiration',
+        funcName: 'constructor',
+        paramName: 'cacheName',
+      });
+
+      if (!(config.maxEntries || config.maxAgeSeconds)) {
+        throw new WorkboxError('max-entries-or-age-required', {
+          moduleName: 'workbox-expiration',
+          className: 'CacheExpiration',
+          funcName: 'constructor',
+        });
+      }
+
+      if (config.maxEntries) {
+        assert!.isType(config.maxEntries, 'number', {
+          moduleName: 'workbox-expiration',
+          className: 'CacheExpiration',
+          funcName: 'constructor',
+          paramName: 'config.maxEntries',
+        });
+      }
+
+      if (config.maxAgeSeconds) {
+        assert!.isType(config.maxAgeSeconds, 'number', {
+          moduleName: 'workbox-expiration',
+          className: 'CacheExpiration',
+          funcName: 'constructor',
+          paramName: 'config.maxAgeSeconds',
+        });
+      }
+    }
+
+    this._maxEntries = config.maxEntries;
+    this._maxAgeSeconds = config.maxAgeSeconds;
+    this._matchOptions = config.matchOptions;
+    this._cacheName = cacheName;
+    this._timestampModel = new CacheTimestampsModel(cacheName);
+  }
+
+  /**
+   * Expires entries for the given cache and given criteria.
+   */
+  async expireEntries(): Promise {
+    if (this._isRunning) {
+      this._rerunRequested = true;
+      return;
+    }
+    this._isRunning = true;
+
+    const minTimestamp = this._maxAgeSeconds
+      ? Date.now() - this._maxAgeSeconds * 1000
+      : 0;
+
+    const urlsExpired = await this._timestampModel.expireEntries(
+      minTimestamp,
+      this._maxEntries,
+    );
+
+    // Delete URLs from the cache
+    const cache = await self.caches.open(this._cacheName);
+    for (const url of urlsExpired) {
+      await cache.delete(url, this._matchOptions);
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (urlsExpired.length > 0) {
+        logger.groupCollapsed(
+          `Expired ${urlsExpired.length} ` +
+            `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` +
+            `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` +
+            `'${this._cacheName}' cache.`,
+        );
+        logger.log(
+          `Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`,
+        );
+        urlsExpired.forEach((url) => logger.log(`    ${url}`));
+        logger.groupEnd();
+      } else {
+        logger.debug(`Cache expiration ran and found no entries to remove.`);
+      }
+    }
+
+    this._isRunning = false;
+    if (this._rerunRequested) {
+      this._rerunRequested = false;
+      dontWaitFor(this.expireEntries());
+    }
+  }
+
+  /**
+   * Update the timestamp for the given URL. This ensures the when
+   * removing entries based on maximum entries, most recently used
+   * is accurate or when expiring, the timestamp is up-to-date.
+   *
+   * @param {string} url
+   */
+  async updateTimestamp(url: string): Promise {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(url, 'string', {
+        moduleName: 'workbox-expiration',
+        className: 'CacheExpiration',
+        funcName: 'updateTimestamp',
+        paramName: 'url',
+      });
+    }
+
+    await this._timestampModel.setTimestamp(url, Date.now());
+  }
+
+  /**
+   * Can be used to check if a URL has expired or not before it's used.
+   *
+   * This requires a look up from IndexedDB, so can be slow.
+   *
+   * Note: This method will not remove the cached entry, call
+   * `expireEntries()` to remove indexedDB and Cache entries.
+   *
+   * @param {string} url
+   * @return {boolean}
+   */
+  async isURLExpired(url: string): Promise {
+    if (!this._maxAgeSeconds) {
+      if (process.env.NODE_ENV !== 'production') {
+        throw new WorkboxError(`expired-test-without-max-age`, {
+          methodName: 'isURLExpired',
+          paramName: 'maxAgeSeconds',
+        });
+      }
+      return false;
+    } else {
+      const timestamp = await this._timestampModel.getTimestamp(url);
+      const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;
+      return timestamp !== undefined ? timestamp < expireOlderThan : true;
+    }
+  }
+
+  /**
+   * Removes the IndexedDB object store used to keep track of cache expiration
+   * metadata.
+   */
+  async delete(): Promise {
+    // Make sure we don't attempt another rerun if we're called in the middle of
+    // a cache expiration.
+    this._rerunRequested = false;
+    await this._timestampModel.expireEntries(Infinity); // Expires all.
+  }
+}
+
+export {CacheExpiration};
diff --git a/tools/ui/node_modules/workbox-expiration/src/ExpirationPlugin.ts b/tools/ui/node_modules/workbox-expiration/src/ExpirationPlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dd646d96e8f35bd43d9094404544675e53626d3c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/src/ExpirationPlugin.ts
@@ -0,0 +1,302 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {dontWaitFor} from 'workbox-core/_private/dontWaitFor.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {registerQuotaErrorCallback} from 'workbox-core/registerQuotaErrorCallback.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {WorkboxPlugin} from 'workbox-core/types.js';
+
+import {CacheExpiration} from './CacheExpiration.js';
+
+import './_version.js';
+
+export interface ExpirationPluginOptions {
+  maxEntries?: number;
+  maxAgeSeconds?: number;
+  matchOptions?: CacheQueryOptions;
+  purgeOnQuotaError?: boolean;
+}
+
+/**
+ * This plugin can be used in a `workbox-strategy` to regularly enforce a
+ * limit on the age and / or the number of cached requests.
+ *
+ * It can only be used with `workbox-strategy` instances that have a
+ * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).
+ * In other words, it can't be used to expire entries in strategy that uses the
+ * default runtime cache name.
+ *
+ * Whenever a cached response is used or updated, this plugin will look
+ * at the associated cache and remove any old or extra responses.
+ *
+ * When using `maxAgeSeconds`, responses may be used *once* after expiring
+ * because the expiration clean up will not have occurred until *after* the
+ * cached response has been used. If the response has a "Date" header, then
+ * a light weight expiration check is performed and the response will not be
+ * used immediately.
+ *
+ * When using `maxEntries`, the entry least-recently requested will be removed
+ * from the cache first.
+ *
+ * @memberof workbox-expiration
+ */
+class ExpirationPlugin implements WorkboxPlugin {
+  private readonly _config: ExpirationPluginOptions;
+  private readonly _maxAgeSeconds?: number;
+  private _cacheExpirations: Map;
+
+  /**
+   * @param {ExpirationPluginOptions} config
+   * @param {number} [config.maxEntries] The maximum number of entries to cache.
+   * Entries used the least will be removed as the maximum is reached.
+   * @param {number} [config.maxAgeSeconds] The maximum age of an entry before
+   * it's treated as stale and removed.
+   * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
+   * that will be used when calling `delete()` on the cache.
+   * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to
+   * automatic deletion if the available storage quota has been exceeded.
+   */
+  constructor(config: ExpirationPluginOptions = {}) {
+    if (process.env.NODE_ENV !== 'production') {
+      if (!(config.maxEntries || config.maxAgeSeconds)) {
+        throw new WorkboxError('max-entries-or-age-required', {
+          moduleName: 'workbox-expiration',
+          className: 'Plugin',
+          funcName: 'constructor',
+        });
+      }
+
+      if (config.maxEntries) {
+        assert!.isType(config.maxEntries, 'number', {
+          moduleName: 'workbox-expiration',
+          className: 'Plugin',
+          funcName: 'constructor',
+          paramName: 'config.maxEntries',
+        });
+      }
+
+      if (config.maxAgeSeconds) {
+        assert!.isType(config.maxAgeSeconds, 'number', {
+          moduleName: 'workbox-expiration',
+          className: 'Plugin',
+          funcName: 'constructor',
+          paramName: 'config.maxAgeSeconds',
+        });
+      }
+    }
+
+    this._config = config;
+    this._maxAgeSeconds = config.maxAgeSeconds;
+    this._cacheExpirations = new Map();
+
+    if (config.purgeOnQuotaError) {
+      registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());
+    }
+  }
+
+  /**
+   * A simple helper method to return a CacheExpiration instance for a given
+   * cache name.
+   *
+   * @param {string} cacheName
+   * @return {CacheExpiration}
+   *
+   * @private
+   */
+  private _getCacheExpiration(cacheName: string): CacheExpiration {
+    if (cacheName === cacheNames.getRuntimeName()) {
+      throw new WorkboxError('expire-custom-caches-only');
+    }
+
+    let cacheExpiration = this._cacheExpirations.get(cacheName);
+    if (!cacheExpiration) {
+      cacheExpiration = new CacheExpiration(cacheName, this._config);
+      this._cacheExpirations.set(cacheName, cacheExpiration);
+    }
+    return cacheExpiration;
+  }
+
+  /**
+   * A "lifecycle" callback that will be triggered automatically by the
+   * `workbox-strategies` handlers when a `Response` is about to be returned
+   * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to
+   * the handler. It allows the `Response` to be inspected for freshness and
+   * prevents it from being used if the `Response`'s `Date` header value is
+   * older than the configured `maxAgeSeconds`.
+   *
+   * @param {Object} options
+   * @param {string} options.cacheName Name of the cache the response is in.
+   * @param {Response} options.cachedResponse The `Response` object that's been
+   *     read from a cache and whose freshness should be checked.
+   * @return {Response} Either the `cachedResponse`, if it's
+   *     fresh, or `null` if the `Response` is older than `maxAgeSeconds`.
+   *
+   * @private
+   */
+  cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'] = async ({
+    event,
+    request,
+    cacheName,
+    cachedResponse,
+  }) => {
+    if (!cachedResponse) {
+      return null;
+    }
+
+    const isFresh = this._isResponseDateFresh(cachedResponse);
+
+    // Expire entries to ensure that even if the expiration date has
+    // expired, it'll only be used once.
+    const cacheExpiration = this._getCacheExpiration(cacheName);
+    dontWaitFor(cacheExpiration.expireEntries());
+
+    // Update the metadata for the request URL to the current timestamp,
+    // but don't `await` it as we don't want to block the response.
+    const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);
+    if (event) {
+      try {
+        event.waitUntil(updateTimestampDone);
+      } catch (error) {
+        if (process.env.NODE_ENV !== 'production') {
+          // The event may not be a fetch event; only log the URL if it is.
+          if ('request' in event) {
+            logger.warn(
+              `Unable to ensure service worker stays alive when ` +
+                `updating cache entry for ` +
+                `'${getFriendlyURL((event as FetchEvent).request.url)}'.`,
+            );
+          }
+        }
+      }
+    }
+
+    return isFresh ? cachedResponse : null;
+  };
+
+  /**
+   * @param {Response} cachedResponse
+   * @return {boolean}
+   *
+   * @private
+   */
+  private _isResponseDateFresh(cachedResponse: Response): boolean {
+    if (!this._maxAgeSeconds) {
+      // We aren't expiring by age, so return true, it's fresh
+      return true;
+    }
+
+    // Check if the 'date' header will suffice a quick expiration check.
+    // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for
+    // discussion.
+    const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);
+    if (dateHeaderTimestamp === null) {
+      // Unable to parse date, so assume it's fresh.
+      return true;
+    }
+
+    // If we have a valid headerTime, then our response is fresh iff the
+    // headerTime plus maxAgeSeconds is greater than the current time.
+    const now = Date.now();
+    return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;
+  }
+
+  /**
+   * This method will extract the data header and parse it into a useful
+   * value.
+   *
+   * @param {Response} cachedResponse
+   * @return {number|null}
+   *
+   * @private
+   */
+  private _getDateHeaderTimestamp(cachedResponse: Response): number | null {
+    if (!cachedResponse.headers.has('date')) {
+      return null;
+    }
+
+    const dateHeader = cachedResponse.headers.get('date');
+    const parsedDate = new Date(dateHeader!);
+    const headerTime = parsedDate.getTime();
+
+    // If the Date header was invalid for some reason, parsedDate.getTime()
+    // will return NaN.
+    if (isNaN(headerTime)) {
+      return null;
+    }
+
+    return headerTime;
+  }
+
+  /**
+   * A "lifecycle" callback that will be triggered automatically by the
+   * `workbox-strategies` handlers when an entry is added to a cache.
+   *
+   * @param {Object} options
+   * @param {string} options.cacheName Name of the cache that was updated.
+   * @param {string} options.request The Request for the cached entry.
+   *
+   * @private
+   */
+  cacheDidUpdate: WorkboxPlugin['cacheDidUpdate'] = async ({
+    cacheName,
+    request,
+  }) => {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(cacheName, 'string', {
+        moduleName: 'workbox-expiration',
+        className: 'Plugin',
+        funcName: 'cacheDidUpdate',
+        paramName: 'cacheName',
+      });
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-expiration',
+        className: 'Plugin',
+        funcName: 'cacheDidUpdate',
+        paramName: 'request',
+      });
+    }
+
+    const cacheExpiration = this._getCacheExpiration(cacheName);
+    await cacheExpiration.updateTimestamp(request.url);
+    await cacheExpiration.expireEntries();
+  };
+
+  /**
+   * This is a helper method that performs two operations:
+   *
+   * - Deletes *all* the underlying Cache instances associated with this plugin
+   * instance, by calling caches.delete() on your behalf.
+   * - Deletes the metadata from IndexedDB used to keep track of expiration
+   * details for each Cache instance.
+   *
+   * When using cache expiration, calling this method is preferable to calling
+   * `caches.delete()` directly, since this will ensure that the IndexedDB
+   * metadata is also cleanly removed and open IndexedDB instances are deleted.
+   *
+   * Note that if you're *not* using cache expiration for a given cache, calling
+   * `caches.delete()` and passing in the cache's name should be sufficient.
+   * There is no Workbox-specific method needed for cleanup in that case.
+   */
+  async deleteCacheAndMetadata(): Promise {
+    // Do this one at a time instead of all at once via `Promise.all()` to
+    // reduce the chance of inconsistency if a promise rejects.
+    for (const [cacheName, cacheExpiration] of this._cacheExpirations) {
+      await self.caches.delete(cacheName);
+      await cacheExpiration.delete();
+    }
+
+    // Reset this._cacheExpirations to its initial state.
+    this._cacheExpirations = new Map();
+  }
+}
+
+export {ExpirationPlugin};
diff --git a/tools/ui/node_modules/workbox-expiration/src/_version.ts b/tools/ui/node_modules/workbox-expiration/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..309c0f9e2eec964a924527ff1375e9bb791da716
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:expiration:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-expiration/src/index.ts b/tools/ui/node_modules/workbox-expiration/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..398b5106d37e2d8dcbb92a8d3f918179b511c446
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/src/index.ts
@@ -0,0 +1,18 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {CacheExpiration} from './CacheExpiration.js';
+import {ExpirationPlugin, ExpirationPluginOptions} from './ExpirationPlugin.js';
+
+import './_version.js';
+
+/**
+ * @module workbox-expiration
+ */
+
+export {CacheExpiration, ExpirationPlugin, ExpirationPluginOptions};
diff --git a/tools/ui/node_modules/workbox-expiration/src/models/CacheTimestampsModel.ts b/tools/ui/node_modules/workbox-expiration/src/models/CacheTimestampsModel.ts
new file mode 100644
index 0000000000000000000000000000000000000000..44229258baac34e8859175a3f44119aa60e3ec0c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/src/models/CacheTimestampsModel.ts
@@ -0,0 +1,224 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {openDB, DBSchema, IDBPDatabase, deleteDB} from 'idb';
+import '../_version.js';
+
+const DB_NAME = 'workbox-expiration';
+const CACHE_OBJECT_STORE = 'cache-entries';
+
+const normalizeURL = (unNormalizedUrl: string) => {
+  const url = new URL(unNormalizedUrl, location.href);
+  url.hash = '';
+
+  return url.href;
+};
+
+interface CacheTimestampsModelEntry {
+  id: string;
+  cacheName: string;
+  url: string;
+  timestamp: number;
+}
+
+interface CacheDbSchema extends DBSchema {
+  'cache-entries': {
+    key: string;
+    value: CacheTimestampsModelEntry;
+    indexes: {cacheName: string; timestamp: number};
+  };
+}
+
+/**
+ * Returns the timestamp model.
+ *
+ * @private
+ */
+class CacheTimestampsModel {
+  private readonly _cacheName: string;
+  private _db: IDBPDatabase | null = null;
+
+  /**
+   *
+   * @param {string} cacheName
+   *
+   * @private
+   */
+  constructor(cacheName: string) {
+    this._cacheName = cacheName;
+  }
+
+  /**
+   * Performs an upgrade of indexedDB.
+   *
+   * @param {IDBPDatabase} db
+   *
+   * @private
+   */
+  private _upgradeDb(db: IDBPDatabase) {
+    // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we
+    // have to use the `id` keyPath here and create our own values (a
+    // concatenation of `url + cacheName`) instead of simply using
+    // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.
+    const objStore = db.createObjectStore(CACHE_OBJECT_STORE, {keyPath: 'id'});
+
+    // TODO(philipwalton): once we don't have to support EdgeHTML, we can
+    // create a single index with the keyPath `['cacheName', 'timestamp']`
+    // instead of doing both these indexes.
+    objStore.createIndex('cacheName', 'cacheName', {unique: false});
+    objStore.createIndex('timestamp', 'timestamp', {unique: false});
+  }
+
+  /**
+   * Performs an upgrade of indexedDB and deletes deprecated DBs.
+   *
+   * @param {IDBPDatabase} db
+   *
+   * @private
+   */
+  private _upgradeDbAndDeleteOldDbs(db: IDBPDatabase) {
+    this._upgradeDb(db);
+    if (this._cacheName) {
+      void deleteDB(this._cacheName);
+    }
+  }
+
+  /**
+   * @param {string} url
+   * @param {number} timestamp
+   *
+   * @private
+   */
+  async setTimestamp(url: string, timestamp: number): Promise {
+    url = normalizeURL(url);
+
+    const entry: CacheTimestampsModelEntry = {
+      url,
+      timestamp,
+      cacheName: this._cacheName,
+      // Creating an ID from the URL and cache name won't be necessary once
+      // Edge switches to Chromium and all browsers we support work with
+      // array keyPaths.
+      id: this._getId(url),
+    };
+    const db = await this.getDb();
+    const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {
+      durability: 'relaxed',
+    });
+    await tx.store.put(entry);
+    await tx.done;
+  }
+
+  /**
+   * Returns the timestamp stored for a given URL.
+   *
+   * @param {string} url
+   * @return {number | undefined}
+   *
+   * @private
+   */
+  async getTimestamp(url: string): Promise {
+    const db = await this.getDb();
+    const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));
+    return entry?.timestamp;
+  }
+
+  /**
+   * Iterates through all the entries in the object store (from newest to
+   * oldest) and removes entries once either `maxCount` is reached or the
+   * entry's timestamp is less than `minTimestamp`.
+   *
+   * @param {number} minTimestamp
+   * @param {number} maxCount
+   * @return {Array}
+   *
+   * @private
+   */
+  async expireEntries(
+    minTimestamp: number,
+    maxCount?: number,
+  ): Promise {
+    const db = await this.getDb();
+    let cursor = await db
+      .transaction(CACHE_OBJECT_STORE)
+      .store.index('timestamp')
+      .openCursor(null, 'prev');
+    const entriesToDelete: CacheTimestampsModelEntry[] = [];
+    let entriesNotDeletedCount = 0;
+    while (cursor) {
+      const result = cursor.value;
+      // TODO(philipwalton): once we can use a multi-key index, we
+      // won't have to check `cacheName` here.
+      if (result.cacheName === this._cacheName) {
+        // Delete an entry if it's older than the max age or
+        // if we already have the max number allowed.
+        if (
+          (minTimestamp && result.timestamp < minTimestamp) ||
+          (maxCount && entriesNotDeletedCount >= maxCount)
+        ) {
+          // TODO(philipwalton): we should be able to delete the
+          // entry right here, but doing so causes an iteration
+          // bug in Safari stable (fixed in TP). Instead we can
+          // store the keys of the entries to delete, and then
+          // delete the separate transactions.
+          // https://github.com/GoogleChrome/workbox/issues/1978
+          // cursor.delete();
+
+          // We only need to return the URL, not the whole entry.
+          entriesToDelete.push(cursor.value);
+        } else {
+          entriesNotDeletedCount++;
+        }
+      }
+      cursor = await cursor.continue();
+    }
+
+    // TODO(philipwalton): once the Safari bug in the following issue is fixed,
+    // we should be able to remove this loop and do the entry deletion in the
+    // cursor loop above:
+    // https://github.com/GoogleChrome/workbox/issues/1978
+    const urlsDeleted: string[] = [];
+    for (const entry of entriesToDelete) {
+      await db.delete(CACHE_OBJECT_STORE, entry.id);
+      urlsDeleted.push(entry.url);
+    }
+
+    return urlsDeleted;
+  }
+
+  /**
+   * Takes a URL and returns an ID that will be unique in the object store.
+   *
+   * @param {string} url
+   * @return {string}
+   *
+   * @private
+   */
+  private _getId(url: string): string {
+    // Creating an ID from the URL and cache name won't be necessary once
+    // Edge switches to Chromium and all browsers we support work with
+    // array keyPaths.
+    return this._cacheName + '|' + normalizeURL(url);
+  }
+
+  /**
+   * Returns an open connection to the database.
+   *
+   * @private
+   */
+  private async getDb() {
+    if (!this._db) {
+      this._db = await openDB(DB_NAME, 1, {
+        upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),
+      });
+    }
+    return this._db;
+  }
+}
+
+export {CacheTimestampsModel};
diff --git a/tools/ui/node_modules/workbox-expiration/tsconfig.json b/tools/ui/node_modules/workbox-expiration/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..3bb2772b586c4d0ceee3d014e64dba7aafbdd570
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/tsconfig.json
@@ -0,0 +1,11 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [{"path": "../workbox-core/"}]
+}
diff --git a/tools/ui/node_modules/workbox-expiration/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-expiration/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..2acad118131b8f847255e427896c1296ac3094a7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-expiration/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/dontwaitfor.d.ts","../workbox-core/_private/logger.d.ts","../workbox-core/_private/workboxerror.d.ts","./node_modules/idb/build/wrap-idb-value.d.ts","./node_modules/idb/build/entry.d.ts","./node_modules/idb/build/database-extras.d.ts","./node_modules/idb/build/index.d.ts","./src/_version.ts","./src/models/cachetimestampsmodel.ts","./src/cacheexpiration.ts","../workbox-core/_private/cachenames.d.ts","../workbox-core/_private/getfriendlyurl.d.ts","../workbox-core/registerquotaerrorcallback.d.ts","./src/expirationplugin.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca","365f3bd8994af50572b562a002e0fa2e72e74f54ed996e2444ea3df562678f50",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},"0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5","0a891b4678e2705451b79b6587efa5911288492815e1a2b46da880c06979f4ed","c488c9ba0e79f3d0f7af33ab64c9d3e736b842ce3e8ee23991830ae836397947","8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","976b7d4fa6b154ae080c22f5249da4fa5c5bfb7584abf0c06279e2814bf4660a",{"version":"3b3ff2b048f41b68a403048e396ca514e461fa5985a3d3980a00ea20f108a056","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"22ecd29bfa13b4670ae1ed9e98393b825b5c1467196bea53f01fd944523b0326","signature":"b89e02b345ec91f05835ad80e06c134004a49b95478e46554efa65fc3b121bf2"},{"version":"24f9bb72f72386f2c28970bbd9ad1263da343daf5cc4e59010efe85a127239ea","signature":"9c99c03f0fac6ff6e5db084546c963477dc79d4731c7f9a074f6064e97765d83"},"dda5c129fa8b8e72bee6609a4fc48148f58f2f656d70a395d3122431193569f9","9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff","556061e3c5bf3a5786b46ad49fbbdc081f1f14b5c0ee0f7f0936abef2c55ae14",{"version":"ec728cc465de921db42419b857e443930063c403f57a8d56fbf4cb1aef384227","signature":"3199d552cbbbac5a3c6e1499c09acf672ae8c8c8687cf2a3dbfa7c8902cc7054"},{"version":"e8d6e2633b9007bf60860136e5ed765ae7d29cfe65e641d091665586b8871c43","signature":"579049e1128b21660b6064731b09789ac146c25dddd3b2269ed3433e9bd33f7a"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[79,121],[61,79,121],[61,62,63,64,65,79,121],[61,63,79,121],[70,72,79,121],[69,70,71,79,121],[79,121,134,170],[79,121,133,170,172],[79,121,195],[79,121,180],[79,121,184,185,186],[79,121,183],[79,121,185],[79,121,175,181,182,187,190,192,193,194],[79,121,182,188,189,195],[79,121,188,191],[79,121,182,183,188,195],[79,121,182,195],[79,121,176,177,178,179],[79,118,121],[79,120,121],[79,121,126,155],[79,121,122,127,133,134,141,152,163],[79,121,122,123,133,141],[74,75,76,79,121],[79,121,124,164],[79,121,125,126,134,142],[79,121,126,152,160],[79,121,127,129,133,141],[79,120,121,128],[79,121,129,130],[79,121,133],[79,121,131,133],[79,120,121,133],[79,121,133,134,135,152,163],[79,121,133,134,135,148,152,155],[79,116,121,168],[79,121,129,133,136,141,152,163],[79,121,133,134,136,137,141,152,160,163],[79,121,136,138,152,160,163],[79,121,133,139],[79,121,140,163,168],[79,121,129,133,141,152],[79,121,142],[79,121,143],[79,120,121,144],[79,118,119,120,121,122,123,124,125,126,127,128,129,130,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[79,121,146],[79,121,147],[79,121,133,148,149],[79,121,148,150,164,166],[79,121,133,152,153,155],[79,121,154,155],[79,121,152,153],[79,121,155],[79,121,156],[79,118,121,152],[79,121,133,158,159],[79,121,158,159],[79,121,126,141,152,160],[79,121,161],[121],[77,78,79,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[79,121,141,162],[79,121,136,147,163],[79,121,126,164],[79,121,152,165],[79,121,140,166],[79,121,167],[79,121,126,133,135,144,152,163,166,168],[79,121,152,169],[79,121,201,240],[79,121,201,225,240],[79,121,240],[79,121,201],[79,121,201,226,240],[79,121,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239],[79,121,226,240],[79,121,244],[79,121,170,247,248,249,250,251,252,253,254,255,256,257],[79,121,246,247,256],[79,121,247,256],[79,121,241,246,247,256],[79,121,246,247,248,249,250,251,252,253,254,255,257],[79,121,247],[79,121,126,246,256],[79,88,92,121,163],[79,88,121,152,163],[79,83,121],[79,85,88,121,160,163],[79,121,141,160],[79,121,170],[79,83,121,170],[79,85,88,121,141,163],[79,80,81,84,87,121,133,152,163],[79,88,95,121],[79,80,86,121],[79,88,109,110,121],[79,84,88,121,155,163,170],[79,109,121,170],[79,82,83,121,170],[79,88,121],[79,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,121],[79,88,103,121],[79,88,95,96,121],[79,86,88,96,97,121],[79,87,121],[79,80,83,88,121],[79,88,92,96,97,121],[79,92,121],[79,86,88,91,121,163],[79,80,85,88,95,121],[79,121,152],[79,83,88,109,121,168,170],[44,79,121],[49,79,121],[50,51,79,121],[50,79,121],[45,46,47,48,54,79,121],[44,45,46,47,48,55,56,57,58,79,121],[55,59,79,121],[52,79,121],[44],[55,59]],"referencedMap":[[42,1],[63,2],[61,1],[66,3],[62,2],[67,1],[64,4],[65,2],[68,1],[73,5],[69,1],[72,6],[70,1],[171,7],[173,8],[174,1],[71,1],[175,1],[196,9],[181,10],[187,11],[185,1],[184,12],[186,13],[195,14],[190,15],[192,16],[193,17],[194,18],[188,1],[189,18],[191,18],[183,18],[182,1],[177,1],[176,1],[179,10],[180,19],[178,10],[172,1],[197,1],[118,20],[119,20],[120,21],[121,22],[122,23],[123,24],[74,1],[77,25],[75,1],[76,1],[124,26],[125,27],[126,28],[127,29],[128,30],[129,31],[130,31],[132,32],[131,33],[133,34],[134,35],[135,36],[117,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,50],[150,51],[151,1],[152,52],[154,53],[153,54],[155,55],[156,56],[157,57],[158,58],[159,59],[160,60],[161,61],[79,62],[78,1],[170,63],[162,64],[163,65],[164,66],[165,67],[166,68],[167,69],[168,70],[169,71],[198,1],[199,1],[200,1],[225,72],[226,73],[201,74],[204,74],[223,72],[224,72],[214,72],[213,75],[211,72],[206,72],[219,72],[217,72],[221,72],[205,72],[218,72],[222,72],[207,72],[208,72],[220,72],[202,72],[209,72],[210,72],[212,72],[216,72],[227,76],[215,72],[203,72],[240,77],[239,1],[234,76],[236,78],[235,76],[228,76],[229,76],[231,76],[233,76],[237,78],[238,78],[230,78],[232,78],[241,1],[242,1],[243,1],[245,79],[244,1],[258,80],[257,81],[248,82],[249,83],[256,84],[250,83],[251,82],[252,82],[253,82],[254,85],[247,86],[255,81],[246,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[95,87],[105,88],[94,87],[115,89],[86,90],[85,91],[114,92],[108,93],[113,94],[88,95],[102,96],[87,97],[111,98],[83,99],[82,92],[112,100],[84,101],[89,102],[90,1],[93,102],[80,1],[116,103],[106,104],[97,105],[98,106],[100,107],[96,108],[99,109],[109,92],[91,110],[92,111],[101,112],[81,113],[104,104],[103,102],[107,1],[110,114],[45,115],[56,1],[46,1],[57,1],[47,1],[48,115],[43,1],[58,1],[44,1],[51,1],[50,116],[52,117],[49,118],[53,1],[55,119],[59,120],[60,121],[54,122]],"exportedModulesMap":[[42,1],[63,2],[61,1],[66,3],[62,2],[67,1],[64,4],[65,2],[68,1],[73,5],[69,1],[72,6],[70,1],[171,7],[173,8],[174,1],[71,1],[175,1],[196,9],[181,10],[187,11],[185,1],[184,12],[186,13],[195,14],[190,15],[192,16],[193,17],[194,18],[188,1],[189,18],[191,18],[183,18],[182,1],[177,1],[176,1],[179,10],[180,19],[178,10],[172,1],[197,1],[118,20],[119,20],[120,21],[121,22],[122,23],[123,24],[74,1],[77,25],[75,1],[76,1],[124,26],[125,27],[126,28],[127,29],[128,30],[129,31],[130,31],[132,32],[131,33],[133,34],[134,35],[135,36],[117,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,50],[150,51],[151,1],[152,52],[154,53],[153,54],[155,55],[156,56],[157,57],[158,58],[159,59],[160,60],[161,61],[79,62],[78,1],[170,63],[162,64],[163,65],[164,66],[165,67],[166,68],[167,69],[168,70],[169,71],[198,1],[199,1],[200,1],[225,72],[226,73],[201,74],[204,74],[223,72],[224,72],[214,72],[213,75],[211,72],[206,72],[219,72],[217,72],[221,72],[205,72],[218,72],[222,72],[207,72],[208,72],[220,72],[202,72],[209,72],[210,72],[212,72],[216,72],[227,76],[215,72],[203,72],[240,77],[239,1],[234,76],[236,78],[235,76],[228,76],[229,76],[231,76],[233,76],[237,78],[238,78],[230,78],[232,78],[241,1],[242,1],[243,1],[245,79],[244,1],[258,80],[257,81],[248,82],[249,83],[256,84],[250,83],[251,82],[252,82],[253,82],[254,85],[247,86],[255,81],[246,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[95,87],[105,88],[94,87],[115,89],[86,90],[85,91],[114,92],[108,93],[113,94],[88,95],[102,96],[87,97],[111,98],[83,99],[82,92],[112,100],[84,101],[89,102],[90,1],[93,102],[80,1],[116,103],[106,104],[97,105],[98,106],[100,107],[96,108],[99,109],[109,92],[91,110],[92,111],[101,112],[81,113],[104,104],[103,102],[107,1],[110,114],[45,115],[56,1],[46,1],[57,1],[47,1],[48,115],[43,1],[58,1],[44,1],[51,1],[50,116],[52,117],[49,118],[59,123],[60,124]],"semanticDiagnosticsPerFile":[42,63,61,66,62,67,64,65,68,73,69,72,70,171,173,174,71,175,196,181,187,185,184,186,195,190,192,193,194,188,189,191,183,182,177,176,179,180,178,172,197,118,119,120,121,122,123,74,77,75,76,124,125,126,127,128,129,130,132,131,133,134,135,117,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,79,78,170,162,163,164,165,166,167,168,169,198,199,200,225,226,201,204,223,224,214,213,211,206,219,217,221,205,218,222,207,208,220,202,209,210,212,216,227,215,203,240,239,234,236,235,228,229,231,233,237,238,230,232,241,242,243,245,244,258,257,248,249,256,250,251,252,253,254,247,255,246,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,95,105,94,115,86,85,114,108,113,88,102,87,111,83,82,112,84,89,90,93,80,116,106,97,98,100,96,99,109,91,92,101,81,104,103,107,110,45,56,46,57,47,48,43,58,44,51,50,52,49,53,55,59,60,54],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/LICENSE b/tools/ui/node_modules/workbox-google-analytics/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-google-analytics/README.md b/tools/ui/node_modules/workbox-google-analytics/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..3678fb2f6c292278d821f7dbe92df1c020b211fb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-google-analytics
diff --git a/tools/ui/node_modules/workbox-google-analytics/_version.d.ts b/tools/ui/node_modules/workbox-google-analytics/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-google-analytics/_version.js b/tools/ui/node_modules/workbox-google-analytics/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..efe1bbb494d386d4523b32c0c93e5515bb4c4719
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:google-analytics:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-google-analytics/_version.mjs b/tools/ui/node_modules/workbox-google-analytics/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..4d800b8449e0997a24c308ddc7f309a994737ea5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:google-analytics:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6160f29c5955d0f6d24dda87849e2098e2dc0fc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js
@@ -0,0 +1,210 @@
+this.workbox = this.workbox || {};
+this.workbox.googleAnalytics = (function (exports, BackgroundSyncPlugin_js, cacheNames_js, getFriendlyURL_js, logger_js, Route_js, Router_js, NetworkFirst_js, NetworkOnly_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:google-analytics:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const QUEUE_NAME = 'workbox-google-analytics';
+    const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes
+    const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com';
+    const GTM_HOST = 'www.googletagmanager.com';
+    const ANALYTICS_JS_PATH = '/analytics.js';
+    const GTAG_JS_PATH = '/gtag/js';
+    const GTM_JS_PATH = '/gtm.js';
+    // This RegExp matches all known Measurement Protocol single-hit collect
+    // endpoints. Most of the time the default path (/collect) is used, but
+    // occasionally an experimental endpoint is used when testing new features,
+    // (e.g. /r/collect or /j/collect)
+    const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Creates the requestWillDequeue callback to be used with the background
+     * sync plugin. The callback takes the failed request and adds the
+     * `qt` param based on the current time, as well as applies any other
+     * user-defined hit modifications.
+     *
+     * @param {Object} config See {@link workbox-google-analytics.initialize}.
+     * @return {Function} The requestWillDequeue callback function.
+     *
+     * @private
+     */
+    const createOnSyncCallback = config => {
+      return async ({
+        queue
+      }) => {
+        let entry;
+        while (entry = await queue.shiftRequest()) {
+          const {
+            request,
+            timestamp
+          } = entry;
+          const url = new URL(request.url);
+          try {
+            // Measurement protocol requests can set their payload parameters in
+            // either the URL query string (for GET requests) or the POST body.
+            const params = request.method === 'POST' ? new URLSearchParams(await request.clone().text()) : url.searchParams;
+            // Calculate the qt param, accounting for the fact that an existing
+            // qt param may be present and should be updated rather than replaced.
+            const originalHitTime = timestamp - (Number(params.get('qt')) || 0);
+            const queueTime = Date.now() - originalHitTime;
+            // Set the qt param prior to applying hitFilter or parameterOverrides.
+            params.set('qt', String(queueTime));
+            // Apply `parameterOverrides`, if set.
+            if (config.parameterOverrides) {
+              for (const param of Object.keys(config.parameterOverrides)) {
+                const value = config.parameterOverrides[param];
+                params.set(param, value);
+              }
+            }
+            // Apply `hitFilter`, if set.
+            if (typeof config.hitFilter === 'function') {
+              config.hitFilter.call(null, params);
+            }
+            // Retry the fetch. Ignore URL search params from the URL as they're
+            // now in the post body.
+            await fetch(new Request(url.origin + url.pathname, {
+              body: params.toString(),
+              method: 'POST',
+              mode: 'cors',
+              credentials: 'omit',
+              headers: {
+                'Content-Type': 'text/plain'
+              }
+            }));
+            if ("dev" !== 'production') {
+              logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}' ` + `has been replayed`);
+            }
+          } catch (err) {
+            await queue.unshiftRequest(entry);
+            {
+              logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}' ` + `failed to replay, putting it back in the queue.`);
+            }
+            throw err;
+          }
+        }
+        {
+          logger_js.logger.log(`All Google Analytics request successfully replayed; ` + `the queue is now empty!`);
+        }
+      };
+    };
+    /**
+     * Creates GET and POST routes to catch failed Measurement Protocol hits.
+     *
+     * @param {BackgroundSyncPlugin} bgSyncPlugin
+     * @return {Array} The created routes.
+     *
+     * @private
+     */
+    const createCollectRoutes = bgSyncPlugin => {
+      const match = ({
+        url
+      }) => url.hostname === GOOGLE_ANALYTICS_HOST && COLLECT_PATHS_REGEX.test(url.pathname);
+      const handler = new NetworkOnly_js.NetworkOnly({
+        plugins: [bgSyncPlugin]
+      });
+      return [new Route_js.Route(match, handler, 'GET'), new Route_js.Route(match, handler, 'POST')];
+    };
+    /**
+     * Creates a route with a network first strategy for the analytics.js script.
+     *
+     * @param {string} cacheName
+     * @return {Route} The created route.
+     *
+     * @private
+     */
+    const createAnalyticsJsRoute = cacheName => {
+      const match = ({
+        url
+      }) => url.hostname === GOOGLE_ANALYTICS_HOST && url.pathname === ANALYTICS_JS_PATH;
+      const handler = new NetworkFirst_js.NetworkFirst({
+        cacheName
+      });
+      return new Route_js.Route(match, handler, 'GET');
+    };
+    /**
+     * Creates a route with a network first strategy for the gtag.js script.
+     *
+     * @param {string} cacheName
+     * @return {Route} The created route.
+     *
+     * @private
+     */
+    const createGtagJsRoute = cacheName => {
+      const match = ({
+        url
+      }) => url.hostname === GTM_HOST && url.pathname === GTAG_JS_PATH;
+      const handler = new NetworkFirst_js.NetworkFirst({
+        cacheName
+      });
+      return new Route_js.Route(match, handler, 'GET');
+    };
+    /**
+     * Creates a route with a network first strategy for the gtm.js script.
+     *
+     * @param {string} cacheName
+     * @return {Route} The created route.
+     *
+     * @private
+     */
+    const createGtmJsRoute = cacheName => {
+      const match = ({
+        url
+      }) => url.hostname === GTM_HOST && url.pathname === GTM_JS_PATH;
+      const handler = new NetworkFirst_js.NetworkFirst({
+        cacheName
+      });
+      return new Route_js.Route(match, handler, 'GET');
+    };
+    /**
+     * @param {Object=} [options]
+     * @param {Object} [options.cacheName] The cache name to store and retrieve
+     *     analytics.js. Defaults to the cache names provided by `workbox-core`.
+     * @param {Object} [options.parameterOverrides]
+     *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
+     *     expressed as key/value pairs, to be added to replayed Google Analytics
+     *     requests. This can be used to, e.g., set a custom dimension indicating
+     *     that the request was replayed.
+     * @param {Function} [options.hitFilter] A function that allows you to modify
+     *     the hit parameters prior to replaying
+     *     the hit. The function is invoked with the original hit's URLSearchParams
+     *     object as its only argument.
+     *
+     * @memberof workbox-google-analytics
+     */
+    const initialize = (options = {}) => {
+      const cacheName = cacheNames_js.cacheNames.getGoogleAnalyticsName(options.cacheName);
+      const bgSyncPlugin = new BackgroundSyncPlugin_js.BackgroundSyncPlugin(QUEUE_NAME, {
+        maxRetentionTime: MAX_RETENTION_TIME,
+        onSync: createOnSyncCallback(options)
+      });
+      const routes = [createGtmJsRoute(cacheName), createAnalyticsJsRoute(cacheName), createGtagJsRoute(cacheName), ...createCollectRoutes(bgSyncPlugin)];
+      const router = new Router_js.Router();
+      for (const route of routes) {
+        router.registerRoute(route);
+      }
+      router.addFetchListener();
+    };
+
+    exports.initialize = initialize;
+
+    return exports;
+
+})({}, workbox.backgroundSync, workbox.core._private, workbox.core._private, workbox.core._private, workbox.routing, workbox.routing, workbox.strategies, workbox.strategies);
+//# sourceMappingURL=workbox-offline-ga.dev.js.map
diff --git a/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js.map b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..d2bc783b78da2d4c491ee04408c06377e8c4d06a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-offline-ga.dev.js","sources":["../_version.js","../utils/constants.js","../initialize.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:google-analytics:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const QUEUE_NAME = 'workbox-google-analytics';\nexport const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes\nexport const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com';\nexport const GTM_HOST = 'www.googletagmanager.com';\nexport const ANALYTICS_JS_PATH = '/analytics.js';\nexport const GTAG_JS_PATH = '/gtag/js';\nexport const GTM_JS_PATH = '/gtm.js';\nexport const COLLECT_DEFAULT_PATH = '/collect';\n// This RegExp matches all known Measurement Protocol single-hit collect\n// endpoints. Most of the time the default path (/collect) is used, but\n// occasionally an experimental endpoint is used when testing new features,\n// (e.g. /r/collect or /j/collect)\nexport const COLLECT_PATHS_REGEX = /^\\/(\\w+\\/)?collect/;\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { BackgroundSyncPlugin } from 'workbox-background-sync/BackgroundSyncPlugin.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { Router } from 'workbox-routing/Router.js';\nimport { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';\nimport { NetworkOnly } from 'workbox-strategies/NetworkOnly.js';\nimport { QUEUE_NAME, MAX_RETENTION_TIME, GOOGLE_ANALYTICS_HOST, GTM_HOST, ANALYTICS_JS_PATH, GTAG_JS_PATH, GTM_JS_PATH, COLLECT_PATHS_REGEX, } from './utils/constants.js';\nimport './_version.js';\n/**\n * Creates the requestWillDequeue callback to be used with the background\n * sync plugin. The callback takes the failed request and adds the\n * `qt` param based on the current time, as well as applies any other\n * user-defined hit modifications.\n *\n * @param {Object} config See {@link workbox-google-analytics.initialize}.\n * @return {Function} The requestWillDequeue callback function.\n *\n * @private\n */\nconst createOnSyncCallback = (config) => {\n    return async ({ queue }) => {\n        let entry;\n        while ((entry = await queue.shiftRequest())) {\n            const { request, timestamp } = entry;\n            const url = new URL(request.url);\n            try {\n                // Measurement protocol requests can set their payload parameters in\n                // either the URL query string (for GET requests) or the POST body.\n                const params = request.method === 'POST'\n                    ? new URLSearchParams(await request.clone().text())\n                    : url.searchParams;\n                // Calculate the qt param, accounting for the fact that an existing\n                // qt param may be present and should be updated rather than replaced.\n                const originalHitTime = timestamp - (Number(params.get('qt')) || 0);\n                const queueTime = Date.now() - originalHitTime;\n                // Set the qt param prior to applying hitFilter or parameterOverrides.\n                params.set('qt', String(queueTime));\n                // Apply `parameterOverrides`, if set.\n                if (config.parameterOverrides) {\n                    for (const param of Object.keys(config.parameterOverrides)) {\n                        const value = config.parameterOverrides[param];\n                        params.set(param, value);\n                    }\n                }\n                // Apply `hitFilter`, if set.\n                if (typeof config.hitFilter === 'function') {\n                    config.hitFilter.call(null, params);\n                }\n                // Retry the fetch. Ignore URL search params from the URL as they're\n                // now in the post body.\n                await fetch(new Request(url.origin + url.pathname, {\n                    body: params.toString(),\n                    method: 'POST',\n                    mode: 'cors',\n                    credentials: 'omit',\n                    headers: { 'Content-Type': 'text/plain' },\n                }));\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` + `has been replayed`);\n                }\n            }\n            catch (err) {\n                await queue.unshiftRequest(entry);\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` +\n                        `failed to replay, putting it back in the queue.`);\n                }\n                throw err;\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`All Google Analytics request successfully replayed; ` +\n                `the queue is now empty!`);\n        }\n    };\n};\n/**\n * Creates GET and POST routes to catch failed Measurement Protocol hits.\n *\n * @param {BackgroundSyncPlugin} bgSyncPlugin\n * @return {Array} The created routes.\n *\n * @private\n */\nconst createCollectRoutes = (bgSyncPlugin) => {\n    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&\n        COLLECT_PATHS_REGEX.test(url.pathname);\n    const handler = new NetworkOnly({\n        plugins: [bgSyncPlugin],\n    });\n    return [new Route(match, handler, 'GET'), new Route(match, handler, 'POST')];\n};\n/**\n * Creates a route with a network first strategy for the analytics.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createAnalyticsJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&\n        url.pathname === ANALYTICS_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * Creates a route with a network first strategy for the gtag.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createGtagJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTAG_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * Creates a route with a network first strategy for the gtm.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createGtmJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTM_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * @param {Object=} [options]\n * @param {Object} [options.cacheName] The cache name to store and retrieve\n *     analytics.js. Defaults to the cache names provided by `workbox-core`.\n * @param {Object} [options.parameterOverrides]\n *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),\n *     expressed as key/value pairs, to be added to replayed Google Analytics\n *     requests. This can be used to, e.g., set a custom dimension indicating\n *     that the request was replayed.\n * @param {Function} [options.hitFilter] A function that allows you to modify\n *     the hit parameters prior to replaying\n *     the hit. The function is invoked with the original hit's URLSearchParams\n *     object as its only argument.\n *\n * @memberof workbox-google-analytics\n */\nconst initialize = (options = {}) => {\n    const cacheName = cacheNames.getGoogleAnalyticsName(options.cacheName);\n    const bgSyncPlugin = new BackgroundSyncPlugin(QUEUE_NAME, {\n        maxRetentionTime: MAX_RETENTION_TIME,\n        onSync: createOnSyncCallback(options),\n    });\n    const routes = [\n        createGtmJsRoute(cacheName),\n        createAnalyticsJsRoute(cacheName),\n        createGtagJsRoute(cacheName),\n        ...createCollectRoutes(bgSyncPlugin),\n    ];\n    const router = new Router();\n    for (const route of routes) {\n        router.registerRoute(route);\n    }\n    router.addFetchListener();\n};\nexport { initialize };\n"],"names":["self","_","e","QUEUE_NAME","MAX_RETENTION_TIME","GOOGLE_ANALYTICS_HOST","GTM_HOST","ANALYTICS_JS_PATH","GTAG_JS_PATH","GTM_JS_PATH","COLLECT_PATHS_REGEX","createOnSyncCallback","config","queue","entry","shiftRequest","request","timestamp","url","URL","params","method","URLSearchParams","clone","text","searchParams","originalHitTime","Number","get","queueTime","Date","now","set","String","parameterOverrides","param","Object","keys","value","hitFilter","call","fetch","Request","origin","pathname","body","toString","mode","credentials","headers","process","logger","log","getFriendlyURL","href","err","unshiftRequest","createCollectRoutes","bgSyncPlugin","match","hostname","test","handler","NetworkOnly","plugins","Route","createAnalyticsJsRoute","cacheName","NetworkFirst","createGtagJsRoute","createGtmJsRoute","initialize","options","cacheNames","getGoogleAnalyticsName","BackgroundSyncPlugin","maxRetentionTime","onSync","routes","router","Router","route","registerRoute","addFetchListener"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,gCAAgC,CAAC,IAAIC,CAAC,EAAE;IACjD,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAEO,MAAMC,UAAU,GAAG,0BAA0B;IAC7C,MAAMC,kBAAkB,GAAG,EAAE,GAAG,EAAE,CAAC;IACnC,MAAMC,qBAAqB,GAAG,0BAA0B;IACxD,MAAMC,QAAQ,GAAG,0BAA0B;IAC3C,MAAMC,iBAAiB,GAAG,eAAe;IACzC,MAAMC,YAAY,GAAG,UAAU;IAC/B,MAAMC,WAAW,GAAG,SAAS;IAEpC;IACA;IACA;IACA;IACO,MAAMC,mBAAmB,GAAG,oBAAoB;;ICpBvD;IACA;;IAEA;IACA;IACA;IACA;IAWA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,oBAAoB,GAAIC,MAAM,IAAK;IACrC,EAAA,OAAO,OAAO;IAAEC,IAAAA;IAAM,GAAC,KAAK;IACxB,IAAA,IAAIC,KAAK;QACT,OAAQA,KAAK,GAAG,MAAMD,KAAK,CAACE,YAAY,EAAE,EAAG;UACzC,MAAM;YAAEC,OAAO;IAAEC,QAAAA;IAAU,OAAC,GAAGH,KAAK;UACpC,MAAMI,GAAG,GAAG,IAAIC,GAAG,CAACH,OAAO,CAACE,GAAG,CAAC;UAChC,IAAI;IACA;IACA;YACA,MAAME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AS,GAAGM,wBAAU,CAACC,sBAAsB,CAACF,OAAO,CAACL,SAAS,CAAC;IACtE,EAAA,MAAMT,YAAY,GAAG,IAAIiB,4CAAoB,CAACxE,UAAU,EAAE;IACtDyE,IAAAA,gBAAgB,EAAExE,kBAAkB;QACpCyE,MAAM,EAAElE,oBAAoB,CAAC6D,OAAO;IACxC,GAAC,CAAC;MACF,MAAMM,MAAM,GAAG,CACXR,gBAAgB,CAACH,SAAS,CAAC,EAC3BD,sBAAsB,CAACC,SAAS,CAAC,EACjCE,iBAAiB,CAACF,SAAS,CAAC,EAC5B,GAAGV,mBAAmB,CAACC,YAAY,CAAC,CACvC;IACD,EAAA,MAAMqB,MAAM,GAAG,IAAIC,gBAAM,EAAE;IAC3B,EAAA,KAAK,MAAMC,KAAK,IAAIH,MAAM,EAAE;IACxBC,IAAAA,MAAM,CAACG,aAAa,CAACD,KAAK,CAAC;IAC/B,EAAA;MACAF,MAAM,CAACI,gBAAgB,EAAE;IAC7B;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c0a4d8c6d63a80e670a7adfc4c7847ec947c1e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,r,c,a,w,s){"use strict";try{self["workbox:google-analytics:7.4.0"]&&_()}catch(t){}const i="www.google-analytics.com",l="www.googletagmanager.com",u=/^\/(\w+\/)?collect/,m=t=>{const e=({url:t})=>t.hostname===i&&u.test(t.pathname),o=new s.NetworkOnly({plugins:[t]});return[new c.Route(e,o,"GET"),new c.Route(e,o,"POST")]},g=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===i&&"/analytics.js"===t.pathname),e,"GET")},h=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtag/js"===t.pathname),e,"GET")},b=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtm.js"===t.pathname),e,"GET")};return t.initialize=(t={})=>{const n=o.cacheNames.getGoogleAnalyticsName(t.cacheName),r=new e.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(c=t,async({queue:t})=>{let e;for(;e=await t.shiftRequest();){const{request:o,timestamp:n}=e,r=new URL(o.url);try{const t="POST"===o.method?new URLSearchParams(await o.clone().text()):r.searchParams,e=n-(Number(t.get("qt"))||0),a=Date.now()-e;if(t.set("qt",String(a)),c.parameterOverrides)for(const e of Object.keys(c.parameterOverrides)){const o=c.parameterOverrides[e];t.set(e,o)}"function"==typeof c.hitFilter&&c.hitFilter.call(null,t),await fetch(new Request(r.origin+r.pathname,{body:t.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(o){throw await t.unshiftRequest(e),o}}})});var c;const w=[b(n),g(n),h(n),...m(r)],s=new a.Router;for(const t of w)s.registerRoute(t);s.addFetchListener()},t}({},workbox.backgroundSync,workbox.core._private,workbox.core._private,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies);
+//# sourceMappingURL=workbox-offline-ga.prod.js.map
diff --git a/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js.map b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a97567b2433d00fbf71bf416faf69b68632d63b2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/build/workbox-offline-ga.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-offline-ga.prod.js","sources":["../_version.js","../utils/constants.js","../initialize.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:google-analytics:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const QUEUE_NAME = 'workbox-google-analytics';\nexport const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes\nexport const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com';\nexport const GTM_HOST = 'www.googletagmanager.com';\nexport const ANALYTICS_JS_PATH = '/analytics.js';\nexport const GTAG_JS_PATH = '/gtag/js';\nexport const GTM_JS_PATH = '/gtm.js';\nexport const COLLECT_DEFAULT_PATH = '/collect';\n// This RegExp matches all known Measurement Protocol single-hit collect\n// endpoints. Most of the time the default path (/collect) is used, but\n// occasionally an experimental endpoint is used when testing new features,\n// (e.g. /r/collect or /j/collect)\nexport const COLLECT_PATHS_REGEX = /^\\/(\\w+\\/)?collect/;\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { BackgroundSyncPlugin } from 'workbox-background-sync/BackgroundSyncPlugin.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { Router } from 'workbox-routing/Router.js';\nimport { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';\nimport { NetworkOnly } from 'workbox-strategies/NetworkOnly.js';\nimport { QUEUE_NAME, MAX_RETENTION_TIME, GOOGLE_ANALYTICS_HOST, GTM_HOST, ANALYTICS_JS_PATH, GTAG_JS_PATH, GTM_JS_PATH, COLLECT_PATHS_REGEX, } from './utils/constants.js';\nimport './_version.js';\n/**\n * Creates the requestWillDequeue callback to be used with the background\n * sync plugin. The callback takes the failed request and adds the\n * `qt` param based on the current time, as well as applies any other\n * user-defined hit modifications.\n *\n * @param {Object} config See {@link workbox-google-analytics.initialize}.\n * @return {Function} The requestWillDequeue callback function.\n *\n * @private\n */\nconst createOnSyncCallback = (config) => {\n    return async ({ queue }) => {\n        let entry;\n        while ((entry = await queue.shiftRequest())) {\n            const { request, timestamp } = entry;\n            const url = new URL(request.url);\n            try {\n                // Measurement protocol requests can set their payload parameters in\n                // either the URL query string (for GET requests) or the POST body.\n                const params = request.method === 'POST'\n                    ? new URLSearchParams(await request.clone().text())\n                    : url.searchParams;\n                // Calculate the qt param, accounting for the fact that an existing\n                // qt param may be present and should be updated rather than replaced.\n                const originalHitTime = timestamp - (Number(params.get('qt')) || 0);\n                const queueTime = Date.now() - originalHitTime;\n                // Set the qt param prior to applying hitFilter or parameterOverrides.\n                params.set('qt', String(queueTime));\n                // Apply `parameterOverrides`, if set.\n                if (config.parameterOverrides) {\n                    for (const param of Object.keys(config.parameterOverrides)) {\n                        const value = config.parameterOverrides[param];\n                        params.set(param, value);\n                    }\n                }\n                // Apply `hitFilter`, if set.\n                if (typeof config.hitFilter === 'function') {\n                    config.hitFilter.call(null, params);\n                }\n                // Retry the fetch. Ignore URL search params from the URL as they're\n                // now in the post body.\n                await fetch(new Request(url.origin + url.pathname, {\n                    body: params.toString(),\n                    method: 'POST',\n                    mode: 'cors',\n                    credentials: 'omit',\n                    headers: { 'Content-Type': 'text/plain' },\n                }));\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` + `has been replayed`);\n                }\n            }\n            catch (err) {\n                await queue.unshiftRequest(entry);\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` +\n                        `failed to replay, putting it back in the queue.`);\n                }\n                throw err;\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`All Google Analytics request successfully replayed; ` +\n                `the queue is now empty!`);\n        }\n    };\n};\n/**\n * Creates GET and POST routes to catch failed Measurement Protocol hits.\n *\n * @param {BackgroundSyncPlugin} bgSyncPlugin\n * @return {Array} The created routes.\n *\n * @private\n */\nconst createCollectRoutes = (bgSyncPlugin) => {\n    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&\n        COLLECT_PATHS_REGEX.test(url.pathname);\n    const handler = new NetworkOnly({\n        plugins: [bgSyncPlugin],\n    });\n    return [new Route(match, handler, 'GET'), new Route(match, handler, 'POST')];\n};\n/**\n * Creates a route with a network first strategy for the analytics.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createAnalyticsJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&\n        url.pathname === ANALYTICS_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * Creates a route with a network first strategy for the gtag.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createGtagJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTAG_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * Creates a route with a network first strategy for the gtm.js script.\n *\n * @param {string} cacheName\n * @return {Route} The created route.\n *\n * @private\n */\nconst createGtmJsRoute = (cacheName) => {\n    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTM_JS_PATH;\n    const handler = new NetworkFirst({ cacheName });\n    return new Route(match, handler, 'GET');\n};\n/**\n * @param {Object=} [options]\n * @param {Object} [options.cacheName] The cache name to store and retrieve\n *     analytics.js. Defaults to the cache names provided by `workbox-core`.\n * @param {Object} [options.parameterOverrides]\n *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),\n *     expressed as key/value pairs, to be added to replayed Google Analytics\n *     requests. This can be used to, e.g., set a custom dimension indicating\n *     that the request was replayed.\n * @param {Function} [options.hitFilter] A function that allows you to modify\n *     the hit parameters prior to replaying\n *     the hit. The function is invoked with the original hit's URLSearchParams\n *     object as its only argument.\n *\n * @memberof workbox-google-analytics\n */\nconst initialize = (options = {}) => {\n    const cacheName = cacheNames.getGoogleAnalyticsName(options.cacheName);\n    const bgSyncPlugin = new BackgroundSyncPlugin(QUEUE_NAME, {\n        maxRetentionTime: MAX_RETENTION_TIME,\n        onSync: createOnSyncCallback(options),\n    });\n    const routes = [\n        createGtmJsRoute(cacheName),\n        createAnalyticsJsRoute(cacheName),\n        createGtagJsRoute(cacheName),\n        ...createCollectRoutes(bgSyncPlugin),\n    ];\n    const router = new Router();\n    for (const route of routes) {\n        router.registerRoute(route);\n    }\n    router.addFetchListener();\n};\nexport { initialize };\n"],"names":["self","_","e","GOOGLE_ANALYTICS_HOST","GTM_HOST","COLLECT_PATHS_REGEX","createCollectRoutes","bgSyncPlugin","match","url","hostname","test","pathname","handler","NetworkOnly","plugins","Route","createAnalyticsJsRoute","cacheName","NetworkFirst","createGtagJsRoute","createGtmJsRoute","initialize","options","cacheNames","getGoogleAnalyticsName","BackgroundSyncPlugin","maxRetentionTime","onSync","config","async","queue","entry","shiftRequest","request","timestamp","URL","params","method","URLSearchParams","clone","text","searchParams","originalHitTime","Number","get","queueTime","Date","now","set","String","parameterOverrides","param","Object","keys","value","hitFilter","call","fetch","Request","origin","body","toString","mode","credentials","headers","err","unshiftRequest","routes","router","Router","route","registerRoute","addFetchListener"],"mappings":"oGAEA,IACIA,KAAK,mCAAqCC,GAC9C,CACA,MAAOC,GAAK,CCGL,MAEMC,EAAwB,2BACxBC,EAAW,2BASXC,EAAsB,qBCyE7BC,EAAuBC,IACzB,MAAMC,EAAQA,EAAGC,SAAUA,EAAIC,WAAaP,GACxCE,EAAoBM,KAAKF,EAAIG,UAC3BC,EAAU,IAAIC,cAAY,CAC5BC,QAAS,CAACR,KAEd,MAAO,CAAC,IAAIS,EAAAA,MAAMR,EAAOK,EAAS,OAAQ,IAAIG,QAAMR,EAAOK,EAAS,QAAQ,EAU1EI,EAA0BC,IAC5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,QAAQlD,EAAImD,OAASnD,EAAIG,SAAU,CAC/CiD,KAAMxB,EAAOyB,WACbxB,OAAQ,OACRyB,KAAM,OACNC,YAAa,OACbC,QAAS,CAAE,eAAgB,gBAKnC,CACA,MAAOC,GAMH,YALMnC,EAAMoC,eAAenC,GAKrBkC,CACV,CACJ,MAlDsBrC,MAuI1B,MAAMuC,EAAS,CACX/C,EAAiBH,GACjBD,EAAuBC,GACvBE,EAAkBF,MACfZ,EAAoBC,IAErB8D,EAAS,IAAIC,SACnB,IAAK,MAAMC,KAASH,EAChBC,EAAOG,cAAcD,GAEzBF,EAAOI,kBAAkB"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/index.d.ts b/tools/ui/node_modules/workbox-google-analytics/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2229d296d7ff1f4421c8b4304bb6ed07ce3a8cf2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/index.d.ts
@@ -0,0 +1,6 @@
+import { initialize, GoogleAnalyticsInitializeOptions } from './initialize.js';
+import './_version.js';
+/**
+ * @module workbox-google-analytics
+ */
+export { initialize, GoogleAnalyticsInitializeOptions };
diff --git a/tools/ui/node_modules/workbox-google-analytics/index.js b/tools/ui/node_modules/workbox-google-analytics/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e84c7f8dbe476954b40231b3d7d811e597949913
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/index.js
@@ -0,0 +1,13 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { initialize } from './initialize.js';
+import './_version.js';
+/**
+ * @module workbox-google-analytics
+ */
+export { initialize };
diff --git a/tools/ui/node_modules/workbox-google-analytics/index.mjs b/tools/ui/node_modules/workbox-google-analytics/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/initialize.d.ts b/tools/ui/node_modules/workbox-google-analytics/initialize.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..019ae487d379fb9b265aba1653b5b8bec5fd6bc1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/initialize.d.ts
@@ -0,0 +1,26 @@
+import './_version.js';
+export interface GoogleAnalyticsInitializeOptions {
+    cacheName?: string;
+    parameterOverrides?: {
+        [paramName: string]: string;
+    };
+    hitFilter?: (params: URLSearchParams) => void;
+}
+/**
+ * @param {Object=} [options]
+ * @param {Object} [options.cacheName] The cache name to store and retrieve
+ *     analytics.js. Defaults to the cache names provided by `workbox-core`.
+ * @param {Object} [options.parameterOverrides]
+ *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
+ *     expressed as key/value pairs, to be added to replayed Google Analytics
+ *     requests. This can be used to, e.g., set a custom dimension indicating
+ *     that the request was replayed.
+ * @param {Function} [options.hitFilter] A function that allows you to modify
+ *     the hit parameters prior to replaying
+ *     the hit. The function is invoked with the original hit's URLSearchParams
+ *     object as its only argument.
+ *
+ * @memberof workbox-google-analytics
+ */
+declare const initialize: (options?: GoogleAnalyticsInitializeOptions) => void;
+export { initialize };
diff --git a/tools/ui/node_modules/workbox-google-analytics/initialize.js b/tools/ui/node_modules/workbox-google-analytics/initialize.js
new file mode 100644
index 0000000000000000000000000000000000000000..65c30eb0cf159c5a204262f9a3cb587ad664daee
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/initialize.js
@@ -0,0 +1,176 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { BackgroundSyncPlugin } from 'workbox-background-sync/BackgroundSyncPlugin.js';
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { Route } from 'workbox-routing/Route.js';
+import { Router } from 'workbox-routing/Router.js';
+import { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';
+import { NetworkOnly } from 'workbox-strategies/NetworkOnly.js';
+import { QUEUE_NAME, MAX_RETENTION_TIME, GOOGLE_ANALYTICS_HOST, GTM_HOST, ANALYTICS_JS_PATH, GTAG_JS_PATH, GTM_JS_PATH, COLLECT_PATHS_REGEX, } from './utils/constants.js';
+import './_version.js';
+/**
+ * Creates the requestWillDequeue callback to be used with the background
+ * sync plugin. The callback takes the failed request and adds the
+ * `qt` param based on the current time, as well as applies any other
+ * user-defined hit modifications.
+ *
+ * @param {Object} config See {@link workbox-google-analytics.initialize}.
+ * @return {Function} The requestWillDequeue callback function.
+ *
+ * @private
+ */
+const createOnSyncCallback = (config) => {
+    return async ({ queue }) => {
+        let entry;
+        while ((entry = await queue.shiftRequest())) {
+            const { request, timestamp } = entry;
+            const url = new URL(request.url);
+            try {
+                // Measurement protocol requests can set their payload parameters in
+                // either the URL query string (for GET requests) or the POST body.
+                const params = request.method === 'POST'
+                    ? new URLSearchParams(await request.clone().text())
+                    : url.searchParams;
+                // Calculate the qt param, accounting for the fact that an existing
+                // qt param may be present and should be updated rather than replaced.
+                const originalHitTime = timestamp - (Number(params.get('qt')) || 0);
+                const queueTime = Date.now() - originalHitTime;
+                // Set the qt param prior to applying hitFilter or parameterOverrides.
+                params.set('qt', String(queueTime));
+                // Apply `parameterOverrides`, if set.
+                if (config.parameterOverrides) {
+                    for (const param of Object.keys(config.parameterOverrides)) {
+                        const value = config.parameterOverrides[param];
+                        params.set(param, value);
+                    }
+                }
+                // Apply `hitFilter`, if set.
+                if (typeof config.hitFilter === 'function') {
+                    config.hitFilter.call(null, params);
+                }
+                // Retry the fetch. Ignore URL search params from the URL as they're
+                // now in the post body.
+                await fetch(new Request(url.origin + url.pathname, {
+                    body: params.toString(),
+                    method: 'POST',
+                    mode: 'cors',
+                    credentials: 'omit',
+                    headers: { 'Content-Type': 'text/plain' },
+                }));
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` + `has been replayed`);
+                }
+            }
+            catch (err) {
+                await queue.unshiftRequest(entry);
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`Request for '${getFriendlyURL(url.href)}' ` +
+                        `failed to replay, putting it back in the queue.`);
+                }
+                throw err;
+            }
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            logger.log(`All Google Analytics request successfully replayed; ` +
+                `the queue is now empty!`);
+        }
+    };
+};
+/**
+ * Creates GET and POST routes to catch failed Measurement Protocol hits.
+ *
+ * @param {BackgroundSyncPlugin} bgSyncPlugin
+ * @return {Array} The created routes.
+ *
+ * @private
+ */
+const createCollectRoutes = (bgSyncPlugin) => {
+    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&
+        COLLECT_PATHS_REGEX.test(url.pathname);
+    const handler = new NetworkOnly({
+        plugins: [bgSyncPlugin],
+    });
+    return [new Route(match, handler, 'GET'), new Route(match, handler, 'POST')];
+};
+/**
+ * Creates a route with a network first strategy for the analytics.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createAnalyticsJsRoute = (cacheName) => {
+    const match = ({ url }) => url.hostname === GOOGLE_ANALYTICS_HOST &&
+        url.pathname === ANALYTICS_JS_PATH;
+    const handler = new NetworkFirst({ cacheName });
+    return new Route(match, handler, 'GET');
+};
+/**
+ * Creates a route with a network first strategy for the gtag.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createGtagJsRoute = (cacheName) => {
+    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTAG_JS_PATH;
+    const handler = new NetworkFirst({ cacheName });
+    return new Route(match, handler, 'GET');
+};
+/**
+ * Creates a route with a network first strategy for the gtm.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createGtmJsRoute = (cacheName) => {
+    const match = ({ url }) => url.hostname === GTM_HOST && url.pathname === GTM_JS_PATH;
+    const handler = new NetworkFirst({ cacheName });
+    return new Route(match, handler, 'GET');
+};
+/**
+ * @param {Object=} [options]
+ * @param {Object} [options.cacheName] The cache name to store and retrieve
+ *     analytics.js. Defaults to the cache names provided by `workbox-core`.
+ * @param {Object} [options.parameterOverrides]
+ *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
+ *     expressed as key/value pairs, to be added to replayed Google Analytics
+ *     requests. This can be used to, e.g., set a custom dimension indicating
+ *     that the request was replayed.
+ * @param {Function} [options.hitFilter] A function that allows you to modify
+ *     the hit parameters prior to replaying
+ *     the hit. The function is invoked with the original hit's URLSearchParams
+ *     object as its only argument.
+ *
+ * @memberof workbox-google-analytics
+ */
+const initialize = (options = {}) => {
+    const cacheName = cacheNames.getGoogleAnalyticsName(options.cacheName);
+    const bgSyncPlugin = new BackgroundSyncPlugin(QUEUE_NAME, {
+        maxRetentionTime: MAX_RETENTION_TIME,
+        onSync: createOnSyncCallback(options),
+    });
+    const routes = [
+        createGtmJsRoute(cacheName),
+        createAnalyticsJsRoute(cacheName),
+        createGtagJsRoute(cacheName),
+        ...createCollectRoutes(bgSyncPlugin),
+    ];
+    const router = new Router();
+    for (const route of routes) {
+        router.registerRoute(route);
+    }
+    router.addFetchListener();
+};
+export { initialize };
diff --git a/tools/ui/node_modules/workbox-google-analytics/initialize.mjs b/tools/ui/node_modules/workbox-google-analytics/initialize.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..e195c24b0c6637971e74e53227e53e56c79bfa54
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/initialize.mjs
@@ -0,0 +1 @@
+export * from './initialize.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/package.json b/tools/ui/node_modules/workbox-google-analytics/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..a0f558a12136789bc16a2ecc1056ea567c60c585
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/package.json
@@ -0,0 +1,37 @@
+{
+  "name": "workbox-google-analytics",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "Queues failed requests and uses the Background Sync API to replay them when the network is available",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "offline",
+    "google",
+    "analytics"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.googleAnalytics",
+    "outputFilename": "workbox-offline-ga",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-background-sync": "7.4.1",
+    "workbox-core": "7.4.1",
+    "workbox-routing": "7.4.1",
+    "workbox-strategies": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-google-analytics/src/_version.ts b/tools/ui/node_modules/workbox-google-analytics/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07d2251e5338a3e5a6251820c07b814d1a132e82
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:google-analytics:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/src/index.ts b/tools/ui/node_modules/workbox-google-analytics/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6f7b3fe5ac47eee0c784b9a3ccfe91a9f2401a0d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/src/index.ts
@@ -0,0 +1,17 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {initialize, GoogleAnalyticsInitializeOptions} from './initialize.js';
+
+import './_version.js';
+
+/**
+ * @module workbox-google-analytics
+ */
+
+export {initialize, GoogleAnalyticsInitializeOptions};
diff --git a/tools/ui/node_modules/workbox-google-analytics/src/initialize.ts b/tools/ui/node_modules/workbox-google-analytics/src/initialize.ts
new file mode 100644
index 0000000000000000000000000000000000000000..89bf5567cf452ad430320802cbe8c890ab83346a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/src/initialize.ts
@@ -0,0 +1,233 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {BackgroundSyncPlugin} from 'workbox-background-sync/BackgroundSyncPlugin.js';
+import {Queue} from 'workbox-background-sync/Queue.js';
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {RouteMatchCallbackOptions} from 'workbox-core/types.js';
+import {Route} from 'workbox-routing/Route.js';
+import {Router} from 'workbox-routing/Router.js';
+import {NetworkFirst} from 'workbox-strategies/NetworkFirst.js';
+import {NetworkOnly} from 'workbox-strategies/NetworkOnly.js';
+import {
+  QUEUE_NAME,
+  MAX_RETENTION_TIME,
+  GOOGLE_ANALYTICS_HOST,
+  GTM_HOST,
+  ANALYTICS_JS_PATH,
+  GTAG_JS_PATH,
+  GTM_JS_PATH,
+  COLLECT_PATHS_REGEX,
+} from './utils/constants.js';
+import './_version.js';
+
+export interface GoogleAnalyticsInitializeOptions {
+  cacheName?: string;
+  parameterOverrides?: {[paramName: string]: string};
+  hitFilter?: (params: URLSearchParams) => void;
+}
+
+/**
+ * Creates the requestWillDequeue callback to be used with the background
+ * sync plugin. The callback takes the failed request and adds the
+ * `qt` param based on the current time, as well as applies any other
+ * user-defined hit modifications.
+ *
+ * @param {Object} config See {@link workbox-google-analytics.initialize}.
+ * @return {Function} The requestWillDequeue callback function.
+ *
+ * @private
+ */
+const createOnSyncCallback = (config: GoogleAnalyticsInitializeOptions) => {
+  return async ({queue}: {queue: Queue}) => {
+    let entry;
+    while ((entry = await queue.shiftRequest())) {
+      const {request, timestamp} = entry;
+      const url = new URL(request.url);
+
+      try {
+        // Measurement protocol requests can set their payload parameters in
+        // either the URL query string (for GET requests) or the POST body.
+        const params =
+          request.method === 'POST'
+            ? new URLSearchParams(await request.clone().text())
+            : url.searchParams;
+
+        // Calculate the qt param, accounting for the fact that an existing
+        // qt param may be present and should be updated rather than replaced.
+        const originalHitTime = timestamp! - (Number(params.get('qt')) || 0);
+        const queueTime = Date.now() - originalHitTime;
+
+        // Set the qt param prior to applying hitFilter or parameterOverrides.
+        params.set('qt', String(queueTime));
+
+        // Apply `parameterOverrides`, if set.
+        if (config.parameterOverrides) {
+          for (const param of Object.keys(config.parameterOverrides)) {
+            const value = config.parameterOverrides[param];
+            params.set(param, value);
+          }
+        }
+
+        // Apply `hitFilter`, if set.
+        if (typeof config.hitFilter === 'function') {
+          config.hitFilter.call(null, params);
+        }
+
+        // Retry the fetch. Ignore URL search params from the URL as they're
+        // now in the post body.
+        await fetch(
+          new Request(url.origin + url.pathname, {
+            body: params.toString(),
+            method: 'POST',
+            mode: 'cors',
+            credentials: 'omit',
+            headers: {'Content-Type': 'text/plain'},
+          }),
+        );
+
+        if (process.env.NODE_ENV !== 'production') {
+          logger.log(
+            `Request for '${getFriendlyURL(url.href)}' ` + `has been replayed`,
+          );
+        }
+      } catch (err) {
+        await queue.unshiftRequest(entry);
+
+        if (process.env.NODE_ENV !== 'production') {
+          logger.log(
+            `Request for '${getFriendlyURL(url.href)}' ` +
+              `failed to replay, putting it back in the queue.`,
+          );
+        }
+        throw err;
+      }
+    }
+    if (process.env.NODE_ENV !== 'production') {
+      logger.log(
+        `All Google Analytics request successfully replayed; ` +
+          `the queue is now empty!`,
+      );
+    }
+  };
+};
+
+/**
+ * Creates GET and POST routes to catch failed Measurement Protocol hits.
+ *
+ * @param {BackgroundSyncPlugin} bgSyncPlugin
+ * @return {Array} The created routes.
+ *
+ * @private
+ */
+const createCollectRoutes = (bgSyncPlugin: BackgroundSyncPlugin) => {
+  const match = ({url}: RouteMatchCallbackOptions) =>
+    url.hostname === GOOGLE_ANALYTICS_HOST &&
+    COLLECT_PATHS_REGEX.test(url.pathname);
+
+  const handler = new NetworkOnly({
+    plugins: [bgSyncPlugin],
+  });
+
+  return [new Route(match, handler, 'GET'), new Route(match, handler, 'POST')];
+};
+
+/**
+ * Creates a route with a network first strategy for the analytics.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createAnalyticsJsRoute = (cacheName: string) => {
+  const match = ({url}: RouteMatchCallbackOptions) =>
+    url.hostname === GOOGLE_ANALYTICS_HOST &&
+    url.pathname === ANALYTICS_JS_PATH;
+
+  const handler = new NetworkFirst({cacheName});
+
+  return new Route(match, handler, 'GET');
+};
+
+/**
+ * Creates a route with a network first strategy for the gtag.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createGtagJsRoute = (cacheName: string) => {
+  const match = ({url}: RouteMatchCallbackOptions) =>
+    url.hostname === GTM_HOST && url.pathname === GTAG_JS_PATH;
+
+  const handler = new NetworkFirst({cacheName});
+
+  return new Route(match, handler, 'GET');
+};
+
+/**
+ * Creates a route with a network first strategy for the gtm.js script.
+ *
+ * @param {string} cacheName
+ * @return {Route} The created route.
+ *
+ * @private
+ */
+const createGtmJsRoute = (cacheName: string) => {
+  const match = ({url}: RouteMatchCallbackOptions) =>
+    url.hostname === GTM_HOST && url.pathname === GTM_JS_PATH;
+
+  const handler = new NetworkFirst({cacheName});
+
+  return new Route(match, handler, 'GET');
+};
+
+/**
+ * @param {Object=} [options]
+ * @param {Object} [options.cacheName] The cache name to store and retrieve
+ *     analytics.js. Defaults to the cache names provided by `workbox-core`.
+ * @param {Object} [options.parameterOverrides]
+ *     [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
+ *     expressed as key/value pairs, to be added to replayed Google Analytics
+ *     requests. This can be used to, e.g., set a custom dimension indicating
+ *     that the request was replayed.
+ * @param {Function} [options.hitFilter] A function that allows you to modify
+ *     the hit parameters prior to replaying
+ *     the hit. The function is invoked with the original hit's URLSearchParams
+ *     object as its only argument.
+ *
+ * @memberof workbox-google-analytics
+ */
+const initialize = (options: GoogleAnalyticsInitializeOptions = {}): void => {
+  const cacheName = cacheNames.getGoogleAnalyticsName(options.cacheName);
+
+  const bgSyncPlugin = new BackgroundSyncPlugin(QUEUE_NAME, {
+    maxRetentionTime: MAX_RETENTION_TIME,
+    onSync: createOnSyncCallback(options),
+  });
+
+  const routes = [
+    createGtmJsRoute(cacheName),
+    createAnalyticsJsRoute(cacheName),
+    createGtagJsRoute(cacheName),
+    ...createCollectRoutes(bgSyncPlugin),
+  ];
+
+  const router = new Router();
+  for (const route of routes) {
+    router.registerRoute(route);
+  }
+
+  router.addFetchListener();
+};
+
+export {initialize};
diff --git a/tools/ui/node_modules/workbox-google-analytics/src/utils/constants.ts b/tools/ui/node_modules/workbox-google-analytics/src/utils/constants.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b2baac2e00d9052a15529127f18caea4333eb33f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/src/utils/constants.ts
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+export const QUEUE_NAME = 'workbox-google-analytics';
+export const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes
+export const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com';
+export const GTM_HOST = 'www.googletagmanager.com';
+export const ANALYTICS_JS_PATH = '/analytics.js';
+export const GTAG_JS_PATH = '/gtag/js';
+export const GTM_JS_PATH = '/gtm.js';
+export const COLLECT_DEFAULT_PATH = '/collect';
+
+// This RegExp matches all known Measurement Protocol single-hit collect
+// endpoints. Most of the time the default path (/collect) is used, but
+// occasionally an experimental endpoint is used when testing new features,
+// (e.g. /r/collect or /j/collect)
+export const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
diff --git a/tools/ui/node_modules/workbox-google-analytics/tsconfig.json b/tools/ui/node_modules/workbox-google-analytics/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..255f4fa204ed42f362281129c76694ceabaf346b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/tsconfig.json
@@ -0,0 +1,16 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [
+    {"path": "../workbox-background-sync/"},
+    {"path": "../workbox-core/"},
+    {"path": "../workbox-routing/"},
+    {"path": "../workbox-strategies/"}
+  ]
+}
diff --git a/tools/ui/node_modules/workbox-google-analytics/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-google-analytics/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..ffe375be061e2c2f267346bef9d3810a7c83d76f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","./src/_version.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-background-sync/_version.d.ts","../workbox-background-sync/queue.d.ts","../workbox-background-sync/backgroundsyncplugin.d.ts","../workbox-core/_private/cachenames.d.ts","../workbox-core/_private/getfriendlyurl.d.ts","../workbox-core/_private/logger.d.ts","../workbox-routing/_version.d.ts","../workbox-routing/utils/constants.d.ts","../workbox-routing/route.d.ts","../workbox-routing/router.d.ts","../workbox-strategies/_version.d.ts","../workbox-strategies/strategyhandler.d.ts","../workbox-strategies/strategy.d.ts","../workbox-strategies/networkfirst.d.ts","../workbox-strategies/networkonly.d.ts","./src/utils/constants.ts","./src/initialize.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},{"version":"ce27e4ebfb187f437924aa9fad00520cced70ac81f56a269589105fd7f78663f","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","72c62b406af19eca8080ea63f90f4c907ee5b8348152b75ba106395cd7514f54","3d3f0a288ad84c93fa07551ef1471447bec5357f1e23d4c113dc960a4a088f65","dda5c129fa8b8e72bee6609a4fc48148f58f2f656d70a395d3122431193569f9","9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","8d0f0aa989374cc6c7bc141649a9ca7d76b221a39375c8b98b844c3ad8c9b090","03e238c606e3567428238c11720093a64d3ef151ba465b7bf0ae8cca27540853","6b4baa3f95e01c06530945674c51c1b3d954ecb0aaf77c7e0f86838f1f14b5b1","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","c0f693310aa76645335728d3636021e61130aff7651ae44c512662a194ac3b63","98962a67c31e31dbb0f7eb27082465ca9bfd4b59c9f36537a70c27b1a3982e65","504186e6db5cd2c600ce2f134732e4d6ff94beddac01357e597d720735a3100e","ca6d208c53e8678ded971927ab4dec73a131ff603b0d3739cb16a905751e7275",{"version":"930830a78888471fd33535127ebf92410578eac95869ad3fdbe9d8eebd2a1542","signature":"7b4c0f1896b491488d700fbdabf6d247174df9361ec7edc3643317b33c53ce85"},{"version":"a6a277e1c18a0800c367dd7590dd507e244451cb46bf27a6ce2ddeffa1ed570a","signature":"ea689c41691ac977c4cf2cfe7fc7de5136851730c9d4dbc97d76eb65df8ee461"},{"version":"04acf603ebd22665ad7362a5fbc49ea536216a95b87343a77f29daaed947301c","signature":"6627c9dcfdebfc613a5e8fee703b73b0e8bca9b2ccd52a0618040fdb82982c28"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[82,124],[64,82,124],[64,65,66,67,68,82,124],[64,66,82,124],[73,75,82,124],[72,73,74,82,124],[82,124,137,173],[82,124,136,173,175],[82,124,198],[82,124,183],[82,124,187,188,189],[82,124,186],[82,124,188],[82,124,178,184,185,190,193,195,196,197],[82,124,185,191,192,198],[82,124,191,194],[82,124,185,186,191,198],[82,124,185,198],[82,124,179,180,181,182],[82,121,124],[82,123,124],[82,124,129,158],[82,124,125,130,136,137,144,155,166],[82,124,125,126,136,144],[77,78,79,82,124],[82,124,127,167],[82,124,128,129,137,145],[82,124,129,155,163],[82,124,130,132,136,144],[82,123,124,131],[82,124,132,133],[82,124,136],[82,124,134,136],[82,123,124,136],[82,124,136,137,138,155,166],[82,124,136,137,138,151,155,158],[82,119,124,171],[82,124,132,136,139,144,155,166],[82,124,136,137,139,140,144,155,163,166],[82,124,139,141,155,163,166],[82,124,136,142],[82,124,143,166,171],[82,124,132,136,144,155],[82,124,145],[82,124,146],[82,123,124,147],[82,121,122,123,124,125,126,127,128,129,130,131,132,133,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172],[82,124,149],[82,124,150],[82,124,136,151,152],[82,124,151,153,167,169],[82,124,136,155,156,158],[82,124,157,158],[82,124,155,156],[82,124,158],[82,124,159],[82,121,124,155],[82,124,136,161,162],[82,124,161,162],[82,124,129,144,155,163],[82,124,164],[124],[80,81,82,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172],[82,124,144,165],[82,124,139,150,166],[82,124,129,167],[82,124,155,168],[82,124,143,169],[82,124,170],[82,124,129,136,138,147,155,166,169,171],[82,124,155,172],[82,124,204,243],[82,124,204,228,243],[82,124,243],[82,124,204],[82,124,204,229,243],[82,124,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242],[82,124,229,243],[82,124,247],[82,124,173,250,251,252,253,254,255,256,257,258,259,260],[82,124,249,250,259],[82,124,250,259],[82,124,244,249,250,259],[82,124,249,250,251,252,253,254,255,256,257,258,260],[82,124,250],[82,124,129,249,259],[82,91,95,124,166],[82,91,124,155,166],[82,86,124],[82,88,91,124,163,166],[82,124,144,163],[82,124,173],[82,86,124,173],[82,88,91,124,144,166],[82,83,84,87,90,124,136,155,166],[82,91,98,124],[82,83,89,124],[82,91,112,113,124],[82,87,91,124,158,166,173],[82,112,124,173],[82,85,86,124,173],[82,91,124],[82,85,86,87,88,89,90,91,92,93,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,124],[82,91,106,124],[82,91,98,99,124],[82,89,91,99,100,124],[82,90,124],[82,83,86,91,124],[82,91,95,99,100,124],[82,95,124],[82,89,91,94,124,166],[82,83,88,91,98,124],[82,124,155],[82,86,91,112,124,171,173],[45,47,82,124],[62,82,124],[45,47,48,49,50,51,54,55,59,60,61,82,124],[45,53,82,124],[45,53,54,82,124],[57,58,82,124],[45,57,82,124],[45,58,82,124],[62]],"referencedMap":[[42,1],[66,2],[64,1],[69,3],[65,2],[70,1],[67,4],[68,2],[71,1],[76,5],[72,1],[75,6],[73,1],[174,7],[176,8],[177,1],[74,1],[178,1],[199,9],[184,10],[190,11],[188,1],[187,12],[189,13],[198,14],[193,15],[195,16],[196,17],[197,18],[191,1],[192,18],[194,18],[186,18],[185,1],[180,1],[179,1],[182,10],[183,19],[181,10],[175,1],[200,1],[121,20],[122,20],[123,21],[124,22],[125,23],[126,24],[77,1],[80,25],[78,1],[79,1],[127,26],[128,27],[129,28],[130,29],[131,30],[132,31],[133,31],[135,32],[134,33],[136,34],[137,35],[138,36],[120,37],[139,38],[140,39],[141,40],[142,41],[143,42],[144,43],[145,44],[146,45],[147,46],[148,47],[149,48],[150,49],[151,50],[152,50],[153,51],[154,1],[155,52],[157,53],[156,54],[158,55],[159,56],[160,57],[161,58],[162,59],[163,60],[164,61],[82,62],[81,1],[173,63],[165,64],[166,65],[167,66],[168,67],[169,68],[170,69],[171,70],[172,71],[201,1],[202,1],[203,1],[228,72],[229,73],[204,74],[207,74],[226,72],[227,72],[217,72],[216,75],[214,72],[209,72],[222,72],[220,72],[224,72],[208,72],[221,72],[225,72],[210,72],[211,72],[223,72],[205,72],[212,72],[213,72],[215,72],[219,72],[230,76],[218,72],[206,72],[243,77],[242,1],[237,76],[239,78],[238,76],[231,76],[232,76],[234,76],[236,76],[240,78],[241,78],[233,78],[235,78],[244,1],[245,1],[246,1],[248,79],[247,1],[261,80],[260,81],[251,82],[252,83],[259,84],[253,83],[254,82],[255,82],[256,82],[257,85],[250,86],[258,81],[249,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[98,87],[108,88],[97,87],[118,89],[89,90],[88,91],[117,92],[111,93],[116,94],[91,95],[105,96],[90,97],[114,98],[86,99],[85,92],[115,100],[87,101],[92,102],[93,1],[96,102],[83,1],[119,103],[109,104],[100,105],[101,106],[103,107],[99,108],[102,109],[112,92],[94,110],[95,111],[104,112],[84,113],[107,104],[106,102],[110,1],[113,114],[46,1],[48,115],[47,1],[49,1],[50,1],[51,1],[44,1],[45,1],[43,1],[63,116],[62,117],[61,1],[52,1],[54,118],[55,119],[53,1],[56,1],[59,120],[60,120],[58,121],[57,122]],"exportedModulesMap":[[42,1],[66,2],[64,1],[69,3],[65,2],[70,1],[67,4],[68,2],[71,1],[76,5],[72,1],[75,6],[73,1],[174,7],[176,8],[177,1],[74,1],[178,1],[199,9],[184,10],[190,11],[188,1],[187,12],[189,13],[198,14],[193,15],[195,16],[196,17],[197,18],[191,1],[192,18],[194,18],[186,18],[185,1],[180,1],[179,1],[182,10],[183,19],[181,10],[175,1],[200,1],[121,20],[122,20],[123,21],[124,22],[125,23],[126,24],[77,1],[80,25],[78,1],[79,1],[127,26],[128,27],[129,28],[130,29],[131,30],[132,31],[133,31],[135,32],[134,33],[136,34],[137,35],[138,36],[120,37],[139,38],[140,39],[141,40],[142,41],[143,42],[144,43],[145,44],[146,45],[147,46],[148,47],[149,48],[150,49],[151,50],[152,50],[153,51],[154,1],[155,52],[157,53],[156,54],[158,55],[159,56],[160,57],[161,58],[162,59],[163,60],[164,61],[82,62],[81,1],[173,63],[165,64],[166,65],[167,66],[168,67],[169,68],[170,69],[171,70],[172,71],[201,1],[202,1],[203,1],[228,72],[229,73],[204,74],[207,74],[226,72],[227,72],[217,72],[216,75],[214,72],[209,72],[222,72],[220,72],[224,72],[208,72],[221,72],[225,72],[210,72],[211,72],[223,72],[205,72],[212,72],[213,72],[215,72],[219,72],[230,76],[218,72],[206,72],[243,77],[242,1],[237,76],[239,78],[238,76],[231,76],[232,76],[234,76],[236,76],[240,78],[241,78],[233,78],[235,78],[244,1],[245,1],[246,1],[248,79],[247,1],[261,80],[260,81],[251,82],[252,83],[259,84],[253,83],[254,82],[255,82],[256,82],[257,85],[250,86],[258,81],[249,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[98,87],[108,88],[97,87],[118,89],[89,90],[88,91],[117,92],[111,93],[116,94],[91,95],[105,96],[90,97],[114,98],[86,99],[85,92],[115,100],[87,101],[92,102],[93,1],[96,102],[83,1],[119,103],[109,104],[100,105],[101,106],[103,107],[99,108],[102,109],[112,92],[94,110],[95,111],[104,112],[84,113],[107,104],[106,102],[110,1],[113,114],[46,1],[48,115],[47,1],[49,1],[50,1],[51,1],[44,1],[45,1],[63,123],[52,1],[54,118],[55,119],[53,1],[56,1],[59,120],[60,120],[58,121],[57,122]],"semanticDiagnosticsPerFile":[42,66,64,69,65,70,67,68,71,76,72,75,73,174,176,177,74,178,199,184,190,188,187,189,198,193,195,196,197,191,192,194,186,185,180,179,182,183,181,175,200,121,122,123,124,125,126,77,80,78,79,127,128,129,130,131,132,133,135,134,136,137,138,120,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,156,158,159,160,161,162,163,164,82,81,173,165,166,167,168,169,170,171,172,201,202,203,228,229,204,207,226,227,217,216,214,209,222,220,224,208,221,225,210,211,223,205,212,213,215,219,230,218,206,243,242,237,239,238,231,232,234,236,240,241,233,235,244,245,246,248,247,261,260,251,252,259,253,254,255,256,257,250,258,249,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,98,108,97,118,89,88,117,111,116,91,105,90,114,86,85,115,87,92,93,96,83,119,109,100,101,103,99,102,112,94,95,104,84,107,106,110,113,46,48,47,49,50,51,44,45,43,63,62,61,52,54,55,53,56,59,60,58,57],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-google-analytics/utils/constants.d.ts b/tools/ui/node_modules/workbox-google-analytics/utils/constants.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fd9c629ed90d1dbc8025c8732ba381c307429756
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/utils/constants.d.ts
@@ -0,0 +1,10 @@
+import '../_version.js';
+export declare const QUEUE_NAME = "workbox-google-analytics";
+export declare const MAX_RETENTION_TIME: number;
+export declare const GOOGLE_ANALYTICS_HOST = "www.google-analytics.com";
+export declare const GTM_HOST = "www.googletagmanager.com";
+export declare const ANALYTICS_JS_PATH = "/analytics.js";
+export declare const GTAG_JS_PATH = "/gtag/js";
+export declare const GTM_JS_PATH = "/gtm.js";
+export declare const COLLECT_DEFAULT_PATH = "/collect";
+export declare const COLLECT_PATHS_REGEX: RegExp;
diff --git a/tools/ui/node_modules/workbox-google-analytics/utils/constants.js b/tools/ui/node_modules/workbox-google-analytics/utils/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..24c7b66e6c7244651d659b78e50761fb85d476f6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/utils/constants.js
@@ -0,0 +1,21 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+export const QUEUE_NAME = 'workbox-google-analytics';
+export const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes
+export const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com';
+export const GTM_HOST = 'www.googletagmanager.com';
+export const ANALYTICS_JS_PATH = '/analytics.js';
+export const GTAG_JS_PATH = '/gtag/js';
+export const GTM_JS_PATH = '/gtm.js';
+export const COLLECT_DEFAULT_PATH = '/collect';
+// This RegExp matches all known Measurement Protocol single-hit collect
+// endpoints. Most of the time the default path (/collect) is used, but
+// occasionally an experimental endpoint is used when testing new features,
+// (e.g. /r/collect or /j/collect)
+export const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
diff --git a/tools/ui/node_modules/workbox-google-analytics/utils/constants.mjs b/tools/ui/node_modules/workbox-google-analytics/utils/constants.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..f3f4c8f2658cad983ad14478588d456cb83091d0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-google-analytics/utils/constants.mjs
@@ -0,0 +1 @@
+export * from './constants.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/LICENSE b/tools/ui/node_modules/workbox-navigation-preload/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-navigation-preload/README.md b/tools/ui/node_modules/workbox-navigation-preload/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..ff61ae45c8504fd6ed3116fa07132b25ef19d626
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload
diff --git a/tools/ui/node_modules/workbox-navigation-preload/_version.d.ts b/tools/ui/node_modules/workbox-navigation-preload/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-navigation-preload/_version.js b/tools/ui/node_modules/workbox-navigation-preload/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..64184db60440d8a222df554b6b17a8911cd4fc91
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:navigation-preload:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-navigation-preload/_version.mjs b/tools/ui/node_modules/workbox-navigation-preload/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..4ee684c1205ef69913d49e446545181b127058a3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:navigation-preload:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..637ae1343090d70ea2084be91621b82fa479c8ca
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js
@@ -0,0 +1,99 @@
+this.workbox = this.workbox || {};
+this.workbox.navigationPreload = (function (exports, logger_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:navigation-preload:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @return {boolean} Whether or not the current browser supports enabling
+     * navigation preload.
+     *
+     * @memberof workbox-navigation-preload
+     */
+    function isSupported() {
+      return Boolean(self.registration && self.registration.navigationPreload);
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * If the browser supports Navigation Preload, then this will disable it.
+     *
+     * @memberof workbox-navigation-preload
+     */
+    function disable() {
+      if (isSupported()) {
+        self.addEventListener('activate', event => {
+          event.waitUntil(self.registration.navigationPreload.disable().then(() => {
+            {
+              logger_js.logger.log(`Navigation preload is disabled.`);
+            }
+          }));
+        });
+      } else {
+        {
+          logger_js.logger.log(`Navigation preload is not supported in this browser.`);
+        }
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * If the browser supports Navigation Preload, then this will enable it.
+     *
+     * @param {string} [headerValue] Optionally, allows developers to
+     * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
+     * the value of the `Service-Worker-Navigation-Preload` header which will be
+     * sent to the server when making the navigation request.
+     *
+     * @memberof workbox-navigation-preload
+     */
+    function enable(headerValue) {
+      if (isSupported()) {
+        self.addEventListener('activate', event => {
+          event.waitUntil(self.registration.navigationPreload.enable().then(() => {
+            // Defaults to Service-Worker-Navigation-Preload: true if not set.
+            if (headerValue) {
+              void self.registration.navigationPreload.setHeaderValue(headerValue);
+            }
+            {
+              logger_js.logger.log(`Navigation preload is enabled.`);
+            }
+          }));
+        });
+      } else {
+        {
+          logger_js.logger.log(`Navigation preload is not supported in this browser.`);
+        }
+      }
+    }
+
+    exports.disable = disable;
+    exports.enable = enable;
+    exports.isSupported = isSupported;
+
+    return exports;
+
+})({}, workbox.core._private);
+//# sourceMappingURL=workbox-navigation-preload.dev.js.map
diff --git a/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js.map b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..5f8fb4c2a714898440a7219adf262f4d7033c068
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-navigation-preload.dev.js","sources":["../_version.js","../isSupported.js","../disable.js","../enable.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:navigation-preload:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport './_version.js';\n/**\n * @return {boolean} Whether or not the current browser supports enabling\n * navigation preload.\n *\n * @memberof workbox-navigation-preload\n */\nfunction isSupported() {\n    return Boolean(self.registration && self.registration.navigationPreload);\n}\nexport { isSupported };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { isSupported } from './isSupported.js';\nimport './_version.js';\n/**\n * If the browser supports Navigation Preload, then this will disable it.\n *\n * @memberof workbox-navigation-preload\n */\nfunction disable() {\n    if (isSupported()) {\n        self.addEventListener('activate', (event) => {\n            event.waitUntil(self.registration.navigationPreload.disable().then(() => {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Navigation preload is disabled.`);\n                }\n            }));\n        });\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`Navigation preload is not supported in this browser.`);\n        }\n    }\n}\nexport { disable };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { isSupported } from './isSupported.js';\nimport './_version.js';\n/**\n * If the browser supports Navigation Preload, then this will enable it.\n *\n * @param {string} [headerValue] Optionally, allows developers to\n * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)\n * the value of the `Service-Worker-Navigation-Preload` header which will be\n * sent to the server when making the navigation request.\n *\n * @memberof workbox-navigation-preload\n */\nfunction enable(headerValue) {\n    if (isSupported()) {\n        self.addEventListener('activate', (event) => {\n            event.waitUntil(self.registration.navigationPreload.enable().then(() => {\n                // Defaults to Service-Worker-Navigation-Preload: true if not set.\n                if (headerValue) {\n                    void self.registration.navigationPreload.setHeaderValue(headerValue);\n                }\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Navigation preload is enabled.`);\n                }\n            }));\n        });\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`Navigation preload is not supported in this browser.`);\n        }\n    }\n}\nexport { enable };\n"],"names":["self","_","e","isSupported","Boolean","registration","navigationPreload","disable","addEventListener","event","waitUntil","then","logger","log","enable","headerValue","setHeaderValue"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,kCAAkC,CAAC,IAAIC,CAAC,EAAE;IACnD,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA,SAASC,WAAWA,GAAG;MACnB,OAAOC,OAAO,CAACJ,IAAI,CAACK,YAAY,IAAIL,IAAI,CAACK,YAAY,CAACC,iBAAiB,CAAC;IAC5E;;IChBA;IACA;;IAEA;IACA;IACA;IACA;IAIA;IACA;IACA;IACA;IACA;IACA,SAASC,OAAOA,GAAG;MACf,IAAIJ,WAAW,EAAE,EAAE;IACfH,IAAAA,IAAI,CAACQ,gBAAgB,CAAC,UAAU,EAAGC,KAAK,IAAK;IACzCA,MAAAA,KAAK,CAACC,SAAS,CAACV,IAAI,CAACK,YAAY,CAACC,iBAAiB,CAACC,OAAO,EAAE,CAACI,IAAI,CAAC,MAAM;IACrE,QAA2C;IACvCC,UAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,+BAAA,CAAgC,CAAC;IACjD,QAAA;IACJ,MAAA,CAAC,CAAC,CAAC;IACP,IAAA,CAAC,CAAC;IACN,EAAA,CAAC,MACI;IACD,IAA2C;IACvCD,MAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,oDAAA,CAAqD,CAAC;IACtE,IAAA;IACJ,EAAA;IACJ;;IC9BA;IACA;;IAEA;IACA;IACA;IACA;IAIA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASC,MAAMA,CAACC,WAAW,EAAE;MACzB,IAAIZ,WAAW,EAAE,EAAE;IACfH,IAAAA,IAAI,CAACQ,gBAAgB,CAAC,UAAU,EAAGC,KAAK,IAAK;IACzCA,MAAAA,KAAK,CAACC,SAAS,CAACV,IAAI,CAACK,YAAY,CAACC,iBAAiB,CAACQ,MAAM,EAAE,CAACH,IAAI,CAAC,MAAM;IACpE;IACA,QAAA,IAAII,WAAW,EAAE;cACb,KAAKf,IAAI,CAACK,YAAY,CAACC,iBAAiB,CAACU,cAAc,CAACD,WAAW,CAAC;IACxE,QAAA;IACA,QAA2C;IACvCH,UAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,8BAAA,CAA+B,CAAC;IAChD,QAAA;IACJ,MAAA,CAAC,CAAC,CAAC;IACP,IAAA,CAAC,CAAC;IACN,EAAA,CAAC,MACI;IACD,IAA2C;IACvCD,MAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,oDAAA,CAAqD,CAAC;IACtE,IAAA;IACJ,EAAA;IACJ;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..23d9af2a637b080150d0312034fb2cef14b5de68
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.navigationPreload=function(t){"use strict";try{self["workbox:navigation-preload:7.4.0"]&&_()}catch(t){}function e(){return Boolean(self.registration&&self.registration.navigationPreload)}return t.disable=function(){e()&&self.addEventListener("activate",(t=>{t.waitUntil(self.registration.navigationPreload.disable().then((()=>{})))}))},t.enable=function(t){e()&&self.addEventListener("activate",(e=>{e.waitUntil(self.registration.navigationPreload.enable().then((()=>{t&&self.registration.navigationPreload.setHeaderValue(t)})))}))},t.isSupported=e,t}({});
+//# sourceMappingURL=workbox-navigation-preload.prod.js.map
diff --git a/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js.map b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..9f8d7c3c35fa8f32ee23dacf0f8e28f15dc293d0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/build/workbox-navigation-preload.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-navigation-preload.prod.js","sources":["../_version.js","../isSupported.js","../disable.js","../enable.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:navigation-preload:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport './_version.js';\n/**\n * @return {boolean} Whether or not the current browser supports enabling\n * navigation preload.\n *\n * @memberof workbox-navigation-preload\n */\nfunction isSupported() {\n    return Boolean(self.registration && self.registration.navigationPreload);\n}\nexport { isSupported };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { isSupported } from './isSupported.js';\nimport './_version.js';\n/**\n * If the browser supports Navigation Preload, then this will disable it.\n *\n * @memberof workbox-navigation-preload\n */\nfunction disable() {\n    if (isSupported()) {\n        self.addEventListener('activate', (event) => {\n            event.waitUntil(self.registration.navigationPreload.disable().then(() => {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Navigation preload is disabled.`);\n                }\n            }));\n        });\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`Navigation preload is not supported in this browser.`);\n        }\n    }\n}\nexport { disable };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { isSupported } from './isSupported.js';\nimport './_version.js';\n/**\n * If the browser supports Navigation Preload, then this will enable it.\n *\n * @param {string} [headerValue] Optionally, allows developers to\n * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)\n * the value of the `Service-Worker-Navigation-Preload` header which will be\n * sent to the server when making the navigation request.\n *\n * @memberof workbox-navigation-preload\n */\nfunction enable(headerValue) {\n    if (isSupported()) {\n        self.addEventListener('activate', (event) => {\n            event.waitUntil(self.registration.navigationPreload.enable().then(() => {\n                // Defaults to Service-Worker-Navigation-Preload: true if not set.\n                if (headerValue) {\n                    void self.registration.navigationPreload.setHeaderValue(headerValue);\n                }\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Navigation preload is enabled.`);\n                }\n            }));\n        });\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`Navigation preload is not supported in this browser.`);\n        }\n    }\n}\nexport { enable };\n"],"names":["self","_","e","isSupported","Boolean","registration","navigationPreload","addEventListener","event","waitUntil","disable","then","headerValue","enable","setHeaderValue"],"mappings":"sFAEA,IACIA,KAAK,qCAAuCC,GAChD,CACA,MAAOC,GAAK,CCSZ,SAASC,IACL,OAAOC,QAAQJ,KAAKK,cAAgBL,KAAKK,aAAaC,kBAC1D,kBCDA,WACQH,KACAH,KAAKO,iBAAiB,YAAaC,IAC/BA,EAAMC,UAAUT,KAAKK,aAAaC,kBAAkBI,UAAUC,MAAK,SAIhE,GAQf,WCVA,SAAgBC,GACRT,KACAH,KAAKO,iBAAiB,YAAaC,IAC/BA,EAAMC,UAAUT,KAAKK,aAAaC,kBAAkBO,SAASF,MAAK,KAE1DC,GACKZ,KAAKK,aAAaC,kBAAkBQ,eAAeF,EAC5D,IAID,GAQf"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/disable.d.ts b/tools/ui/node_modules/workbox-navigation-preload/disable.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3dd67843050d5db9ad912c00736a91aa1f7409f4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/disable.d.ts
@@ -0,0 +1,8 @@
+import './_version.js';
+/**
+ * If the browser supports Navigation Preload, then this will disable it.
+ *
+ * @memberof workbox-navigation-preload
+ */
+declare function disable(): void;
+export { disable };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/disable.js b/tools/ui/node_modules/workbox-navigation-preload/disable.js
new file mode 100644
index 0000000000000000000000000000000000000000..2fd44b4421772186d0bde89649e4b374c365040d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/disable.js
@@ -0,0 +1,32 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import { isSupported } from './isSupported.js';
+import './_version.js';
+/**
+ * If the browser supports Navigation Preload, then this will disable it.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function disable() {
+    if (isSupported()) {
+        self.addEventListener('activate', (event) => {
+            event.waitUntil(self.registration.navigationPreload.disable().then(() => {
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`Navigation preload is disabled.`);
+                }
+            }));
+        });
+    }
+    else {
+        if (process.env.NODE_ENV !== 'production') {
+            logger.log(`Navigation preload is not supported in this browser.`);
+        }
+    }
+}
+export { disable };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/disable.mjs b/tools/ui/node_modules/workbox-navigation-preload/disable.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..dd602111641207f36d186c2e9e4650677ed56665
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/disable.mjs
@@ -0,0 +1 @@
+export * from './disable.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/enable.d.ts b/tools/ui/node_modules/workbox-navigation-preload/enable.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1359a8912dfec2b06c4c9702e824a1c82957fe03
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/enable.d.ts
@@ -0,0 +1,13 @@
+import './_version.js';
+/**
+ * If the browser supports Navigation Preload, then this will enable it.
+ *
+ * @param {string} [headerValue] Optionally, allows developers to
+ * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
+ * the value of the `Service-Worker-Navigation-Preload` header which will be
+ * sent to the server when making the navigation request.
+ *
+ * @memberof workbox-navigation-preload
+ */
+declare function enable(headerValue?: string): void;
+export { enable };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/enable.js b/tools/ui/node_modules/workbox-navigation-preload/enable.js
new file mode 100644
index 0000000000000000000000000000000000000000..85b3428eafb663b04f8517cf7a824ce1bd7e45a0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/enable.js
@@ -0,0 +1,41 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import { isSupported } from './isSupported.js';
+import './_version.js';
+/**
+ * If the browser supports Navigation Preload, then this will enable it.
+ *
+ * @param {string} [headerValue] Optionally, allows developers to
+ * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
+ * the value of the `Service-Worker-Navigation-Preload` header which will be
+ * sent to the server when making the navigation request.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function enable(headerValue) {
+    if (isSupported()) {
+        self.addEventListener('activate', (event) => {
+            event.waitUntil(self.registration.navigationPreload.enable().then(() => {
+                // Defaults to Service-Worker-Navigation-Preload: true if not set.
+                if (headerValue) {
+                    void self.registration.navigationPreload.setHeaderValue(headerValue);
+                }
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`Navigation preload is enabled.`);
+                }
+            }));
+        });
+    }
+    else {
+        if (process.env.NODE_ENV !== 'production') {
+            logger.log(`Navigation preload is not supported in this browser.`);
+        }
+    }
+}
+export { enable };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/enable.mjs b/tools/ui/node_modules/workbox-navigation-preload/enable.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..636344a9859041e583ea850093ea8d48214b0d80
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/enable.mjs
@@ -0,0 +1 @@
+export * from './enable.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/index.d.ts b/tools/ui/node_modules/workbox-navigation-preload/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..880e643e5d6a953210350701be4532f41e63a00d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/index.d.ts
@@ -0,0 +1,23 @@
+import { disable } from './disable.js';
+import { enable } from './enable.js';
+import { isSupported } from './isSupported.js';
+import './_version.js';
+interface NavigationPreloadState {
+    enabled?: boolean;
+    headerValue?: string;
+}
+interface NavigationPreloadManager {
+    disable(): Promise;
+    enable(): Promise;
+    getState(): Promise;
+    setHeaderValue(value: string): Promise;
+}
+declare global {
+    interface ServiceWorkerRegistration {
+        readonly navigationPreload: NavigationPreloadManager;
+    }
+}
+/**
+ * @module workbox-navigation-preload
+ */
+export { disable, enable, isSupported };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/index.js b/tools/ui/node_modules/workbox-navigation-preload/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cf40ed0c157144c0c1c3681a4309b37976f54d92
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/index.js
@@ -0,0 +1,15 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { disable } from './disable.js';
+import { enable } from './enable.js';
+import { isSupported } from './isSupported.js';
+import './_version.js';
+/**
+ * @module workbox-navigation-preload
+ */
+export { disable, enable, isSupported };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/index.mjs b/tools/ui/node_modules/workbox-navigation-preload/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/isSupported.d.ts b/tools/ui/node_modules/workbox-navigation-preload/isSupported.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e6a2dab1e867394724941752e8f3bb876406fccc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/isSupported.d.ts
@@ -0,0 +1,9 @@
+import './_version.js';
+/**
+ * @return {boolean} Whether or not the current browser supports enabling
+ * navigation preload.
+ *
+ * @memberof workbox-navigation-preload
+ */
+declare function isSupported(): boolean;
+export { isSupported };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/isSupported.js b/tools/ui/node_modules/workbox-navigation-preload/isSupported.js
new file mode 100644
index 0000000000000000000000000000000000000000..787eb070a98a8fede64571997ff8f87648d4f6c3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/isSupported.js
@@ -0,0 +1,18 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import './_version.js';
+/**
+ * @return {boolean} Whether or not the current browser supports enabling
+ * navigation preload.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function isSupported() {
+    return Boolean(self.registration && self.registration.navigationPreload);
+}
+export { isSupported };
diff --git a/tools/ui/node_modules/workbox-navigation-preload/isSupported.mjs b/tools/ui/node_modules/workbox-navigation-preload/isSupported.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..e4ec954938b7476095238ddcdab20e8f49b69f0b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/isSupported.mjs
@@ -0,0 +1 @@
+export * from './isSupported.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/package.json b/tools/ui/node_modules/workbox-navigation-preload/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6c05f51e0b090f6d8c35a66f29800e4a046e4964
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/package.json
@@ -0,0 +1,31 @@
+{
+  "name": "workbox-navigation-preload",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "This library allows developers to opt-in to using Navigation Preload in their service worker.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "navigation"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.navigationPreload",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-navigation-preload/src/_version.ts b/tools/ui/node_modules/workbox-navigation-preload/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f0e8a7ef36bbb3b9d9379ec8d77042cefca0491
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:navigation-preload:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-navigation-preload/src/disable.ts b/tools/ui/node_modules/workbox-navigation-preload/src/disable.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2255045802eff499396668d58270af13b828655b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/src/disable.ts
@@ -0,0 +1,39 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import {isSupported} from './isSupported.js';
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * If the browser supports Navigation Preload, then this will disable it.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function disable(): void {
+  if (isSupported()) {
+    self.addEventListener('activate', (event: ExtendableEvent) => {
+      event.waitUntil(
+        self.registration.navigationPreload.disable().then(() => {
+          if (process.env.NODE_ENV !== 'production') {
+            logger.log(`Navigation preload is disabled.`);
+          }
+        }),
+      );
+    });
+  } else {
+    if (process.env.NODE_ENV !== 'production') {
+      logger.log(`Navigation preload is not supported in this browser.`);
+    }
+  }
+}
+
+export {disable};
diff --git a/tools/ui/node_modules/workbox-navigation-preload/src/enable.ts b/tools/ui/node_modules/workbox-navigation-preload/src/enable.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b33cdc6c17b52455680242dd033a1b6962a6ed9b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/src/enable.ts
@@ -0,0 +1,51 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import {isSupported} from './isSupported.js';
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * If the browser supports Navigation Preload, then this will enable it.
+ *
+ * @param {string} [headerValue] Optionally, allows developers to
+ * [override](https://developers.google.com/web/updates/2017/02/navigation-preload#changing_the_header)
+ * the value of the `Service-Worker-Navigation-Preload` header which will be
+ * sent to the server when making the navigation request.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function enable(headerValue?: string): void {
+  if (isSupported()) {
+    self.addEventListener('activate', (event: ExtendableEvent) => {
+      event.waitUntil(
+        self.registration.navigationPreload.enable().then(() => {
+          // Defaults to Service-Worker-Navigation-Preload: true if not set.
+          if (headerValue) {
+            void self.registration.navigationPreload.setHeaderValue(
+              headerValue,
+            );
+          }
+
+          if (process.env.NODE_ENV !== 'production') {
+            logger.log(`Navigation preload is enabled.`);
+          }
+        }),
+      );
+    });
+  } else {
+    if (process.env.NODE_ENV !== 'production') {
+      logger.log(`Navigation preload is not supported in this browser.`);
+    }
+  }
+}
+
+export {enable};
diff --git a/tools/ui/node_modules/workbox-navigation-preload/src/index.ts b/tools/ui/node_modules/workbox-navigation-preload/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..18feaa57ba46f638737923b4fd091343e9ba4d4e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/src/index.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {disable} from './disable.js';
+import {enable} from './enable.js';
+import {isSupported} from './isSupported.js';
+import './_version.js';
+
+// See https://github.com/GoogleChrome/workbox/issues/2946
+interface NavigationPreloadState {
+  enabled?: boolean;
+  headerValue?: string;
+}
+
+interface NavigationPreloadManager {
+  disable(): Promise;
+  enable(): Promise;
+  getState(): Promise;
+  setHeaderValue(value: string): Promise;
+}
+
+declare global {
+  interface ServiceWorkerRegistration {
+    readonly navigationPreload: NavigationPreloadManager;
+  }
+}
+
+/**
+ * @module workbox-navigation-preload
+ */
+
+export {disable, enable, isSupported};
diff --git a/tools/ui/node_modules/workbox-navigation-preload/src/isSupported.ts b/tools/ui/node_modules/workbox-navigation-preload/src/isSupported.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9319d68203fedbd193b0c72d5bb4fcd1db7d35ad
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/src/isSupported.ts
@@ -0,0 +1,24 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * @return {boolean} Whether or not the current browser supports enabling
+ * navigation preload.
+ *
+ * @memberof workbox-navigation-preload
+ */
+function isSupported(): boolean {
+  return Boolean(self.registration && self.registration.navigationPreload);
+}
+
+export {isSupported};
diff --git a/tools/ui/node_modules/workbox-navigation-preload/tsconfig.json b/tools/ui/node_modules/workbox-navigation-preload/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..2457eadcf8e39664b6315f538007e7de076be21d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/tsconfig.json
@@ -0,0 +1,10 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [{"path": "../workbox-core/"}]
+}
diff --git a/tools/ui/node_modules/workbox-navigation-preload/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-navigation-preload/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..1a45d1684b04128939e9fa5766019ba17949f5d2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-navigation-preload/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","./src/_version.ts","../workbox-core/_version.d.ts","../workbox-core/_private/logger.d.ts","./src/issupported.ts","./src/disable.ts","./src/enable.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},{"version":"75a530fa4d2447196955a340b81c228f64e2221f538f8b080d3d59dbd4fad6bc","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},{"version":"9a76d057b0a358163dfb2d52e889a67945a03c81625de533cdd47110dfbeba8d","signature":"17046388e840e30dd5de708033bd9e243aa41390e931e05437037c99c947b6e0"},{"version":"81df156d8fcc4ed160b2bb4be311d1a3d83924fcae9123fe39fc04bb49127d4c","signature":"831f73411284b8dab124c1c5318bf588c9c5aa72dcc9a82829e02285a7580ad8"},{"version":"9bfaf863ab0430e183bcc9c3713ae0b22e5a4ffe9f9139fed5b2d22972ac794a","signature":"ce60064a0c52015c5c0a26f5691f202943a37737734ec921620bf71433d63d6a"},{"version":"f8e3356ce52911149a36a60a461e9e4f86c17e61078c322aca77518211f8d62f","signature":"a83e144ad9fcc1ee129f6530a24f658f35ededa8ee0218a3512e80152e535e54","affectsGlobalScope":true},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[68,110],[50,68,110],[50,51,52,53,54,68,110],[50,52,68,110],[59,61,68,110],[58,59,60,68,110],[68,110,123,159],[68,110,122,159,161],[68,110,184],[68,110,169],[68,110,173,174,175],[68,110,172],[68,110,174],[68,110,164,170,171,176,179,181,182,183],[68,110,171,177,178,184],[68,110,177,180],[68,110,171,172,177,184],[68,110,171,184],[68,110,165,166,167,168],[68,107,110],[68,109,110],[68,110,115,144],[68,110,111,116,122,123,130,141,152],[68,110,111,112,122,130],[63,64,65,68,110],[68,110,113,153],[68,110,114,115,123,131],[68,110,115,141,149],[68,110,116,118,122,130],[68,109,110,117],[68,110,118,119],[68,110,122],[68,110,120,122],[68,109,110,122],[68,110,122,123,124,141,152],[68,110,122,123,124,137,141,144],[68,105,110,157],[68,110,118,122,125,130,141,152],[68,110,122,123,125,126,130,141,149,152],[68,110,125,127,141,149,152],[68,110,122,128],[68,110,129,152,157],[68,110,118,122,130,141],[68,110,131],[68,110,132],[68,109,110,133],[68,107,108,109,110,111,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],[68,110,135],[68,110,136],[68,110,122,137,138],[68,110,137,139,153,155],[68,110,122,141,142,144],[68,110,143,144],[68,110,141,142],[68,110,144],[68,110,145],[68,107,110,141],[68,110,122,147,148],[68,110,147,148],[68,110,115,130,141,149],[68,110,150],[110],[66,67,68,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],[68,110,130,151],[68,110,125,136,152],[68,110,115,153],[68,110,141,154],[68,110,129,155],[68,110,156],[68,110,115,122,124,133,141,152,155,157],[68,110,141,158],[68,110,190,229],[68,110,190,214,229],[68,110,229],[68,110,190],[68,110,190,215,229],[68,110,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[68,110,215,229],[68,110,233],[68,110,159,236,237,238,239,240,241,242,243,244,245,246],[68,110,235,236,245],[68,110,236,245],[68,110,230,235,236,245],[68,110,235,236,237,238,239,240,241,242,243,244,246],[68,110,236],[68,110,115,235,245],[68,77,81,110,152],[68,77,110,141,152],[68,72,110],[68,74,77,110,149,152],[68,110,130,149],[68,110,159],[68,72,110,159],[68,74,77,110,130,152],[68,69,70,73,76,110,122,141,152],[68,77,84,110],[68,69,75,110],[68,77,98,99,110],[68,73,77,110,144,152,159],[68,98,110,159],[68,71,72,110,159],[68,77,110],[68,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,110],[68,77,92,110],[68,77,84,85,110],[68,75,77,85,86,110],[68,76,110],[68,69,72,77,110],[68,77,81,85,86,110],[68,81,110],[68,75,77,80,110,152],[68,69,74,77,84,110],[68,110,141],[68,72,77,98,110,157,159],[45,46,68,110],[46,47,48,68,110],[46,47,48]],"referencedMap":[[42,1],[52,2],[50,1],[55,3],[51,2],[56,1],[53,4],[54,2],[57,1],[62,5],[58,1],[61,6],[59,1],[160,7],[162,8],[163,1],[60,1],[164,1],[185,9],[170,10],[176,11],[174,1],[173,12],[175,13],[184,14],[179,15],[181,16],[182,17],[183,18],[177,1],[178,18],[180,18],[172,18],[171,1],[166,1],[165,1],[168,10],[169,19],[167,10],[161,1],[186,1],[107,20],[108,20],[109,21],[110,22],[111,23],[112,24],[63,1],[66,25],[64,1],[65,1],[113,26],[114,27],[115,28],[116,29],[117,30],[118,31],[119,31],[121,32],[120,33],[122,34],[123,35],[124,36],[106,37],[125,38],[126,39],[127,40],[128,41],[129,42],[130,43],[131,44],[132,45],[133,46],[134,47],[135,48],[136,49],[137,50],[138,50],[139,51],[140,1],[141,52],[143,53],[142,54],[144,55],[145,56],[146,57],[147,58],[148,59],[149,60],[150,61],[68,62],[67,1],[159,63],[151,64],[152,65],[153,66],[154,67],[155,68],[156,69],[157,70],[158,71],[187,1],[188,1],[189,1],[214,72],[215,73],[190,74],[193,74],[212,72],[213,72],[203,72],[202,75],[200,72],[195,72],[208,72],[206,72],[210,72],[194,72],[207,72],[211,72],[196,72],[197,72],[209,72],[191,72],[198,72],[199,72],[201,72],[205,72],[216,76],[204,72],[192,72],[229,77],[228,1],[223,76],[225,78],[224,76],[217,76],[218,76],[220,76],[222,76],[226,78],[227,78],[219,78],[221,78],[230,1],[231,1],[232,1],[234,79],[233,1],[247,80],[246,81],[237,82],[238,83],[245,84],[239,83],[240,82],[241,82],[242,82],[243,85],[236,86],[244,81],[235,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[84,87],[94,88],[83,87],[104,89],[75,90],[74,91],[103,92],[97,93],[102,94],[77,95],[91,96],[76,97],[100,98],[72,99],[71,92],[101,100],[73,101],[78,102],[79,1],[82,102],[69,1],[105,103],[95,104],[86,105],[87,106],[89,107],[85,108],[88,109],[98,92],[80,110],[81,111],[90,112],[70,113],[93,104],[92,102],[96,1],[99,114],[45,1],[44,1],[43,1],[47,115],[48,115],[49,116],[46,1]],"exportedModulesMap":[[42,1],[52,2],[50,1],[55,3],[51,2],[56,1],[53,4],[54,2],[57,1],[62,5],[58,1],[61,6],[59,1],[160,7],[162,8],[163,1],[60,1],[164,1],[185,9],[170,10],[176,11],[174,1],[173,12],[175,13],[184,14],[179,15],[181,16],[182,17],[183,18],[177,1],[178,18],[180,18],[172,18],[171,1],[166,1],[165,1],[168,10],[169,19],[167,10],[161,1],[186,1],[107,20],[108,20],[109,21],[110,22],[111,23],[112,24],[63,1],[66,25],[64,1],[65,1],[113,26],[114,27],[115,28],[116,29],[117,30],[118,31],[119,31],[121,32],[120,33],[122,34],[123,35],[124,36],[106,37],[125,38],[126,39],[127,40],[128,41],[129,42],[130,43],[131,44],[132,45],[133,46],[134,47],[135,48],[136,49],[137,50],[138,50],[139,51],[140,1],[141,52],[143,53],[142,54],[144,55],[145,56],[146,57],[147,58],[148,59],[149,60],[150,61],[68,62],[67,1],[159,63],[151,64],[152,65],[153,66],[154,67],[155,68],[156,69],[157,70],[158,71],[187,1],[188,1],[189,1],[214,72],[215,73],[190,74],[193,74],[212,72],[213,72],[203,72],[202,75],[200,72],[195,72],[208,72],[206,72],[210,72],[194,72],[207,72],[211,72],[196,72],[197,72],[209,72],[191,72],[198,72],[199,72],[201,72],[205,72],[216,76],[204,72],[192,72],[229,77],[228,1],[223,76],[225,78],[224,76],[217,76],[218,76],[220,76],[222,76],[226,78],[227,78],[219,78],[221,78],[230,1],[231,1],[232,1],[234,79],[233,1],[247,80],[246,81],[237,82],[238,83],[245,84],[239,83],[240,82],[241,82],[242,82],[243,85],[236,86],[244,81],[235,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[84,87],[94,88],[83,87],[104,89],[75,90],[74,91],[103,92],[97,93],[102,94],[77,95],[91,96],[76,97],[100,98],[72,99],[71,92],[101,100],[73,101],[78,102],[79,1],[82,102],[69,1],[105,103],[95,104],[86,105],[87,106],[89,107],[85,108],[88,109],[98,92],[80,110],[81,111],[90,112],[70,113],[93,104],[92,102],[96,1],[99,114],[45,1],[44,1],[49,117]],"semanticDiagnosticsPerFile":[42,52,50,55,51,56,53,54,57,62,58,61,59,160,162,163,60,164,185,170,176,174,173,175,184,179,181,182,183,177,178,180,172,171,166,165,168,169,167,161,186,107,108,109,110,111,112,63,66,64,65,113,114,115,116,117,118,119,121,120,122,123,124,106,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,142,144,145,146,147,148,149,150,68,67,159,151,152,153,154,155,156,157,158,187,188,189,214,215,190,193,212,213,203,202,200,195,208,206,210,194,207,211,196,197,209,191,198,199,201,205,216,204,192,229,228,223,225,224,217,218,220,222,226,227,219,221,230,231,232,234,233,247,246,237,238,245,239,240,241,242,243,236,244,235,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,84,94,83,104,75,74,103,97,102,77,91,76,100,72,71,101,73,78,79,82,69,105,95,86,87,89,85,88,98,80,81,90,70,93,92,96,99,45,44,43,47,48,49,46],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/LICENSE b/tools/ui/node_modules/workbox-precaching/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-precaching/PrecacheController.d.ts b/tools/ui/node_modules/workbox-precaching/PrecacheController.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bc48e4b14fdd39552e3d2573f1e8a9f5d2ba0cdb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheController.d.ts
@@ -0,0 +1,142 @@
+import { Strategy } from 'workbox-strategies/Strategy.js';
+import { RouteHandlerCallback, WorkboxPlugin } from 'workbox-core/types.js';
+import { PrecacheEntry, InstallResult, CleanupResult } from './_types.js';
+import './_version.js';
+declare global {
+    interface ServiceWorkerGlobalScope {
+        __WB_MANIFEST: Array;
+    }
+}
+interface PrecacheControllerOptions {
+    cacheName?: string;
+    plugins?: WorkboxPlugin[];
+    fallbackToNetwork?: boolean;
+}
+/**
+ * Performs efficient precaching of assets.
+ *
+ * @memberof workbox-precaching
+ */
+declare class PrecacheController {
+    private _installAndActiveListenersAdded?;
+    private readonly _strategy;
+    private readonly _urlsToCacheKeys;
+    private readonly _urlsToCacheModes;
+    private readonly _cacheKeysToIntegrities;
+    /**
+     * Create a new PrecacheController.
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] The cache to use for precaching.
+     * @param {string} [options.plugins] Plugins to use when precaching as well
+     * as responding to fetch events for precached assets.
+     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+     * get the response from the network if there's a precache miss.
+     */
+    constructor({ cacheName, plugins, fallbackToNetwork, }?: PrecacheControllerOptions);
+    /**
+     * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
+     * used to cache assets and respond to fetch events.
+     */
+    get strategy(): Strategy;
+    /**
+     * Adds items to the precache list, removing any duplicates and
+     * stores the files in the
+     * {@link workbox-core.cacheNames|"precache cache"} when the service
+     * worker installs.
+     *
+     * This method can be called multiple times.
+     *
+     * @param {Array} [entries=[]] Array of entries to precache.
+     */
+    precache(entries: Array): void;
+    /**
+     * This method will add items to the precache list, removing duplicates
+     * and ensuring the information is valid.
+     *
+     * @param {Array} entries
+     *     Array of entries to precache.
+     */
+    addToCacheList(entries: Array): void;
+    /**
+     * Precaches new and updated assets. Call this method from the service worker
+     * install event.
+     *
+     * Note: this method calls `event.waitUntil()` for you, so you do not need
+     * to call it yourself in your event handlers.
+     *
+     * @param {ExtendableEvent} event
+     * @return {Promise}
+     */
+    install(event: ExtendableEvent): Promise;
+    /**
+     * Deletes assets that are no longer present in the current precache manifest.
+     * Call this method from the service worker activate event.
+     *
+     * Note: this method calls `event.waitUntil()` for you, so you do not need
+     * to call it yourself in your event handlers.
+     *
+     * @param {ExtendableEvent} event
+     * @return {Promise}
+     */
+    activate(event: ExtendableEvent): Promise;
+    /**
+     * Returns a mapping of a precached URL to the corresponding cache key, taking
+     * into account the revision information for the URL.
+     *
+     * @return {Map} A URL to cache key mapping.
+     */
+    getURLsToCacheKeys(): Map;
+    /**
+     * Returns a list of all the URLs that have been precached by the current
+     * service worker.
+     *
+     * @return {Array} The precached URLs.
+     */
+    getCachedURLs(): Array;
+    /**
+     * Returns the cache key used for storing a given URL. If that URL is
+     * unversioned, like `/index.html', then the cache key will be the original
+     * URL with a search parameter appended to it.
+     *
+     * @param {string} url A URL whose cache key you want to look up.
+     * @return {string} The versioned URL that corresponds to a cache key
+     * for the original URL, or undefined if that URL isn't precached.
+     */
+    getCacheKeyForURL(url: string): string | undefined;
+    /**
+     * @param {string} url A cache key whose SRI you want to look up.
+     * @return {string} The subresource integrity associated with the cache key,
+     * or undefined if it's not set.
+     */
+    getIntegrityForCacheKey(cacheKey: string): string | undefined;
+    /**
+     * This acts as a drop-in replacement for
+     * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)
+     * with the following differences:
+     *
+     * - It knows what the name of the precache is, and only checks in that cache.
+     * - It allows you to pass in an "original" URL without versioning parameters,
+     * and it will automatically look up the correct cache key for the currently
+     * active revision of that URL.
+     *
+     * E.g., `matchPrecache('index.html')` will find the correct precached
+     * response for the currently active service worker, even if the actual cache
+     * key is `'/index.html?__WB_REVISION__=1234abcd'`.
+     *
+     * @param {string|Request} request The key (without revisioning parameters)
+     * to look up in the precache.
+     * @return {Promise}
+     */
+    matchPrecache(request: string | Request): Promise;
+    /**
+     * Returns a function that looks up `url` in the precache (taking into
+     * account revision information), and returns the corresponding `Response`.
+     *
+     * @param {string} url The precached URL which will be used to lookup the
+     * `Response`.
+     * @return {workbox-routing~handlerCallback}
+     */
+    createHandlerBoundToURL(url: string): RouteHandlerCallback;
+}
+export { PrecacheController };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheController.js b/tools/ui/node_modules/workbox-precaching/PrecacheController.js
new file mode 100644
index 0000000000000000000000000000000000000000..e00975e3762dc6382c39bebee04a89a651aae3d0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheController.js
@@ -0,0 +1,292 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { waitUntil } from 'workbox-core/_private/waitUntil.js';
+import { createCacheKey } from './utils/createCacheKey.js';
+import { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';
+import { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';
+import { printCleanupDetails } from './utils/printCleanupDetails.js';
+import { printInstallDetails } from './utils/printInstallDetails.js';
+import { PrecacheStrategy } from './PrecacheStrategy.js';
+import './_version.js';
+/**
+ * Performs efficient precaching of assets.
+ *
+ * @memberof workbox-precaching
+ */
+class PrecacheController {
+    /**
+     * Create a new PrecacheController.
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] The cache to use for precaching.
+     * @param {string} [options.plugins] Plugins to use when precaching as well
+     * as responding to fetch events for precached assets.
+     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+     * get the response from the network if there's a precache miss.
+     */
+    constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {
+        this._urlsToCacheKeys = new Map();
+        this._urlsToCacheModes = new Map();
+        this._cacheKeysToIntegrities = new Map();
+        this._strategy = new PrecacheStrategy({
+            cacheName: cacheNames.getPrecacheName(cacheName),
+            plugins: [
+                ...plugins,
+                new PrecacheCacheKeyPlugin({ precacheController: this }),
+            ],
+            fallbackToNetwork,
+        });
+        // Bind the install and activate methods to the instance.
+        this.install = this.install.bind(this);
+        this.activate = this.activate.bind(this);
+    }
+    /**
+     * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
+     * used to cache assets and respond to fetch events.
+     */
+    get strategy() {
+        return this._strategy;
+    }
+    /**
+     * Adds items to the precache list, removing any duplicates and
+     * stores the files in the
+     * {@link workbox-core.cacheNames|"precache cache"} when the service
+     * worker installs.
+     *
+     * This method can be called multiple times.
+     *
+     * @param {Array} [entries=[]] Array of entries to precache.
+     */
+    precache(entries) {
+        this.addToCacheList(entries);
+        if (!this._installAndActiveListenersAdded) {
+            self.addEventListener('install', this.install);
+            self.addEventListener('activate', this.activate);
+            this._installAndActiveListenersAdded = true;
+        }
+    }
+    /**
+     * This method will add items to the precache list, removing duplicates
+     * and ensuring the information is valid.
+     *
+     * @param {Array} entries
+     *     Array of entries to precache.
+     */
+    addToCacheList(entries) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isArray(entries, {
+                moduleName: 'workbox-precaching',
+                className: 'PrecacheController',
+                funcName: 'addToCacheList',
+                paramName: 'entries',
+            });
+        }
+        const urlsToWarnAbout = [];
+        for (const entry of entries) {
+            // See https://github.com/GoogleChrome/workbox/issues/2259
+            if (typeof entry === 'string') {
+                urlsToWarnAbout.push(entry);
+            }
+            else if (entry && entry.revision === undefined) {
+                urlsToWarnAbout.push(entry.url);
+            }
+            const { cacheKey, url } = createCacheKey(entry);
+            const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';
+            if (this._urlsToCacheKeys.has(url) &&
+                this._urlsToCacheKeys.get(url) !== cacheKey) {
+                throw new WorkboxError('add-to-cache-list-conflicting-entries', {
+                    firstEntry: this._urlsToCacheKeys.get(url),
+                    secondEntry: cacheKey,
+                });
+            }
+            if (typeof entry !== 'string' && entry.integrity) {
+                if (this._cacheKeysToIntegrities.has(cacheKey) &&
+                    this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {
+                    throw new WorkboxError('add-to-cache-list-conflicting-integrities', {
+                        url,
+                    });
+                }
+                this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);
+            }
+            this._urlsToCacheKeys.set(url, cacheKey);
+            this._urlsToCacheModes.set(url, cacheMode);
+            if (urlsToWarnAbout.length > 0) {
+                const warningMessage = `Workbox is precaching URLs without revision ` +
+                    `info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` +
+                    `Learn more at https://bit.ly/wb-precache`;
+                if (process.env.NODE_ENV === 'production') {
+                    // Use console directly to display this warning without bloating
+                    // bundle sizes by pulling in all of the logger codebase in prod.
+                    console.warn(warningMessage);
+                }
+                else {
+                    logger.warn(warningMessage);
+                }
+            }
+        }
+    }
+    /**
+     * Precaches new and updated assets. Call this method from the service worker
+     * install event.
+     *
+     * Note: this method calls `event.waitUntil()` for you, so you do not need
+     * to call it yourself in your event handlers.
+     *
+     * @param {ExtendableEvent} event
+     * @return {Promise}
+     */
+    install(event) {
+        // waitUntil returns Promise
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+        return waitUntil(event, async () => {
+            const installReportPlugin = new PrecacheInstallReportPlugin();
+            this.strategy.plugins.push(installReportPlugin);
+            // Cache entries one at a time.
+            // See https://github.com/GoogleChrome/workbox/issues/2528
+            for (const [url, cacheKey] of this._urlsToCacheKeys) {
+                const integrity = this._cacheKeysToIntegrities.get(cacheKey);
+                const cacheMode = this._urlsToCacheModes.get(url);
+                const request = new Request(url, {
+                    integrity,
+                    cache: cacheMode,
+                    credentials: 'same-origin',
+                });
+                await Promise.all(this.strategy.handleAll({
+                    params: { cacheKey },
+                    request,
+                    event,
+                }));
+            }
+            const { updatedURLs, notUpdatedURLs } = installReportPlugin;
+            if (process.env.NODE_ENV !== 'production') {
+                printInstallDetails(updatedURLs, notUpdatedURLs);
+            }
+            return { updatedURLs, notUpdatedURLs };
+        });
+    }
+    /**
+     * Deletes assets that are no longer present in the current precache manifest.
+     * Call this method from the service worker activate event.
+     *
+     * Note: this method calls `event.waitUntil()` for you, so you do not need
+     * to call it yourself in your event handlers.
+     *
+     * @param {ExtendableEvent} event
+     * @return {Promise}
+     */
+    activate(event) {
+        // waitUntil returns Promise
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+        return waitUntil(event, async () => {
+            const cache = await self.caches.open(this.strategy.cacheName);
+            const currentlyCachedRequests = await cache.keys();
+            const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());
+            const deletedURLs = [];
+            for (const request of currentlyCachedRequests) {
+                if (!expectedCacheKeys.has(request.url)) {
+                    await cache.delete(request);
+                    deletedURLs.push(request.url);
+                }
+            }
+            if (process.env.NODE_ENV !== 'production') {
+                printCleanupDetails(deletedURLs);
+            }
+            return { deletedURLs };
+        });
+    }
+    /**
+     * Returns a mapping of a precached URL to the corresponding cache key, taking
+     * into account the revision information for the URL.
+     *
+     * @return {Map} A URL to cache key mapping.
+     */
+    getURLsToCacheKeys() {
+        return this._urlsToCacheKeys;
+    }
+    /**
+     * Returns a list of all the URLs that have been precached by the current
+     * service worker.
+     *
+     * @return {Array} The precached URLs.
+     */
+    getCachedURLs() {
+        return [...this._urlsToCacheKeys.keys()];
+    }
+    /**
+     * Returns the cache key used for storing a given URL. If that URL is
+     * unversioned, like `/index.html', then the cache key will be the original
+     * URL with a search parameter appended to it.
+     *
+     * @param {string} url A URL whose cache key you want to look up.
+     * @return {string} The versioned URL that corresponds to a cache key
+     * for the original URL, or undefined if that URL isn't precached.
+     */
+    getCacheKeyForURL(url) {
+        const urlObject = new URL(url, location.href);
+        return this._urlsToCacheKeys.get(urlObject.href);
+    }
+    /**
+     * @param {string} url A cache key whose SRI you want to look up.
+     * @return {string} The subresource integrity associated with the cache key,
+     * or undefined if it's not set.
+     */
+    getIntegrityForCacheKey(cacheKey) {
+        return this._cacheKeysToIntegrities.get(cacheKey);
+    }
+    /**
+     * This acts as a drop-in replacement for
+     * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)
+     * with the following differences:
+     *
+     * - It knows what the name of the precache is, and only checks in that cache.
+     * - It allows you to pass in an "original" URL without versioning parameters,
+     * and it will automatically look up the correct cache key for the currently
+     * active revision of that URL.
+     *
+     * E.g., `matchPrecache('index.html')` will find the correct precached
+     * response for the currently active service worker, even if the actual cache
+     * key is `'/index.html?__WB_REVISION__=1234abcd'`.
+     *
+     * @param {string|Request} request The key (without revisioning parameters)
+     * to look up in the precache.
+     * @return {Promise}
+     */
+    async matchPrecache(request) {
+        const url = request instanceof Request ? request.url : request;
+        const cacheKey = this.getCacheKeyForURL(url);
+        if (cacheKey) {
+            const cache = await self.caches.open(this.strategy.cacheName);
+            return cache.match(cacheKey);
+        }
+        return undefined;
+    }
+    /**
+     * Returns a function that looks up `url` in the precache (taking into
+     * account revision information), and returns the corresponding `Response`.
+     *
+     * @param {string} url The precached URL which will be used to lookup the
+     * `Response`.
+     * @return {workbox-routing~handlerCallback}
+     */
+    createHandlerBoundToURL(url) {
+        const cacheKey = this.getCacheKeyForURL(url);
+        if (!cacheKey) {
+            throw new WorkboxError('non-precached-url', { url });
+        }
+        return (options) => {
+            options.request = new Request(url);
+            options.params = Object.assign({ cacheKey }, options.params);
+            return this.strategy.handle(options);
+        };
+    }
+}
+export { PrecacheController };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheController.mjs b/tools/ui/node_modules/workbox-precaching/PrecacheController.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..94dfd0f46a16292ecf61113679a36abe67dc0b43
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheController.mjs
@@ -0,0 +1 @@
+export * from './PrecacheController.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.d.ts b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5f7eeb4d02282a69d795def5562e9a3b990422ea
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.d.ts
@@ -0,0 +1,42 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import { PrecacheController } from './PrecacheController.js';
+import './_version.js';
+/**
+ * `PrecacheFallbackPlugin` allows you to specify an "offline fallback"
+ * response to be used when a given strategy is unable to generate a response.
+ *
+ * It does this by intercepting the `handlerDidError` plugin callback
+ * and returning a precached response, taking the expected revision parameter
+ * into account automatically.
+ *
+ * Unless you explicitly pass in a `PrecacheController` instance to the
+ * constructor, the default instance will be used. Generally speaking, most
+ * developers will end up using the default.
+ *
+ * @memberof workbox-precaching
+ */
+declare class PrecacheFallbackPlugin implements WorkboxPlugin {
+    private readonly _fallbackURL;
+    private readonly _precacheController;
+    /**
+     * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.
+     *
+     * @param {Object} config
+     * @param {string} config.fallbackURL A precached URL to use as the fallback
+     *     if the associated strategy can't generate a response.
+     * @param {PrecacheController} [config.precacheController] An optional
+     *     PrecacheController instance. If not provided, the default
+     *     PrecacheController will be used.
+     */
+    constructor({ fallbackURL, precacheController, }: {
+        fallbackURL: string;
+        precacheController?: PrecacheController;
+    });
+    /**
+     * @return {Promise} The precache response for the fallback URL.
+     *
+     * @private
+     */
+    handlerDidError: WorkboxPlugin['handlerDidError'];
+}
+export { PrecacheFallbackPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.js b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..e3a9dedaa3b6768c9f16e61230787e6ebb1c7722
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.js
@@ -0,0 +1,47 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * `PrecacheFallbackPlugin` allows you to specify an "offline fallback"
+ * response to be used when a given strategy is unable to generate a response.
+ *
+ * It does this by intercepting the `handlerDidError` plugin callback
+ * and returning a precached response, taking the expected revision parameter
+ * into account automatically.
+ *
+ * Unless you explicitly pass in a `PrecacheController` instance to the
+ * constructor, the default instance will be used. Generally speaking, most
+ * developers will end up using the default.
+ *
+ * @memberof workbox-precaching
+ */
+class PrecacheFallbackPlugin {
+    /**
+     * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.
+     *
+     * @param {Object} config
+     * @param {string} config.fallbackURL A precached URL to use as the fallback
+     *     if the associated strategy can't generate a response.
+     * @param {PrecacheController} [config.precacheController] An optional
+     *     PrecacheController instance. If not provided, the default
+     *     PrecacheController will be used.
+     */
+    constructor({ fallbackURL, precacheController, }) {
+        /**
+         * @return {Promise} The precache response for the fallback URL.
+         *
+         * @private
+         */
+        this.handlerDidError = () => this._precacheController.matchPrecache(this._fallbackURL);
+        this._fallbackURL = fallbackURL;
+        this._precacheController =
+            precacheController || getOrCreatePrecacheController();
+    }
+}
+export { PrecacheFallbackPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.mjs b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..6d8c04b21b745bdef28f14342f8c695fccf5a657
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheFallbackPlugin.mjs
@@ -0,0 +1 @@
+export * from './PrecacheFallbackPlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheRoute.d.ts b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..01a43c10221a66992e63ddcbba069f8a22ebf63c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.d.ts
@@ -0,0 +1,33 @@
+import { Route } from 'workbox-routing/Route.js';
+import { PrecacheRouteOptions } from './_types.js';
+import { PrecacheController } from './PrecacheController.js';
+import './_version.js';
+/**
+ * A subclass of {@link workbox-routing.Route} that takes a
+ * {@link workbox-precaching.PrecacheController}
+ * instance and uses it to match incoming requests and handle fetching
+ * responses from the precache.
+ *
+ * @memberof workbox-precaching
+ * @extends workbox-routing.Route
+ */
+declare class PrecacheRoute extends Route {
+    /**
+     * @param {PrecacheController} precacheController A `PrecacheController`
+     * instance used to both match requests and respond to fetch events.
+     * @param {Object} [options] Options to control how requests are matched
+     * against the list of precached URLs.
+     * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will
+     * check cache entries for a URLs ending with '/' to see if there is a hit when
+     * appending the `directoryIndex` value.
+     * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An
+     * array of regex's to remove search params when looking for a cache match.
+     * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will
+     * check the cache for the URL with a `.html` added to the end of the end.
+     * @param {workbox-precaching~urlManipulation} [options.urlManipulation]
+     * This is a function that should take a URL and return an array of
+     * alternative URLs that should be checked for precache matches.
+     */
+    constructor(precacheController: PrecacheController, options?: PrecacheRouteOptions);
+}
+export { PrecacheRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheRoute.js b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf2e9caee51af773af0b85966311a3be8f70cb1b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.js
@@ -0,0 +1,57 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { Route } from 'workbox-routing/Route.js';
+import { generateURLVariations } from './utils/generateURLVariations.js';
+import './_version.js';
+/**
+ * A subclass of {@link workbox-routing.Route} that takes a
+ * {@link workbox-precaching.PrecacheController}
+ * instance and uses it to match incoming requests and handle fetching
+ * responses from the precache.
+ *
+ * @memberof workbox-precaching
+ * @extends workbox-routing.Route
+ */
+class PrecacheRoute extends Route {
+    /**
+     * @param {PrecacheController} precacheController A `PrecacheController`
+     * instance used to both match requests and respond to fetch events.
+     * @param {Object} [options] Options to control how requests are matched
+     * against the list of precached URLs.
+     * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will
+     * check cache entries for a URLs ending with '/' to see if there is a hit when
+     * appending the `directoryIndex` value.
+     * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An
+     * array of regex's to remove search params when looking for a cache match.
+     * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will
+     * check the cache for the URL with a `.html` added to the end of the end.
+     * @param {workbox-precaching~urlManipulation} [options.urlManipulation]
+     * This is a function that should take a URL and return an array of
+     * alternative URLs that should be checked for precache matches.
+     */
+    constructor(precacheController, options) {
+        const match = ({ request, }) => {
+            const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
+            for (const possibleURL of generateURLVariations(request.url, options)) {
+                const cacheKey = urlsToCacheKeys.get(possibleURL);
+                if (cacheKey) {
+                    const integrity = precacheController.getIntegrityForCacheKey(cacheKey);
+                    return { cacheKey, integrity };
+                }
+            }
+            if (process.env.NODE_ENV !== 'production') {
+                logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));
+            }
+            return;
+        };
+        super(match, precacheController.strategy);
+    }
+}
+export { PrecacheRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheRoute.mjs b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..4e81c0621ac37f0ab633f4cebc81ce617a5d38e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheRoute.mjs
@@ -0,0 +1 @@
+export * from './PrecacheRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.d.ts b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..000e177ef7d04cc89f9d94f9efb00adfc7122df1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.d.ts
@@ -0,0 +1,81 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import { Strategy, StrategyOptions } from 'workbox-strategies/Strategy.js';
+import { StrategyHandler } from 'workbox-strategies/StrategyHandler.js';
+import './_version.js';
+interface PrecacheStrategyOptions extends StrategyOptions {
+    fallbackToNetwork?: boolean;
+}
+/**
+ * A {@link workbox-strategies.Strategy} implementation
+ * specifically designed to work with
+ * {@link workbox-precaching.PrecacheController}
+ * to both cache and fetch precached assets.
+ *
+ * Note: an instance of this class is created automatically when creating a
+ * `PrecacheController`; it's generally not necessary to create this yourself.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-precaching
+ */
+declare class PrecacheStrategy extends Strategy {
+    private readonly _fallbackToNetwork;
+    static readonly defaultPrecacheCacheabilityPlugin: WorkboxPlugin;
+    static readonly copyRedirectedCacheableResponsesPlugin: WorkboxPlugin;
+    /**
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to the cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
+     * of all fetch() requests made by this strategy.
+     * @param {Object} [options.matchOptions] The
+     * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
+     * for any `cache.match()` or `cache.put()` calls made by this strategy.
+     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+     * get the response from the network if there's a precache miss.
+     */
+    constructor(options?: PrecacheStrategyOptions);
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+    _handleFetch(request: Request, handler: StrategyHandler): Promise;
+    _handleInstall(request: Request, handler: StrategyHandler): Promise;
+    /**
+     * This method is complex, as there a number of things to account for:
+     *
+     * The `plugins` array can be set at construction, and/or it might be added to
+     * to at any time before the strategy is used.
+     *
+     * At the time the strategy is used (i.e. during an `install` event), there
+     * needs to be at least one plugin that implements `cacheWillUpdate` in the
+     * array, other than `copyRedirectedCacheableResponsesPlugin`.
+     *
+     * - If this method is called and there are no suitable `cacheWillUpdate`
+     * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.
+     *
+     * - If this method is called and there is exactly one `cacheWillUpdate`, then
+     * we don't have to do anything (this might be a previously added
+     * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).
+     *
+     * - If this method is called and there is more than one `cacheWillUpdate`,
+     * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,
+     * we need to remove it. (This situation is unlikely, but it could happen if
+     * the strategy is used multiple times, the first without a `cacheWillUpdate`,
+     * and then later on after manually adding a custom `cacheWillUpdate`.)
+     *
+     * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.
+     *
+     * @private
+     */
+    _useDefaultCacheabilityPluginIfNeeded(): void;
+}
+export { PrecacheStrategy };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.js b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.js
new file mode 100644
index 0000000000000000000000000000000000000000..736853a631ae41f39c8db36f550f75fe779b07df
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.js
@@ -0,0 +1,223 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { copyResponse } from 'workbox-core/copyResponse.js';
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { Strategy } from 'workbox-strategies/Strategy.js';
+import './_version.js';
+/**
+ * A {@link workbox-strategies.Strategy} implementation
+ * specifically designed to work with
+ * {@link workbox-precaching.PrecacheController}
+ * to both cache and fetch precached assets.
+ *
+ * Note: an instance of this class is created automatically when creating a
+ * `PrecacheController`; it's generally not necessary to create this yourself.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-precaching
+ */
+class PrecacheStrategy extends Strategy {
+    /**
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to the cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
+     * of all fetch() requests made by this strategy.
+     * @param {Object} [options.matchOptions] The
+     * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
+     * for any `cache.match()` or `cache.put()` calls made by this strategy.
+     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+     * get the response from the network if there's a precache miss.
+     */
+    constructor(options = {}) {
+        options.cacheName = cacheNames.getPrecacheName(options.cacheName);
+        super(options);
+        this._fallbackToNetwork =
+            options.fallbackToNetwork === false ? false : true;
+        // Redirected responses cannot be used to satisfy a navigation request, so
+        // any redirected response must be "copied" rather than cloned, so the new
+        // response doesn't contain the `redirected` flag. See:
+        // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1
+        this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);
+    }
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        const response = await handler.cacheMatch(request);
+        if (response) {
+            return response;
+        }
+        // If this is an `install` event for an entry that isn't already cached,
+        // then populate the cache.
+        if (handler.event && handler.event.type === 'install') {
+            return await this._handleInstall(request, handler);
+        }
+        // Getting here means something went wrong. An entry that should have been
+        // precached wasn't found in the cache.
+        return await this._handleFetch(request, handler);
+    }
+    async _handleFetch(request, handler) {
+        let response;
+        const params = (handler.params || {});
+        // Fall back to the network if we're configured to do so.
+        if (this._fallbackToNetwork) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.warn(`The precached response for ` +
+                    `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +
+                    `found. Falling back to the network.`);
+            }
+            const integrityInManifest = params.integrity;
+            const integrityInRequest = request.integrity;
+            const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;
+            // Do not add integrity if the original request is no-cors
+            // See https://github.com/GoogleChrome/workbox/issues/3096
+            response = await handler.fetch(new Request(request, {
+                integrity: request.mode !== 'no-cors'
+                    ? integrityInRequest || integrityInManifest
+                    : undefined,
+            }));
+            // It's only "safe" to repair the cache if we're using SRI to guarantee
+            // that the response matches the precache manifest's expectations,
+            // and there's either a) no integrity property in the incoming request
+            // or b) there is an integrity, and it matches the precache manifest.
+            // See https://github.com/GoogleChrome/workbox/issues/2858
+            // Also if the original request users no-cors we don't use integrity.
+            // See https://github.com/GoogleChrome/workbox/issues/3096
+            if (integrityInManifest &&
+                noIntegrityConflict &&
+                request.mode !== 'no-cors') {
+                this._useDefaultCacheabilityPluginIfNeeded();
+                const wasCached = await handler.cachePut(request, response.clone());
+                if (process.env.NODE_ENV !== 'production') {
+                    if (wasCached) {
+                        logger.log(`A response for ${getFriendlyURL(request.url)} ` +
+                            `was used to "repair" the precache.`);
+                    }
+                }
+            }
+        }
+        else {
+            // This shouldn't normally happen, but there are edge cases:
+            // https://github.com/GoogleChrome/workbox/issues/1441
+            throw new WorkboxError('missing-precache-entry', {
+                cacheName: this.cacheName,
+                url: request.url,
+            });
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));
+            // Workbox is going to handle the route.
+            // print the routing details to the console.
+            logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));
+            logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);
+            logger.groupCollapsed(`View request details here.`);
+            logger.log(request);
+            logger.groupEnd();
+            logger.groupCollapsed(`View response details here.`);
+            logger.log(response);
+            logger.groupEnd();
+            logger.groupEnd();
+        }
+        return response;
+    }
+    async _handleInstall(request, handler) {
+        this._useDefaultCacheabilityPluginIfNeeded();
+        const response = await handler.fetch(request);
+        // Make sure we defer cachePut() until after we know the response
+        // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737
+        const wasCached = await handler.cachePut(request, response.clone());
+        if (!wasCached) {
+            // Throwing here will lead to the `install` handler failing, which
+            // we want to do if *any* of the responses aren't safe to cache.
+            throw new WorkboxError('bad-precaching-response', {
+                url: request.url,
+                status: response.status,
+            });
+        }
+        return response;
+    }
+    /**
+     * This method is complex, as there a number of things to account for:
+     *
+     * The `plugins` array can be set at construction, and/or it might be added to
+     * to at any time before the strategy is used.
+     *
+     * At the time the strategy is used (i.e. during an `install` event), there
+     * needs to be at least one plugin that implements `cacheWillUpdate` in the
+     * array, other than `copyRedirectedCacheableResponsesPlugin`.
+     *
+     * - If this method is called and there are no suitable `cacheWillUpdate`
+     * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.
+     *
+     * - If this method is called and there is exactly one `cacheWillUpdate`, then
+     * we don't have to do anything (this might be a previously added
+     * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).
+     *
+     * - If this method is called and there is more than one `cacheWillUpdate`,
+     * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,
+     * we need to remove it. (This situation is unlikely, but it could happen if
+     * the strategy is used multiple times, the first without a `cacheWillUpdate`,
+     * and then later on after manually adding a custom `cacheWillUpdate`.)
+     *
+     * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.
+     *
+     * @private
+     */
+    _useDefaultCacheabilityPluginIfNeeded() {
+        let defaultPluginIndex = null;
+        let cacheWillUpdatePluginCount = 0;
+        for (const [index, plugin] of this.plugins.entries()) {
+            // Ignore the copy redirected plugin when determining what to do.
+            if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {
+                continue;
+            }
+            // Save the default plugin's index, in case it needs to be removed.
+            if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {
+                defaultPluginIndex = index;
+            }
+            if (plugin.cacheWillUpdate) {
+                cacheWillUpdatePluginCount++;
+            }
+        }
+        if (cacheWillUpdatePluginCount === 0) {
+            this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);
+        }
+        else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {
+            // Only remove the default plugin; multiple custom plugins are allowed.
+            this.plugins.splice(defaultPluginIndex, 1);
+        }
+        // Nothing needs to be done if cacheWillUpdatePluginCount is 1
+    }
+}
+PrecacheStrategy.defaultPrecacheCacheabilityPlugin = {
+    async cacheWillUpdate({ response }) {
+        if (!response || response.status >= 400) {
+            return null;
+        }
+        return response;
+    },
+};
+PrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {
+    async cacheWillUpdate({ response }) {
+        return response.redirected ? await copyResponse(response) : response;
+    },
+};
+export { PrecacheStrategy };
diff --git a/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.mjs b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..f6d929157560060b9b85bce1f32d7865bd5a83f6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/PrecacheStrategy.mjs
@@ -0,0 +1 @@
+export * from './PrecacheStrategy.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/README.md b/tools/ui/node_modules/workbox-precaching/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..c1f629bc4489af62d7310b25944bbd5deb026d01
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-precaching
diff --git a/tools/ui/node_modules/workbox-precaching/_types.d.ts b/tools/ui/node_modules/workbox-precaching/_types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f2b765e2f79b935c306ed1094b25fbae2ad23acd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/_types.d.ts
@@ -0,0 +1,63 @@
+import './_version.js';
+export interface InstallResult {
+    updatedURLs: string[];
+    notUpdatedURLs: string[];
+}
+export interface CleanupResult {
+    deletedCacheRequests: string[];
+}
+export declare interface PrecacheEntry {
+    integrity?: string;
+    url: string;
+    revision?: string | null;
+}
+export interface PrecacheRouteOptions {
+    directoryIndex?: string;
+    ignoreURLParametersMatching?: RegExp[];
+    cleanURLs?: boolean;
+    urlManipulation?: urlManipulation;
+}
+export type urlManipulation = ({ url }: {
+    url: URL;
+}) => URL[];
+/**
+ * @typedef {Object} InstallResult
+ * @property {Array} updatedURLs List of URLs that were updated during
+ * installation.
+ * @property {Array} notUpdatedURLs List of URLs that were already up to
+ * date.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * @typedef {Object} CleanupResult
+ * @property {Array} deletedCacheRequests List of URLs that were deleted
+ * while cleaning up the cache.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * @typedef {Object} PrecacheEntry
+ * @property {string} url URL to precache.
+ * @property {string} [revision] Revision information for the URL.
+ * @property {string} [integrity] Integrity metadata that will be used when
+ * making the network request for the URL.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * The "urlManipulation" callback can be used to determine if there are any
+ * additional permutations of a URL that should be used to check against
+ * the available precached files.
+ *
+ * For example, Workbox supports checking for '/index.html' when the URL
+ * '/' is provided. This callback allows additional, custom checks.
+ *
+ * @callback ~urlManipulation
+ * @param {Object} context
+ * @param {URL} context.url The request's URL.
+ * @return {Array} To add additional urls to test, return an Array of
+ * URLs. Please note that these **should not be strings**, but URL objects.
+ *
+ * @memberof workbox-precaching
+ */
diff --git a/tools/ui/node_modules/workbox-precaching/_types.js b/tools/ui/node_modules/workbox-precaching/_types.js
new file mode 100644
index 0000000000000000000000000000000000000000..319d76a9a72225fc2b1ea5c8515b8242341061b5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/_types.js
@@ -0,0 +1,55 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import './_version.js';
+// * * * IMPORTANT! * * *
+// ------------------------------------------------------------------------- //
+// jdsoc type definitions cannot be declared above TypeScript definitions or
+// they'll be stripped from the built `.js` files, and they'll only be in the
+// `d.ts` files, which aren't read by the jsdoc generator. As a result we
+// have to put declare them below.
+/**
+ * @typedef {Object} InstallResult
+ * @property {Array} updatedURLs List of URLs that were updated during
+ * installation.
+ * @property {Array} notUpdatedURLs List of URLs that were already up to
+ * date.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * @typedef {Object} CleanupResult
+ * @property {Array} deletedCacheRequests List of URLs that were deleted
+ * while cleaning up the cache.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * @typedef {Object} PrecacheEntry
+ * @property {string} url URL to precache.
+ * @property {string} [revision] Revision information for the URL.
+ * @property {string} [integrity] Integrity metadata that will be used when
+ * making the network request for the URL.
+ *
+ * @memberof workbox-precaching
+ */
+/**
+ * The "urlManipulation" callback can be used to determine if there are any
+ * additional permutations of a URL that should be used to check against
+ * the available precached files.
+ *
+ * For example, Workbox supports checking for '/index.html' when the URL
+ * '/' is provided. This callback allows additional, custom checks.
+ *
+ * @callback ~urlManipulation
+ * @param {Object} context
+ * @param {URL} context.url The request's URL.
+ * @return {Array} To add additional urls to test, return an Array of
+ * URLs. Please note that these **should not be strings**, but URL objects.
+ *
+ * @memberof workbox-precaching
+ */
diff --git a/tools/ui/node_modules/workbox-precaching/_types.mjs b/tools/ui/node_modules/workbox-precaching/_types.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..fb0ccdd9e49605f634b19eb6c43bd521a13a66ab
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/_types.mjs
@@ -0,0 +1 @@
+export * from './_types.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/_version.d.ts b/tools/ui/node_modules/workbox-precaching/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-precaching/_version.js b/tools/ui/node_modules/workbox-precaching/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..fe25a4861205edd324e51b6ab4f26f80c08d8e69
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:precaching:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-precaching/_version.mjs b/tools/ui/node_modules/workbox-precaching/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..07ee5cb496c86c2ebe7bc4fd2b579e52aa574260
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:precaching:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/addPlugins.d.ts b/tools/ui/node_modules/workbox-precaching/addPlugins.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..53150b15792d1bba9bfd3140c1c82dcfe332ea4c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addPlugins.d.ts
@@ -0,0 +1,11 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * Adds plugins to the precaching strategy.
+ *
+ * @param {Array} plugins
+ *
+ * @memberof workbox-precaching
+ */
+declare function addPlugins(plugins: WorkboxPlugin[]): void;
+export { addPlugins };
diff --git a/tools/ui/node_modules/workbox-precaching/addPlugins.js b/tools/ui/node_modules/workbox-precaching/addPlugins.js
new file mode 100644
index 0000000000000000000000000000000000000000..5682cd006e45bf3d6190a829f9c76e05afaf64b2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addPlugins.js
@@ -0,0 +1,21 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * Adds plugins to the precaching strategy.
+ *
+ * @param {Array} plugins
+ *
+ * @memberof workbox-precaching
+ */
+function addPlugins(plugins) {
+    const precacheController = getOrCreatePrecacheController();
+    precacheController.strategy.plugins.push(...plugins);
+}
+export { addPlugins };
diff --git a/tools/ui/node_modules/workbox-precaching/addPlugins.mjs b/tools/ui/node_modules/workbox-precaching/addPlugins.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..fe8b33761b0fb88ed6cf0b705db3e973e8cd89fd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addPlugins.mjs
@@ -0,0 +1 @@
+export * from './addPlugins.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/addRoute.d.ts b/tools/ui/node_modules/workbox-precaching/addRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a2dd7c9d40ad6bc209b67caa3a62c4420a8474c1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addRoute.d.ts
@@ -0,0 +1,19 @@
+import { PrecacheRouteOptions } from './_types.js';
+import './_version.js';
+/**
+ * Add a `fetch` listener to the service worker that will
+ * respond to
+ * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}
+ * with precached assets.
+ *
+ * Requests for assets that aren't precached, the `FetchEvent` will not be
+ * responded to, allowing the event to fall through to other `fetch` event
+ * listeners.
+ *
+ * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
+ * options.
+ *
+ * @memberof workbox-precaching
+ */
+declare function addRoute(options?: PrecacheRouteOptions): void;
+export { addRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/addRoute.js b/tools/ui/node_modules/workbox-precaching/addRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..0ac3c5ec9d59e8316d806d04fc26451e4c5c616f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addRoute.js
@@ -0,0 +1,31 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { registerRoute } from 'workbox-routing/registerRoute.js';
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import { PrecacheRoute } from './PrecacheRoute.js';
+import './_version.js';
+/**
+ * Add a `fetch` listener to the service worker that will
+ * respond to
+ * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}
+ * with precached assets.
+ *
+ * Requests for assets that aren't precached, the `FetchEvent` will not be
+ * responded to, allowing the event to fall through to other `fetch` event
+ * listeners.
+ *
+ * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
+ * options.
+ *
+ * @memberof workbox-precaching
+ */
+function addRoute(options) {
+    const precacheController = getOrCreatePrecacheController();
+    const precacheRoute = new PrecacheRoute(precacheController, options);
+    registerRoute(precacheRoute);
+}
+export { addRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/addRoute.mjs b/tools/ui/node_modules/workbox-precaching/addRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..b2edaad6da7d9c2240774431493bcd9c6d439472
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/addRoute.mjs
@@ -0,0 +1 @@
+export * from './addRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..93b1ca0d17972bc0fdf3872d74ef05f3002e101a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js
@@ -0,0 +1,1201 @@
+this.workbox = this.workbox || {};
+this.workbox.precaching = (function (exports, assert_js, cacheNames_js, logger_js, WorkboxError_js, waitUntil_js, copyResponse_js, getFriendlyURL_js, Strategy_js, registerRoute_js, Route_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:precaching:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    // Name of the search parameter used to store revision info.
+    const REVISION_SEARCH_PARAM = '__WB_REVISION__';
+    /**
+     * Converts a manifest entry into a versioned URL suitable for precaching.
+     *
+     * @param {Object|string} entry
+     * @return {string} A URL with versioning info.
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    function createCacheKey(entry) {
+      if (!entry) {
+        throw new WorkboxError_js.WorkboxError('add-to-cache-list-unexpected-type', {
+          entry
+        });
+      }
+      // If a precache manifest entry is a string, it's assumed to be a versioned
+      // URL, like '/app.abcd1234.js'. Return as-is.
+      if (typeof entry === 'string') {
+        const urlObject = new URL(entry, location.href);
+        return {
+          cacheKey: urlObject.href,
+          url: urlObject.href
+        };
+      }
+      const {
+        revision,
+        url
+      } = entry;
+      if (!url) {
+        throw new WorkboxError_js.WorkboxError('add-to-cache-list-unexpected-type', {
+          entry
+        });
+      }
+      // If there's just a URL and no revision, then it's also assumed to be a
+      // versioned URL.
+      if (!revision) {
+        const urlObject = new URL(url, location.href);
+        return {
+          cacheKey: urlObject.href,
+          url: urlObject.href
+        };
+      }
+      // Otherwise, construct a properly versioned URL using the custom Workbox
+      // search parameter along with the revision info.
+      const cacheKeyURL = new URL(url, location.href);
+      const originalURL = new URL(url, location.href);
+      cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);
+      return {
+        cacheKey: cacheKeyURL.href,
+        url: originalURL.href
+      };
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A plugin, designed to be used with PrecacheController, to determine the
+     * of assets that were updated (or not updated) during the install event.
+     *
+     * @private
+     */
+    class PrecacheInstallReportPlugin {
+      constructor() {
+        this.updatedURLs = [];
+        this.notUpdatedURLs = [];
+        this.handlerWillStart = async ({
+          request,
+          state
+        }) => {
+          // TODO: `state` should never be undefined...
+          if (state) {
+            state.originalRequest = request;
+          }
+        };
+        this.cachedResponseWillBeUsed = async ({
+          event,
+          state,
+          cachedResponse
+        }) => {
+          if (event.type === 'install') {
+            if (state && state.originalRequest && state.originalRequest instanceof Request) {
+              // TODO: `state` should never be undefined...
+              const url = state.originalRequest.url;
+              if (cachedResponse) {
+                this.notUpdatedURLs.push(url);
+              } else {
+                this.updatedURLs.push(url);
+              }
+            }
+          }
+          return cachedResponse;
+        };
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A plugin, designed to be used with PrecacheController, to translate URLs into
+     * the corresponding cache key, based on the current revision info.
+     *
+     * @private
+     */
+    class PrecacheCacheKeyPlugin {
+      constructor({
+        precacheController
+      }) {
+        this.cacheKeyWillBeUsed = async ({
+          request,
+          params
+        }) => {
+          // Params is type any, can't change right now.
+          /* eslint-disable */
+          const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) || this._precacheController.getCacheKeyForURL(request.url);
+          /* eslint-enable */
+          return cacheKey ? new Request(cacheKey, {
+            headers: request.headers
+          }) : request;
+        };
+        this._precacheController = precacheController;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @param {string} groupTitle
+     * @param {Array} deletedURLs
+     *
+     * @private
+     */
+    const logGroup = (groupTitle, deletedURLs) => {
+      logger_js.logger.groupCollapsed(groupTitle);
+      for (const url of deletedURLs) {
+        logger_js.logger.log(url);
+      }
+      logger_js.logger.groupEnd();
+    };
+    /**
+     * @param {Array} deletedURLs
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    function printCleanupDetails(deletedURLs) {
+      const deletionCount = deletedURLs.length;
+      if (deletionCount > 0) {
+        logger_js.logger.groupCollapsed(`During precaching cleanup, ` + `${deletionCount} cached ` + `request${deletionCount === 1 ? ' was' : 's were'} deleted.`);
+        logGroup('Deleted Cache Requests', deletedURLs);
+        logger_js.logger.groupEnd();
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @param {string} groupTitle
+     * @param {Array} urls
+     *
+     * @private
+     */
+    function _nestedGroup(groupTitle, urls) {
+      if (urls.length === 0) {
+        return;
+      }
+      logger_js.logger.groupCollapsed(groupTitle);
+      for (const url of urls) {
+        logger_js.logger.log(url);
+      }
+      logger_js.logger.groupEnd();
+    }
+    /**
+     * @param {Array} urlsToPrecache
+     * @param {Array} urlsAlreadyPrecached
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {
+      const precachedCount = urlsToPrecache.length;
+      const alreadyPrecachedCount = urlsAlreadyPrecached.length;
+      if (precachedCount || alreadyPrecachedCount) {
+        let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`;
+        if (alreadyPrecachedCount > 0) {
+          message += ` ${alreadyPrecachedCount} ` + `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;
+        }
+        logger_js.logger.groupCollapsed(message);
+        _nestedGroup(`View newly precached URLs.`, urlsToPrecache);
+        _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);
+        logger_js.logger.groupEnd();
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A {@link workbox-strategies.Strategy} implementation
+     * specifically designed to work with
+     * {@link workbox-precaching.PrecacheController}
+     * to both cache and fetch precached assets.
+     *
+     * Note: an instance of this class is created automatically when creating a
+     * `PrecacheController`; it's generally not necessary to create this yourself.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-precaching
+     */
+    class PrecacheStrategy extends Strategy_js.Strategy {
+      /**
+       *
+       * @param {Object} [options]
+       * @param {string} [options.cacheName] Cache name to store and retrieve
+       * requests. Defaults to the cache names provided by
+       * {@link workbox-core.cacheNames}.
+       * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
+       * to use in conjunction with this caching strategy.
+       * @param {Object} [options.fetchOptions] Values passed along to the
+       * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
+       * of all fetch() requests made by this strategy.
+       * @param {Object} [options.matchOptions] The
+       * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
+       * for any `cache.match()` or `cache.put()` calls made by this strategy.
+       * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+       * get the response from the network if there's a precache miss.
+       */
+      constructor(options = {}) {
+        options.cacheName = cacheNames_js.cacheNames.getPrecacheName(options.cacheName);
+        super(options);
+        this._fallbackToNetwork = options.fallbackToNetwork === false ? false : true;
+        // Redirected responses cannot be used to satisfy a navigation request, so
+        // any redirected response must be "copied" rather than cloned, so the new
+        // response doesn't contain the `redirected` flag. See:
+        // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1
+        this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);
+      }
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        const response = await handler.cacheMatch(request);
+        if (response) {
+          return response;
+        }
+        // If this is an `install` event for an entry that isn't already cached,
+        // then populate the cache.
+        if (handler.event && handler.event.type === 'install') {
+          return await this._handleInstall(request, handler);
+        }
+        // Getting here means something went wrong. An entry that should have been
+        // precached wasn't found in the cache.
+        return await this._handleFetch(request, handler);
+      }
+      async _handleFetch(request, handler) {
+        let response;
+        const params = handler.params || {};
+        // Fall back to the network if we're configured to do so.
+        if (this._fallbackToNetwork) {
+          {
+            logger_js.logger.warn(`The precached response for ` + `${getFriendlyURL_js.getFriendlyURL(request.url)} in ${this.cacheName} was not ` + `found. Falling back to the network.`);
+          }
+          const integrityInManifest = params.integrity;
+          const integrityInRequest = request.integrity;
+          const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;
+          // Do not add integrity if the original request is no-cors
+          // See https://github.com/GoogleChrome/workbox/issues/3096
+          response = await handler.fetch(new Request(request, {
+            integrity: request.mode !== 'no-cors' ? integrityInRequest || integrityInManifest : undefined
+          }));
+          // It's only "safe" to repair the cache if we're using SRI to guarantee
+          // that the response matches the precache manifest's expectations,
+          // and there's either a) no integrity property in the incoming request
+          // or b) there is an integrity, and it matches the precache manifest.
+          // See https://github.com/GoogleChrome/workbox/issues/2858
+          // Also if the original request users no-cors we don't use integrity.
+          // See https://github.com/GoogleChrome/workbox/issues/3096
+          if (integrityInManifest && noIntegrityConflict && request.mode !== 'no-cors') {
+            this._useDefaultCacheabilityPluginIfNeeded();
+            const wasCached = await handler.cachePut(request, response.clone());
+            {
+              if (wasCached) {
+                logger_js.logger.log(`A response for ${getFriendlyURL_js.getFriendlyURL(request.url)} ` + `was used to "repair" the precache.`);
+              }
+            }
+          }
+        } else {
+          // This shouldn't normally happen, but there are edge cases:
+          // https://github.com/GoogleChrome/workbox/issues/1441
+          throw new WorkboxError_js.WorkboxError('missing-precache-entry', {
+            cacheName: this.cacheName,
+            url: request.url
+          });
+        }
+        {
+          const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));
+          // Workbox is going to handle the route.
+          // print the routing details to the console.
+          logger_js.logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL_js.getFriendlyURL(request.url));
+          logger_js.logger.log(`Serving the precached url: ${getFriendlyURL_js.getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);
+          logger_js.logger.groupCollapsed(`View request details here.`);
+          logger_js.logger.log(request);
+          logger_js.logger.groupEnd();
+          logger_js.logger.groupCollapsed(`View response details here.`);
+          logger_js.logger.log(response);
+          logger_js.logger.groupEnd();
+          logger_js.logger.groupEnd();
+        }
+        return response;
+      }
+      async _handleInstall(request, handler) {
+        this._useDefaultCacheabilityPluginIfNeeded();
+        const response = await handler.fetch(request);
+        // Make sure we defer cachePut() until after we know the response
+        // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737
+        const wasCached = await handler.cachePut(request, response.clone());
+        if (!wasCached) {
+          // Throwing here will lead to the `install` handler failing, which
+          // we want to do if *any* of the responses aren't safe to cache.
+          throw new WorkboxError_js.WorkboxError('bad-precaching-response', {
+            url: request.url,
+            status: response.status
+          });
+        }
+        return response;
+      }
+      /**
+       * This method is complex, as there a number of things to account for:
+       *
+       * The `plugins` array can be set at construction, and/or it might be added to
+       * to at any time before the strategy is used.
+       *
+       * At the time the strategy is used (i.e. during an `install` event), there
+       * needs to be at least one plugin that implements `cacheWillUpdate` in the
+       * array, other than `copyRedirectedCacheableResponsesPlugin`.
+       *
+       * - If this method is called and there are no suitable `cacheWillUpdate`
+       * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.
+       *
+       * - If this method is called and there is exactly one `cacheWillUpdate`, then
+       * we don't have to do anything (this might be a previously added
+       * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).
+       *
+       * - If this method is called and there is more than one `cacheWillUpdate`,
+       * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,
+       * we need to remove it. (This situation is unlikely, but it could happen if
+       * the strategy is used multiple times, the first without a `cacheWillUpdate`,
+       * and then later on after manually adding a custom `cacheWillUpdate`.)
+       *
+       * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.
+       *
+       * @private
+       */
+      _useDefaultCacheabilityPluginIfNeeded() {
+        let defaultPluginIndex = null;
+        let cacheWillUpdatePluginCount = 0;
+        for (const [index, plugin] of this.plugins.entries()) {
+          // Ignore the copy redirected plugin when determining what to do.
+          if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {
+            continue;
+          }
+          // Save the default plugin's index, in case it needs to be removed.
+          if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {
+            defaultPluginIndex = index;
+          }
+          if (plugin.cacheWillUpdate) {
+            cacheWillUpdatePluginCount++;
+          }
+        }
+        if (cacheWillUpdatePluginCount === 0) {
+          this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);
+        } else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {
+          // Only remove the default plugin; multiple custom plugins are allowed.
+          this.plugins.splice(defaultPluginIndex, 1);
+        }
+        // Nothing needs to be done if cacheWillUpdatePluginCount is 1
+      }
+    }
+    PrecacheStrategy.defaultPrecacheCacheabilityPlugin = {
+      async cacheWillUpdate({
+        response
+      }) {
+        if (!response || response.status >= 400) {
+          return null;
+        }
+        return response;
+      }
+    };
+    PrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {
+      async cacheWillUpdate({
+        response
+      }) {
+        return response.redirected ? await copyResponse_js.copyResponse(response) : response;
+      }
+    };
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Performs efficient precaching of assets.
+     *
+     * @memberof workbox-precaching
+     */
+    class PrecacheController {
+      /**
+       * Create a new PrecacheController.
+       *
+       * @param {Object} [options]
+       * @param {string} [options.cacheName] The cache to use for precaching.
+       * @param {string} [options.plugins] Plugins to use when precaching as well
+       * as responding to fetch events for precached assets.
+       * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+       * get the response from the network if there's a precache miss.
+       */
+      constructor({
+        cacheName,
+        plugins = [],
+        fallbackToNetwork = true
+      } = {}) {
+        this._urlsToCacheKeys = new Map();
+        this._urlsToCacheModes = new Map();
+        this._cacheKeysToIntegrities = new Map();
+        this._strategy = new PrecacheStrategy({
+          cacheName: cacheNames_js.cacheNames.getPrecacheName(cacheName),
+          plugins: [...plugins, new PrecacheCacheKeyPlugin({
+            precacheController: this
+          })],
+          fallbackToNetwork
+        });
+        // Bind the install and activate methods to the instance.
+        this.install = this.install.bind(this);
+        this.activate = this.activate.bind(this);
+      }
+      /**
+       * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
+       * used to cache assets and respond to fetch events.
+       */
+      get strategy() {
+        return this._strategy;
+      }
+      /**
+       * Adds items to the precache list, removing any duplicates and
+       * stores the files in the
+       * {@link workbox-core.cacheNames|"precache cache"} when the service
+       * worker installs.
+       *
+       * This method can be called multiple times.
+       *
+       * @param {Array} [entries=[]] Array of entries to precache.
+       */
+      precache(entries) {
+        this.addToCacheList(entries);
+        if (!this._installAndActiveListenersAdded) {
+          self.addEventListener('install', this.install);
+          self.addEventListener('activate', this.activate);
+          this._installAndActiveListenersAdded = true;
+        }
+      }
+      /**
+       * This method will add items to the precache list, removing duplicates
+       * and ensuring the information is valid.
+       *
+       * @param {Array} entries
+       *     Array of entries to precache.
+       */
+      addToCacheList(entries) {
+        {
+          assert_js.assert.isArray(entries, {
+            moduleName: 'workbox-precaching',
+            className: 'PrecacheController',
+            funcName: 'addToCacheList',
+            paramName: 'entries'
+          });
+        }
+        const urlsToWarnAbout = [];
+        for (const entry of entries) {
+          // See https://github.com/GoogleChrome/workbox/issues/2259
+          if (typeof entry === 'string') {
+            urlsToWarnAbout.push(entry);
+          } else if (entry && entry.revision === undefined) {
+            urlsToWarnAbout.push(entry.url);
+          }
+          const {
+            cacheKey,
+            url
+          } = createCacheKey(entry);
+          const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';
+          if (this._urlsToCacheKeys.has(url) && this._urlsToCacheKeys.get(url) !== cacheKey) {
+            throw new WorkboxError_js.WorkboxError('add-to-cache-list-conflicting-entries', {
+              firstEntry: this._urlsToCacheKeys.get(url),
+              secondEntry: cacheKey
+            });
+          }
+          if (typeof entry !== 'string' && entry.integrity) {
+            if (this._cacheKeysToIntegrities.has(cacheKey) && this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {
+              throw new WorkboxError_js.WorkboxError('add-to-cache-list-conflicting-integrities', {
+                url
+              });
+            }
+            this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);
+          }
+          this._urlsToCacheKeys.set(url, cacheKey);
+          this._urlsToCacheModes.set(url, cacheMode);
+          if (urlsToWarnAbout.length > 0) {
+            const warningMessage = `Workbox is precaching URLs without revision ` + `info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` + `Learn more at https://bit.ly/wb-precache`;
+            {
+              logger_js.logger.warn(warningMessage);
+            }
+          }
+        }
+      }
+      /**
+       * Precaches new and updated assets. Call this method from the service worker
+       * install event.
+       *
+       * Note: this method calls `event.waitUntil()` for you, so you do not need
+       * to call it yourself in your event handlers.
+       *
+       * @param {ExtendableEvent} event
+       * @return {Promise}
+       */
+      install(event) {
+        // waitUntil returns Promise
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+        return waitUntil_js.waitUntil(event, async () => {
+          const installReportPlugin = new PrecacheInstallReportPlugin();
+          this.strategy.plugins.push(installReportPlugin);
+          // Cache entries one at a time.
+          // See https://github.com/GoogleChrome/workbox/issues/2528
+          for (const [url, cacheKey] of this._urlsToCacheKeys) {
+            const integrity = this._cacheKeysToIntegrities.get(cacheKey);
+            const cacheMode = this._urlsToCacheModes.get(url);
+            const request = new Request(url, {
+              integrity,
+              cache: cacheMode,
+              credentials: 'same-origin'
+            });
+            await Promise.all(this.strategy.handleAll({
+              params: {
+                cacheKey
+              },
+              request,
+              event
+            }));
+          }
+          const {
+            updatedURLs,
+            notUpdatedURLs
+          } = installReportPlugin;
+          {
+            printInstallDetails(updatedURLs, notUpdatedURLs);
+          }
+          return {
+            updatedURLs,
+            notUpdatedURLs
+          };
+        });
+      }
+      /**
+       * Deletes assets that are no longer present in the current precache manifest.
+       * Call this method from the service worker activate event.
+       *
+       * Note: this method calls `event.waitUntil()` for you, so you do not need
+       * to call it yourself in your event handlers.
+       *
+       * @param {ExtendableEvent} event
+       * @return {Promise}
+       */
+      activate(event) {
+        // waitUntil returns Promise
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+        return waitUntil_js.waitUntil(event, async () => {
+          const cache = await self.caches.open(this.strategy.cacheName);
+          const currentlyCachedRequests = await cache.keys();
+          const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());
+          const deletedURLs = [];
+          for (const request of currentlyCachedRequests) {
+            if (!expectedCacheKeys.has(request.url)) {
+              await cache.delete(request);
+              deletedURLs.push(request.url);
+            }
+          }
+          {
+            printCleanupDetails(deletedURLs);
+          }
+          return {
+            deletedURLs
+          };
+        });
+      }
+      /**
+       * Returns a mapping of a precached URL to the corresponding cache key, taking
+       * into account the revision information for the URL.
+       *
+       * @return {Map} A URL to cache key mapping.
+       */
+      getURLsToCacheKeys() {
+        return this._urlsToCacheKeys;
+      }
+      /**
+       * Returns a list of all the URLs that have been precached by the current
+       * service worker.
+       *
+       * @return {Array} The precached URLs.
+       */
+      getCachedURLs() {
+        return [...this._urlsToCacheKeys.keys()];
+      }
+      /**
+       * Returns the cache key used for storing a given URL. If that URL is
+       * unversioned, like `/index.html', then the cache key will be the original
+       * URL with a search parameter appended to it.
+       *
+       * @param {string} url A URL whose cache key you want to look up.
+       * @return {string} The versioned URL that corresponds to a cache key
+       * for the original URL, or undefined if that URL isn't precached.
+       */
+      getCacheKeyForURL(url) {
+        const urlObject = new URL(url, location.href);
+        return this._urlsToCacheKeys.get(urlObject.href);
+      }
+      /**
+       * @param {string} url A cache key whose SRI you want to look up.
+       * @return {string} The subresource integrity associated with the cache key,
+       * or undefined if it's not set.
+       */
+      getIntegrityForCacheKey(cacheKey) {
+        return this._cacheKeysToIntegrities.get(cacheKey);
+      }
+      /**
+       * This acts as a drop-in replacement for
+       * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)
+       * with the following differences:
+       *
+       * - It knows what the name of the precache is, and only checks in that cache.
+       * - It allows you to pass in an "original" URL without versioning parameters,
+       * and it will automatically look up the correct cache key for the currently
+       * active revision of that URL.
+       *
+       * E.g., `matchPrecache('index.html')` will find the correct precached
+       * response for the currently active service worker, even if the actual cache
+       * key is `'/index.html?__WB_REVISION__=1234abcd'`.
+       *
+       * @param {string|Request} request The key (without revisioning parameters)
+       * to look up in the precache.
+       * @return {Promise}
+       */
+      async matchPrecache(request) {
+        const url = request instanceof Request ? request.url : request;
+        const cacheKey = this.getCacheKeyForURL(url);
+        if (cacheKey) {
+          const cache = await self.caches.open(this.strategy.cacheName);
+          return cache.match(cacheKey);
+        }
+        return undefined;
+      }
+      /**
+       * Returns a function that looks up `url` in the precache (taking into
+       * account revision information), and returns the corresponding `Response`.
+       *
+       * @param {string} url The precached URL which will be used to lookup the
+       * `Response`.
+       * @return {workbox-routing~handlerCallback}
+       */
+      createHandlerBoundToURL(url) {
+        const cacheKey = this.getCacheKeyForURL(url);
+        if (!cacheKey) {
+          throw new WorkboxError_js.WorkboxError('non-precached-url', {
+            url
+          });
+        }
+        return options => {
+          options.request = new Request(url);
+          options.params = Object.assign({
+            cacheKey
+          }, options.params);
+          return this.strategy.handle(options);
+        };
+      }
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    let precacheController;
+    /**
+     * @return {PrecacheController}
+     * @private
+     */
+    const getOrCreatePrecacheController = () => {
+      if (!precacheController) {
+        precacheController = new PrecacheController();
+      }
+      return precacheController;
+    };
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Adds plugins to the precaching strategy.
+     *
+     * @param {Array} plugins
+     *
+     * @memberof workbox-precaching
+     */
+    function addPlugins(plugins) {
+      const precacheController = getOrCreatePrecacheController();
+      precacheController.strategy.plugins.push(...plugins);
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Removes any URL search parameters that should be ignored.
+     *
+     * @param {URL} urlObject The original URL.
+     * @param {Array} ignoreURLParametersMatching RegExps to test against
+     * each search parameter name. Matches mean that the search parameter should be
+     * ignored.
+     * @return {URL} The URL with any ignored search parameters removed.
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {
+      // Convert the iterable into an array at the start of the loop to make sure
+      // deletion doesn't mess up iteration.
+      for (const paramName of [...urlObject.searchParams.keys()]) {
+        if (ignoreURLParametersMatching.some(regExp => regExp.test(paramName))) {
+          urlObject.searchParams.delete(paramName);
+        }
+      }
+      return urlObject;
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Generator function that yields possible variations on the original URL to
+     * check, one at a time.
+     *
+     * @param {string} url
+     * @param {Object} options
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    function* generateURLVariations(url, {
+      ignoreURLParametersMatching = [/^utm_/, /^fbclid$/],
+      directoryIndex = 'index.html',
+      cleanURLs = true,
+      urlManipulation
+    } = {}) {
+      const urlObject = new URL(url, location.href);
+      urlObject.hash = '';
+      yield urlObject.href;
+      const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);
+      yield urlWithoutIgnoredParams.href;
+      if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {
+        const directoryURL = new URL(urlWithoutIgnoredParams.href);
+        directoryURL.pathname += directoryIndex;
+        yield directoryURL.href;
+      }
+      if (cleanURLs) {
+        const cleanURL = new URL(urlWithoutIgnoredParams.href);
+        cleanURL.pathname += '.html';
+        yield cleanURL.href;
+      }
+      if (urlManipulation) {
+        const additionalURLs = urlManipulation({
+          url: urlObject
+        });
+        for (const urlToAttempt of additionalURLs) {
+          yield urlToAttempt.href;
+        }
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A subclass of {@link workbox-routing.Route} that takes a
+     * {@link workbox-precaching.PrecacheController}
+     * instance and uses it to match incoming requests and handle fetching
+     * responses from the precache.
+     *
+     * @memberof workbox-precaching
+     * @extends workbox-routing.Route
+     */
+    class PrecacheRoute extends Route_js.Route {
+      /**
+       * @param {PrecacheController} precacheController A `PrecacheController`
+       * instance used to both match requests and respond to fetch events.
+       * @param {Object} [options] Options to control how requests are matched
+       * against the list of precached URLs.
+       * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will
+       * check cache entries for a URLs ending with '/' to see if there is a hit when
+       * appending the `directoryIndex` value.
+       * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An
+       * array of regex's to remove search params when looking for a cache match.
+       * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will
+       * check the cache for the URL with a `.html` added to the end of the end.
+       * @param {workbox-precaching~urlManipulation} [options.urlManipulation]
+       * This is a function that should take a URL and return an array of
+       * alternative URLs that should be checked for precache matches.
+       */
+      constructor(precacheController, options) {
+        const match = ({
+          request
+        }) => {
+          const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
+          for (const possibleURL of generateURLVariations(request.url, options)) {
+            const cacheKey = urlsToCacheKeys.get(possibleURL);
+            if (cacheKey) {
+              const integrity = precacheController.getIntegrityForCacheKey(cacheKey);
+              return {
+                cacheKey,
+                integrity
+              };
+            }
+          }
+          {
+            logger_js.logger.debug(`Precaching did not find a match for ` + getFriendlyURL_js.getFriendlyURL(request.url));
+          }
+          return;
+        };
+        super(match, precacheController.strategy);
+      }
+    }
+
+    /*
+      Copyright 2019 Google LLC
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Add a `fetch` listener to the service worker that will
+     * respond to
+     * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}
+     * with precached assets.
+     *
+     * Requests for assets that aren't precached, the `FetchEvent` will not be
+     * responded to, allowing the event to fall through to other `fetch` event
+     * listeners.
+     *
+     * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
+     * options.
+     *
+     * @memberof workbox-precaching
+     */
+    function addRoute(options) {
+      const precacheController = getOrCreatePrecacheController();
+      const precacheRoute = new PrecacheRoute(precacheController, options);
+      registerRoute_js.registerRoute(precacheRoute);
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const SUBSTRING_TO_FIND = '-precache-';
+    /**
+     * Cleans up incompatible precaches that were created by older versions of
+     * Workbox, by a service worker registered under the current scope.
+     *
+     * This is meant to be called as part of the `activate` event.
+     *
+     * This should be safe to use as long as you don't include `substringToFind`
+     * (defaulting to `-precache-`) in your non-precache cache names.
+     *
+     * @param {string} currentPrecacheName The cache name currently in use for
+     * precaching. This cache won't be deleted.
+     * @param {string} [substringToFind='-precache-'] Cache names which include this
+     * substring will be deleted (excluding `currentPrecacheName`).
+     * @return {Array} A list of all the cache names that were deleted.
+     *
+     * @private
+     * @memberof workbox-precaching
+     */
+    const deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {
+      const cacheNames = await self.caches.keys();
+      const cacheNamesToDelete = cacheNames.filter(cacheName => {
+        return cacheName.includes(substringToFind) && cacheName.includes(self.registration.scope) && cacheName !== currentPrecacheName;
+      });
+      await Promise.all(cacheNamesToDelete.map(cacheName => self.caches.delete(cacheName)));
+      return cacheNamesToDelete;
+    };
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Adds an `activate` event listener which will clean up incompatible
+     * precaches that were created by older versions of Workbox.
+     *
+     * @memberof workbox-precaching
+     */
+    function cleanupOutdatedCaches() {
+      // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+      self.addEventListener('activate', event => {
+        const cacheName = cacheNames_js.cacheNames.getPrecacheName();
+        event.waitUntil(deleteOutdatedCaches(cacheName).then(cachesDeleted => {
+          {
+            if (cachesDeleted.length > 0) {
+              logger_js.logger.log(`The following out-of-date precaches were cleaned up ` + `automatically:`, cachesDeleted);
+            }
+          }
+        }));
+      });
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Helper function that calls
+     * {@link PrecacheController#createHandlerBoundToURL} on the default
+     * {@link PrecacheController} instance.
+     *
+     * If you are creating your own {@link PrecacheController}, then call the
+     * {@link PrecacheController#createHandlerBoundToURL} on that instance,
+     * instead of using this function.
+     *
+     * @param {string} url The precached URL which will be used to lookup the
+     * `Response`.
+     * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
+     * response from the network if there's a precache miss.
+     * @return {workbox-routing~handlerCallback}
+     *
+     * @memberof workbox-precaching
+     */
+    function createHandlerBoundToURL(url) {
+      const precacheController = getOrCreatePrecacheController();
+      return precacheController.createHandlerBoundToURL(url);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Takes in a URL, and returns the corresponding URL that could be used to
+     * lookup the entry in the precache.
+     *
+     * If a relative URL is provided, the location of the service worker file will
+     * be used as the base.
+     *
+     * For precached entries without revision information, the cache key will be the
+     * same as the original URL.
+     *
+     * For precached entries with revision information, the cache key will be the
+     * original URL with the addition of a query parameter used for keeping track of
+     * the revision info.
+     *
+     * @param {string} url The URL whose cache key to look up.
+     * @return {string} The cache key that corresponds to that URL.
+     *
+     * @memberof workbox-precaching
+     */
+    function getCacheKeyForURL(url) {
+      const precacheController = getOrCreatePrecacheController();
+      return precacheController.getCacheKeyForURL(url);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Helper function that calls
+     * {@link PrecacheController#matchPrecache} on the default
+     * {@link PrecacheController} instance.
+     *
+     * If you are creating your own {@link PrecacheController}, then call
+     * {@link PrecacheController#matchPrecache} on that instance,
+     * instead of using this function.
+     *
+     * @param {string|Request} request The key (without revisioning parameters)
+     * to look up in the precache.
+     * @return {Promise}
+     *
+     * @memberof workbox-precaching
+     */
+    function matchPrecache(request) {
+      const precacheController = getOrCreatePrecacheController();
+      return precacheController.matchPrecache(request);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Adds items to the precache list, removing any duplicates and
+     * stores the files in the
+     * {@link workbox-core.cacheNames|"precache cache"} when the service
+     * worker installs.
+     *
+     * This method can be called multiple times.
+     *
+     * Please note: This method **will not** serve any of the cached files for you.
+     * It only precaches files. To respond to a network request you call
+     * {@link workbox-precaching.addRoute}.
+     *
+     * If you have a single array of files to precache, you can just call
+     * {@link workbox-precaching.precacheAndRoute}.
+     *
+     * @param {Array} [entries=[]] Array of entries to precache.
+     *
+     * @memberof workbox-precaching
+     */
+    function precache(entries) {
+      const precacheController = getOrCreatePrecacheController();
+      precacheController.precache(entries);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * This method will add entries to the precache list and add a route to
+     * respond to fetch events.
+     *
+     * This is a convenience method that will call
+     * {@link workbox-precaching.precache} and
+     * {@link workbox-precaching.addRoute} in a single call.
+     *
+     * @param {Array} entries Array of entries to precache.
+     * @param {Object} [options] See the
+     * {@link workbox-precaching.PrecacheRoute} options.
+     *
+     * @memberof workbox-precaching
+     */
+    function precacheAndRoute(entries, options) {
+      precache(entries);
+      addRoute(options);
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * `PrecacheFallbackPlugin` allows you to specify an "offline fallback"
+     * response to be used when a given strategy is unable to generate a response.
+     *
+     * It does this by intercepting the `handlerDidError` plugin callback
+     * and returning a precached response, taking the expected revision parameter
+     * into account automatically.
+     *
+     * Unless you explicitly pass in a `PrecacheController` instance to the
+     * constructor, the default instance will be used. Generally speaking, most
+     * developers will end up using the default.
+     *
+     * @memberof workbox-precaching
+     */
+    class PrecacheFallbackPlugin {
+      /**
+       * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.
+       *
+       * @param {Object} config
+       * @param {string} config.fallbackURL A precached URL to use as the fallback
+       *     if the associated strategy can't generate a response.
+       * @param {PrecacheController} [config.precacheController] An optional
+       *     PrecacheController instance. If not provided, the default
+       *     PrecacheController will be used.
+       */
+      constructor({
+        fallbackURL,
+        precacheController
+      }) {
+        /**
+         * @return {Promise} The precache response for the fallback URL.
+         *
+         * @private
+         */
+        this.handlerDidError = () => this._precacheController.matchPrecache(this._fallbackURL);
+        this._fallbackURL = fallbackURL;
+        this._precacheController = precacheController || getOrCreatePrecacheController();
+      }
+    }
+
+    exports.PrecacheController = PrecacheController;
+    exports.PrecacheFallbackPlugin = PrecacheFallbackPlugin;
+    exports.PrecacheRoute = PrecacheRoute;
+    exports.PrecacheStrategy = PrecacheStrategy;
+    exports.addPlugins = addPlugins;
+    exports.addRoute = addRoute;
+    exports.cleanupOutdatedCaches = cleanupOutdatedCaches;
+    exports.createHandlerBoundToURL = createHandlerBoundToURL;
+    exports.getCacheKeyForURL = getCacheKeyForURL;
+    exports.matchPrecache = matchPrecache;
+    exports.precache = precache;
+    exports.precacheAndRoute = precacheAndRoute;
+
+    return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core, workbox.core._private, workbox.strategies, workbox.routing, workbox.routing);
+//# sourceMappingURL=workbox-precaching.dev.js.map
diff --git a/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js.map b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ed61f9708c51cd436d4292e8559ef4fbf883d636
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-precaching.dev.js","sources":["../_version.js","../utils/createCacheKey.js","../utils/PrecacheInstallReportPlugin.js","../utils/PrecacheCacheKeyPlugin.js","../utils/printCleanupDetails.js","../utils/printInstallDetails.js","../PrecacheStrategy.js","../PrecacheController.js","../utils/getOrCreatePrecacheController.js","../addPlugins.js","../utils/removeIgnoredSearchParams.js","../utils/generateURLVariations.js","../PrecacheRoute.js","../addRoute.js","../utils/deleteOutdatedCaches.js","../cleanupOutdatedCaches.js","../createHandlerBoundToURL.js","../getCacheKeyForURL.js","../matchPrecache.js","../precache.js","../precacheAndRoute.js","../PrecacheFallbackPlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:precaching:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n    if (!entry) {\n        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n    }\n    // If a precache manifest entry is a string, it's assumed to be a versioned\n    // URL, like '/app.abcd1234.js'. Return as-is.\n    if (typeof entry === 'string') {\n        const urlObject = new URL(entry, location.href);\n        return {\n            cacheKey: urlObject.href,\n            url: urlObject.href,\n        };\n    }\n    const { revision, url } = entry;\n    if (!url) {\n        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n    }\n    // If there's just a URL and no revision, then it's also assumed to be a\n    // versioned URL.\n    if (!revision) {\n        const urlObject = new URL(url, location.href);\n        return {\n            cacheKey: urlObject.href,\n            url: urlObject.href,\n        };\n    }\n    // Otherwise, construct a properly versioned URL using the custom Workbox\n    // search parameter along with the revision info.\n    const cacheKeyURL = new URL(url, location.href);\n    const originalURL = new URL(url, location.href);\n    cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n    return {\n        cacheKey: cacheKeyURL.href,\n        url: originalURL.href,\n    };\n}\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n    constructor() {\n        this.updatedURLs = [];\n        this.notUpdatedURLs = [];\n        this.handlerWillStart = async ({ request, state, }) => {\n            // TODO: `state` should never be undefined...\n            if (state) {\n                state.originalRequest = request;\n            }\n        };\n        this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n            if (event.type === 'install') {\n                if (state &&\n                    state.originalRequest &&\n                    state.originalRequest instanceof Request) {\n                    // TODO: `state` should never be undefined...\n                    const url = state.originalRequest.url;\n                    if (cachedResponse) {\n                        this.notUpdatedURLs.push(url);\n                    }\n                    else {\n                        this.updatedURLs.push(url);\n                    }\n                }\n            }\n            return cachedResponse;\n        };\n    }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n    constructor({ precacheController }) {\n        this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n            // Params is type any, can't change right now.\n            /* eslint-disable */\n            const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n                this._precacheController.getCacheKeyForURL(request.url);\n            /* eslint-enable */\n            return cacheKey\n                ? new Request(cacheKey, { headers: request.headers })\n                : request;\n        };\n        this._precacheController = precacheController;\n    }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport '../_version.js';\n/**\n * @param {string} groupTitle\n * @param {Array} deletedURLs\n *\n * @private\n */\nconst logGroup = (groupTitle, deletedURLs) => {\n    logger.groupCollapsed(groupTitle);\n    for (const url of deletedURLs) {\n        logger.log(url);\n    }\n    logger.groupEnd();\n};\n/**\n * @param {Array} deletedURLs\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function printCleanupDetails(deletedURLs) {\n    const deletionCount = deletedURLs.length;\n    if (deletionCount > 0) {\n        logger.groupCollapsed(`During precaching cleanup, ` +\n            `${deletionCount} cached ` +\n            `request${deletionCount === 1 ? ' was' : 's were'} deleted.`);\n        logGroup('Deleted Cache Requests', deletedURLs);\n        logger.groupEnd();\n    }\n}\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport '../_version.js';\n/**\n * @param {string} groupTitle\n * @param {Array} urls\n *\n * @private\n */\nfunction _nestedGroup(groupTitle, urls) {\n    if (urls.length === 0) {\n        return;\n    }\n    logger.groupCollapsed(groupTitle);\n    for (const url of urls) {\n        logger.log(url);\n    }\n    logger.groupEnd();\n}\n/**\n * @param {Array} urlsToPrecache\n * @param {Array} urlsAlreadyPrecached\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {\n    const precachedCount = urlsToPrecache.length;\n    const alreadyPrecachedCount = urlsAlreadyPrecached.length;\n    if (precachedCount || alreadyPrecachedCount) {\n        let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`;\n        if (alreadyPrecachedCount > 0) {\n            message +=\n                ` ${alreadyPrecachedCount} ` +\n                    `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;\n        }\n        logger.groupCollapsed(message);\n        _nestedGroup(`View newly precached URLs.`, urlsToPrecache);\n        _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);\n        logger.groupEnd();\n    }\n}\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n    /**\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to the cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n     * of all fetch() requests made by this strategy.\n     * @param {Object} [options.matchOptions] The\n     * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n     * for any `cache.match()` or `cache.put()` calls made by this strategy.\n     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n     * get the response from the network if there's a precache miss.\n     */\n    constructor(options = {}) {\n        options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n        super(options);\n        this._fallbackToNetwork =\n            options.fallbackToNetwork === false ? false : true;\n        // Redirected responses cannot be used to satisfy a navigation request, so\n        // any redirected response must be \"copied\" rather than cloned, so the new\n        // response doesn't contain the `redirected` flag. See:\n        // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n        this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const response = await handler.cacheMatch(request);\n        if (response) {\n            return response;\n        }\n        // If this is an `install` event for an entry that isn't already cached,\n        // then populate the cache.\n        if (handler.event && handler.event.type === 'install') {\n            return await this._handleInstall(request, handler);\n        }\n        // Getting here means something went wrong. An entry that should have been\n        // precached wasn't found in the cache.\n        return await this._handleFetch(request, handler);\n    }\n    async _handleFetch(request, handler) {\n        let response;\n        const params = (handler.params || {});\n        // Fall back to the network if we're configured to do so.\n        if (this._fallbackToNetwork) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.warn(`The precached response for ` +\n                    `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n                    `found. Falling back to the network.`);\n            }\n            const integrityInManifest = params.integrity;\n            const integrityInRequest = request.integrity;\n            const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n            // Do not add integrity if the original request is no-cors\n            // See https://github.com/GoogleChrome/workbox/issues/3096\n            response = await handler.fetch(new Request(request, {\n                integrity: request.mode !== 'no-cors'\n                    ? integrityInRequest || integrityInManifest\n                    : undefined,\n            }));\n            // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n            // that the response matches the precache manifest's expectations,\n            // and there's either a) no integrity property in the incoming request\n            // or b) there is an integrity, and it matches the precache manifest.\n            // See https://github.com/GoogleChrome/workbox/issues/2858\n            // Also if the original request users no-cors we don't use integrity.\n            // See https://github.com/GoogleChrome/workbox/issues/3096\n            if (integrityInManifest &&\n                noIntegrityConflict &&\n                request.mode !== 'no-cors') {\n                this._useDefaultCacheabilityPluginIfNeeded();\n                const wasCached = await handler.cachePut(request, response.clone());\n                if (process.env.NODE_ENV !== 'production') {\n                    if (wasCached) {\n                        logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n                            `was used to \"repair\" the precache.`);\n                    }\n                }\n            }\n        }\n        else {\n            // This shouldn't normally happen, but there are edge cases:\n            // https://github.com/GoogleChrome/workbox/issues/1441\n            throw new WorkboxError('missing-precache-entry', {\n                cacheName: this.cacheName,\n                url: request.url,\n            });\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n            // Workbox is going to handle the route.\n            // print the routing details to the console.\n            logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n            logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n            logger.groupCollapsed(`View request details here.`);\n            logger.log(request);\n            logger.groupEnd();\n            logger.groupCollapsed(`View response details here.`);\n            logger.log(response);\n            logger.groupEnd();\n            logger.groupEnd();\n        }\n        return response;\n    }\n    async _handleInstall(request, handler) {\n        this._useDefaultCacheabilityPluginIfNeeded();\n        const response = await handler.fetch(request);\n        // Make sure we defer cachePut() until after we know the response\n        // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n        const wasCached = await handler.cachePut(request, response.clone());\n        if (!wasCached) {\n            // Throwing here will lead to the `install` handler failing, which\n            // we want to do if *any* of the responses aren't safe to cache.\n            throw new WorkboxError('bad-precaching-response', {\n                url: request.url,\n                status: response.status,\n            });\n        }\n        return response;\n    }\n    /**\n     * This method is complex, as there a number of things to account for:\n     *\n     * The `plugins` array can be set at construction, and/or it might be added to\n     * to at any time before the strategy is used.\n     *\n     * At the time the strategy is used (i.e. during an `install` event), there\n     * needs to be at least one plugin that implements `cacheWillUpdate` in the\n     * array, other than `copyRedirectedCacheableResponsesPlugin`.\n     *\n     * - If this method is called and there are no suitable `cacheWillUpdate`\n     * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n     *\n     * - If this method is called and there is exactly one `cacheWillUpdate`, then\n     * we don't have to do anything (this might be a previously added\n     * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n     *\n     * - If this method is called and there is more than one `cacheWillUpdate`,\n     * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n     * we need to remove it. (This situation is unlikely, but it could happen if\n     * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n     * and then later on after manually adding a custom `cacheWillUpdate`.)\n     *\n     * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n     *\n     * @private\n     */\n    _useDefaultCacheabilityPluginIfNeeded() {\n        let defaultPluginIndex = null;\n        let cacheWillUpdatePluginCount = 0;\n        for (const [index, plugin] of this.plugins.entries()) {\n            // Ignore the copy redirected plugin when determining what to do.\n            if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n                continue;\n            }\n            // Save the default plugin's index, in case it needs to be removed.\n            if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n                defaultPluginIndex = index;\n            }\n            if (plugin.cacheWillUpdate) {\n                cacheWillUpdatePluginCount++;\n            }\n        }\n        if (cacheWillUpdatePluginCount === 0) {\n            this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n        }\n        else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n            // Only remove the default plugin; multiple custom plugins are allowed.\n            this.plugins.splice(defaultPluginIndex, 1);\n        }\n        // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n    }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n    async cacheWillUpdate({ response }) {\n        if (!response || response.status >= 400) {\n            return null;\n        }\n        return response;\n    },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n    async cacheWillUpdate({ response }) {\n        return response.redirected ? await copyResponse(response) : response;\n    },\n};\nexport { PrecacheStrategy };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n    /**\n     * Create a new PrecacheController.\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] The cache to use for precaching.\n     * @param {string} [options.plugins] Plugins to use when precaching as well\n     * as responding to fetch events for precached assets.\n     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n     * get the response from the network if there's a precache miss.\n     */\n    constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n        this._urlsToCacheKeys = new Map();\n        this._urlsToCacheModes = new Map();\n        this._cacheKeysToIntegrities = new Map();\n        this._strategy = new PrecacheStrategy({\n            cacheName: cacheNames.getPrecacheName(cacheName),\n            plugins: [\n                ...plugins,\n                new PrecacheCacheKeyPlugin({ precacheController: this }),\n            ],\n            fallbackToNetwork,\n        });\n        // Bind the install and activate methods to the instance.\n        this.install = this.install.bind(this);\n        this.activate = this.activate.bind(this);\n    }\n    /**\n     * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n     * used to cache assets and respond to fetch events.\n     */\n    get strategy() {\n        return this._strategy;\n    }\n    /**\n     * Adds items to the precache list, removing any duplicates and\n     * stores the files in the\n     * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n     * worker installs.\n     *\n     * This method can be called multiple times.\n     *\n     * @param {Array} [entries=[]] Array of entries to precache.\n     */\n    precache(entries) {\n        this.addToCacheList(entries);\n        if (!this._installAndActiveListenersAdded) {\n            self.addEventListener('install', this.install);\n            self.addEventListener('activate', this.activate);\n            this._installAndActiveListenersAdded = true;\n        }\n    }\n    /**\n     * This method will add items to the precache list, removing duplicates\n     * and ensuring the information is valid.\n     *\n     * @param {Array} entries\n     *     Array of entries to precache.\n     */\n    addToCacheList(entries) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isArray(entries, {\n                moduleName: 'workbox-precaching',\n                className: 'PrecacheController',\n                funcName: 'addToCacheList',\n                paramName: 'entries',\n            });\n        }\n        const urlsToWarnAbout = [];\n        for (const entry of entries) {\n            // See https://github.com/GoogleChrome/workbox/issues/2259\n            if (typeof entry === 'string') {\n                urlsToWarnAbout.push(entry);\n            }\n            else if (entry && entry.revision === undefined) {\n                urlsToWarnAbout.push(entry.url);\n            }\n            const { cacheKey, url } = createCacheKey(entry);\n            const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n            if (this._urlsToCacheKeys.has(url) &&\n                this._urlsToCacheKeys.get(url) !== cacheKey) {\n                throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n                    firstEntry: this._urlsToCacheKeys.get(url),\n                    secondEntry: cacheKey,\n                });\n            }\n            if (typeof entry !== 'string' && entry.integrity) {\n                if (this._cacheKeysToIntegrities.has(cacheKey) &&\n                    this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n                    throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n                        url,\n                    });\n                }\n                this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n            }\n            this._urlsToCacheKeys.set(url, cacheKey);\n            this._urlsToCacheModes.set(url, cacheMode);\n            if (urlsToWarnAbout.length > 0) {\n                const warningMessage = `Workbox is precaching URLs without revision ` +\n                    `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n                    `Learn more at https://bit.ly/wb-precache`;\n                if (process.env.NODE_ENV === 'production') {\n                    // Use console directly to display this warning without bloating\n                    // bundle sizes by pulling in all of the logger codebase in prod.\n                    console.warn(warningMessage);\n                }\n                else {\n                    logger.warn(warningMessage);\n                }\n            }\n        }\n    }\n    /**\n     * Precaches new and updated assets. Call this method from the service worker\n     * install event.\n     *\n     * Note: this method calls `event.waitUntil()` for you, so you do not need\n     * to call it yourself in your event handlers.\n     *\n     * @param {ExtendableEvent} event\n     * @return {Promise}\n     */\n    install(event) {\n        // waitUntil returns Promise\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n        return waitUntil(event, async () => {\n            const installReportPlugin = new PrecacheInstallReportPlugin();\n            this.strategy.plugins.push(installReportPlugin);\n            // Cache entries one at a time.\n            // See https://github.com/GoogleChrome/workbox/issues/2528\n            for (const [url, cacheKey] of this._urlsToCacheKeys) {\n                const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n                const cacheMode = this._urlsToCacheModes.get(url);\n                const request = new Request(url, {\n                    integrity,\n                    cache: cacheMode,\n                    credentials: 'same-origin',\n                });\n                await Promise.all(this.strategy.handleAll({\n                    params: { cacheKey },\n                    request,\n                    event,\n                }));\n            }\n            const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n            if (process.env.NODE_ENV !== 'production') {\n                printInstallDetails(updatedURLs, notUpdatedURLs);\n            }\n            return { updatedURLs, notUpdatedURLs };\n        });\n    }\n    /**\n     * Deletes assets that are no longer present in the current precache manifest.\n     * Call this method from the service worker activate event.\n     *\n     * Note: this method calls `event.waitUntil()` for you, so you do not need\n     * to call it yourself in your event handlers.\n     *\n     * @param {ExtendableEvent} event\n     * @return {Promise}\n     */\n    activate(event) {\n        // waitUntil returns Promise\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n        return waitUntil(event, async () => {\n            const cache = await self.caches.open(this.strategy.cacheName);\n            const currentlyCachedRequests = await cache.keys();\n            const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n            const deletedURLs = [];\n            for (const request of currentlyCachedRequests) {\n                if (!expectedCacheKeys.has(request.url)) {\n                    await cache.delete(request);\n                    deletedURLs.push(request.url);\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                printCleanupDetails(deletedURLs);\n            }\n            return { deletedURLs };\n        });\n    }\n    /**\n     * Returns a mapping of a precached URL to the corresponding cache key, taking\n     * into account the revision information for the URL.\n     *\n     * @return {Map} A URL to cache key mapping.\n     */\n    getURLsToCacheKeys() {\n        return this._urlsToCacheKeys;\n    }\n    /**\n     * Returns a list of all the URLs that have been precached by the current\n     * service worker.\n     *\n     * @return {Array} The precached URLs.\n     */\n    getCachedURLs() {\n        return [...this._urlsToCacheKeys.keys()];\n    }\n    /**\n     * Returns the cache key used for storing a given URL. If that URL is\n     * unversioned, like `/index.html', then the cache key will be the original\n     * URL with a search parameter appended to it.\n     *\n     * @param {string} url A URL whose cache key you want to look up.\n     * @return {string} The versioned URL that corresponds to a cache key\n     * for the original URL, or undefined if that URL isn't precached.\n     */\n    getCacheKeyForURL(url) {\n        const urlObject = new URL(url, location.href);\n        return this._urlsToCacheKeys.get(urlObject.href);\n    }\n    /**\n     * @param {string} url A cache key whose SRI you want to look up.\n     * @return {string} The subresource integrity associated with the cache key,\n     * or undefined if it's not set.\n     */\n    getIntegrityForCacheKey(cacheKey) {\n        return this._cacheKeysToIntegrities.get(cacheKey);\n    }\n    /**\n     * This acts as a drop-in replacement for\n     * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n     * with the following differences:\n     *\n     * - It knows what the name of the precache is, and only checks in that cache.\n     * - It allows you to pass in an \"original\" URL without versioning parameters,\n     * and it will automatically look up the correct cache key for the currently\n     * active revision of that URL.\n     *\n     * E.g., `matchPrecache('index.html')` will find the correct precached\n     * response for the currently active service worker, even if the actual cache\n     * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n     *\n     * @param {string|Request} request The key (without revisioning parameters)\n     * to look up in the precache.\n     * @return {Promise}\n     */\n    async matchPrecache(request) {\n        const url = request instanceof Request ? request.url : request;\n        const cacheKey = this.getCacheKeyForURL(url);\n        if (cacheKey) {\n            const cache = await self.caches.open(this.strategy.cacheName);\n            return cache.match(cacheKey);\n        }\n        return undefined;\n    }\n    /**\n     * Returns a function that looks up `url` in the precache (taking into\n     * account revision information), and returns the corresponding `Response`.\n     *\n     * @param {string} url The precached URL which will be used to lookup the\n     * `Response`.\n     * @return {workbox-routing~handlerCallback}\n     */\n    createHandlerBoundToURL(url) {\n        const cacheKey = this.getCacheKeyForURL(url);\n        if (!cacheKey) {\n            throw new WorkboxError('non-precached-url', { url });\n        }\n        return (options) => {\n            options.request = new Request(url);\n            options.params = Object.assign({ cacheKey }, options.params);\n            return this.strategy.handle(options);\n        };\n    }\n}\nexport { PrecacheController };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n    if (!precacheController) {\n        precacheController = new PrecacheController();\n    }\n    return precacheController;\n};\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds plugins to the precaching strategy.\n *\n * @param {Array} plugins\n *\n * @memberof workbox-precaching\n */\nfunction addPlugins(plugins) {\n    const precacheController = getOrCreatePrecacheController();\n    precacheController.strategy.plugins.push(...plugins);\n}\nexport { addPlugins };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n    // Convert the iterable into an array at the start of the loop to make sure\n    // deletion doesn't mess up iteration.\n    for (const paramName of [...urlObject.searchParams.keys()]) {\n        if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n            urlObject.searchParams.delete(paramName);\n        }\n    }\n    return urlObject;\n}\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n    const urlObject = new URL(url, location.href);\n    urlObject.hash = '';\n    yield urlObject.href;\n    const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n    yield urlWithoutIgnoredParams.href;\n    if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n        const directoryURL = new URL(urlWithoutIgnoredParams.href);\n        directoryURL.pathname += directoryIndex;\n        yield directoryURL.href;\n    }\n    if (cleanURLs) {\n        const cleanURL = new URL(urlWithoutIgnoredParams.href);\n        cleanURL.pathname += '.html';\n        yield cleanURL.href;\n    }\n    if (urlManipulation) {\n        const additionalURLs = urlManipulation({ url: urlObject });\n        for (const urlToAttempt of additionalURLs) {\n            yield urlToAttempt.href;\n        }\n    }\n}\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n    /**\n     * @param {PrecacheController} precacheController A `PrecacheController`\n     * instance used to both match requests and respond to fetch events.\n     * @param {Object} [options] Options to control how requests are matched\n     * against the list of precached URLs.\n     * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n     * check cache entries for a URLs ending with '/' to see if there is a hit when\n     * appending the `directoryIndex` value.\n     * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n     * array of regex's to remove search params when looking for a cache match.\n     * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n     * check the cache for the URL with a `.html` added to the end of the end.\n     * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n     * This is a function that should take a URL and return an array of\n     * alternative URLs that should be checked for precache matches.\n     */\n    constructor(precacheController, options) {\n        const match = ({ request, }) => {\n            const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n            for (const possibleURL of generateURLVariations(request.url, options)) {\n                const cacheKey = urlsToCacheKeys.get(possibleURL);\n                if (cacheKey) {\n                    const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n                    return { cacheKey, integrity };\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n            }\n            return;\n        };\n        super(match, precacheController.strategy);\n    }\n}\nexport { PrecacheRoute };\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n    const precacheController = getOrCreatePrecacheController();\n    const precacheRoute = new PrecacheRoute(precacheController, options);\n    registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst SUBSTRING_TO_FIND = '-precache-';\n/**\n * Cleans up incompatible precaches that were created by older versions of\n * Workbox, by a service worker registered under the current scope.\n *\n * This is meant to be called as part of the `activate` event.\n *\n * This should be safe to use as long as you don't include `substringToFind`\n * (defaulting to `-precache-`) in your non-precache cache names.\n *\n * @param {string} currentPrecacheName The cache name currently in use for\n * precaching. This cache won't be deleted.\n * @param {string} [substringToFind='-precache-'] Cache names which include this\n * substring will be deleted (excluding `currentPrecacheName`).\n * @return {Array} A list of all the cache names that were deleted.\n *\n * @private\n * @memberof workbox-precaching\n */\nconst deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {\n    const cacheNames = await self.caches.keys();\n    const cacheNamesToDelete = cacheNames.filter((cacheName) => {\n        return (cacheName.includes(substringToFind) &&\n            cacheName.includes(self.registration.scope) &&\n            cacheName !== currentPrecacheName);\n    });\n    await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));\n    return cacheNamesToDelete;\n};\nexport { deleteOutdatedCaches };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';\nimport './_version.js';\n/**\n * Adds an `activate` event listener which will clean up incompatible\n * precaches that were created by older versions of Workbox.\n *\n * @memberof workbox-precaching\n */\nfunction cleanupOutdatedCaches() {\n    // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n    self.addEventListener('activate', ((event) => {\n        const cacheName = cacheNames.getPrecacheName();\n        event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {\n            if (process.env.NODE_ENV !== 'production') {\n                if (cachesDeleted.length > 0) {\n                    logger.log(`The following out-of-date precaches were cleaned up ` +\n                        `automatically:`, cachesDeleted);\n                }\n            }\n        }));\n    }));\n}\nexport { cleanupOutdatedCaches };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Helper function that calls\n * {@link PrecacheController#createHandlerBoundToURL} on the default\n * {@link PrecacheController} instance.\n *\n * If you are creating your own {@link PrecacheController}, then call the\n * {@link PrecacheController#createHandlerBoundToURL} on that instance,\n * instead of using this function.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {workbox-routing~handlerCallback}\n *\n * @memberof workbox-precaching\n */\nfunction createHandlerBoundToURL(url) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.createHandlerBoundToURL(url);\n}\nexport { createHandlerBoundToURL };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Helper function that calls\n * {@link PrecacheController#matchPrecache} on the default\n * {@link PrecacheController} instance.\n *\n * If you are creating your own {@link PrecacheController}, then call\n * {@link PrecacheController#matchPrecache} on that instance,\n * instead of using this function.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n *\n * @memberof workbox-precaching\n */\nfunction matchPrecache(request) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.matchPrecache(request);\n}\nexport { matchPrecache };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n    const precacheController = getOrCreatePrecacheController();\n    precacheController.precache(entries);\n}\nexport { precache };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n    precache(entries);\n    addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * `PrecacheFallbackPlugin` allows you to specify an \"offline fallback\"\n * response to be used when a given strategy is unable to generate a response.\n *\n * It does this by intercepting the `handlerDidError` plugin callback\n * and returning a precached response, taking the expected revision parameter\n * into account automatically.\n *\n * Unless you explicitly pass in a `PrecacheController` instance to the\n * constructor, the default instance will be used. Generally speaking, most\n * developers will end up using the default.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheFallbackPlugin {\n    /**\n     * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.\n     *\n     * @param {Object} config\n     * @param {string} config.fallbackURL A precached URL to use as the fallback\n     *     if the associated strategy can't generate a response.\n     * @param {PrecacheController} [config.precacheController] An optional\n     *     PrecacheController instance. If not provided, the default\n     *     PrecacheController will be used.\n     */\n    constructor({ fallbackURL, precacheController, }) {\n        /**\n         * @return {Promise} The precache response for the fallback URL.\n         *\n         * @private\n         */\n        this.handlerDidError = () => this._precacheController.matchPrecache(this._fallbackURL);\n        this._fallbackURL = fallbackURL;\n        this._precacheController =\n            precacheController || getOrCreatePrecacheController();\n    }\n}\nexport { PrecacheFallbackPlugin };\n"],"names":["self","_","e","REVISION_SEARCH_PARAM","createCacheKey","entry","WorkboxError","urlObject","URL","location","href","cacheKey","url","revision","cacheKeyURL","originalURL","searchParams","set","PrecacheInstallReportPlugin","constructor","updatedURLs","notUpdatedURLs","handlerWillStart","request","state","originalRequest","cachedResponseWillBeUsed","event","cachedResponse","type","Request","push","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","params","_precacheController","getCacheKeyForURL","headers","logGroup","groupTitle","deletedURLs","logger","groupCollapsed","log","groupEnd","printCleanupDetails","deletionCount","length","_nestedGroup","urls","printInstallDetails","urlsToPrecache","urlsAlreadyPrecached","precachedCount","alreadyPrecachedCount","message","PrecacheStrategy","Strategy","options","cacheName","cacheNames","getPrecacheName","_fallbackToNetwork","fallbackToNetwork","plugins","copyRedirectedCacheableResponsesPlugin","_handle","handler","response","cacheMatch","_handleInstall","_handleFetch","warn","getFriendlyURL","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","fetch","mode","undefined","_useDefaultCacheabilityPluginIfNeeded","wasCached","cachePut","clone","getCacheKey","status","defaultPluginIndex","cacheWillUpdatePluginCount","index","plugin","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","splice","redirected","copyResponse","PrecacheController","_urlsToCacheKeys","Map","_urlsToCacheModes","_cacheKeysToIntegrities","_strategy","install","bind","activate","strategy","precache","addToCacheList","_installAndActiveListenersAdded","addEventListener","assert","isArray","moduleName","className","funcName","paramName","urlsToWarnAbout","cacheMode","has","get","firstEntry","secondEntry","warningMessage","join","waitUntil","installReportPlugin","cache","credentials","Promise","all","handleAll","caches","open","currentlyCachedRequests","keys","expectedCacheKeys","Set","values","delete","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","matchPrecache","match","createHandlerBoundToURL","Object","assign","handle","getOrCreatePrecacheController","addPlugins","removeIgnoredSearchParams","ignoreURLParametersMatching","some","regExp","test","generateURLVariations","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","PrecacheRoute","Route","urlsToCacheKeys","possibleURL","debug","addRoute","precacheRoute","registerRoute","SUBSTRING_TO_FIND","deleteOutdatedCaches","currentPrecacheName","substringToFind","cacheNamesToDelete","filter","includes","registration","scope","map","cleanupOutdatedCaches","then","cachesDeleted","precacheAndRoute","PrecacheFallbackPlugin","fallbackURL","handlerDidError","_fallbackURL"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,0BAA0B,CAAC,IAAIC,CAAC,EAAE;IAC3C,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA,MAAMC,qBAAqB,GAAG,iBAAiB;IAC/C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,SAASC,cAAcA,CAACC,KAAK,EAAE;MAClC,IAAI,CAACA,KAAK,EAAE;IACR,IAAA,MAAM,IAAIC,4BAAY,CAAC,mCAAmC,EAAE;IAAED,MAAAA;IAAM,KAAC,CAAC;IAC1E,EAAA;IACA;IACA;IACA,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAME,SAAS,GAAG,IAAIC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;IACA;IACA;IACA;IACA,SAAS3C,uBAAuBA,CAACtI,GAAG,EAAE;IAClC,EAAA,MAAMqB,kBAAkB,GAAGqH,6BAA6B,EAAE;IAC1D,EAAA,OAAOrH,kBAAkB,CAACiH,uBAAuB,CAACtI,GAAG,CAAC;IAC1D;;IC7BA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASyB,iBAAiBA,CAACzB,GAAG,EAAE;IAC5B,EAAA,MAAMqB,kBAAkB,GAAGqH,6BAA6B,EAAE;IAC1D,EAAA,OAAOrH,kBAAkB,CAACI,iBAAiB,CAACzB,GAAG,CAAC;IACpD;;IC/BA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASoI,aAAaA,CAACzH,OAAO,EAAE;IAC5B,EAAA,MAAMU,kBAAkB,GAAGqH,6BAA6B,EAAE;IAC1D,EAAA,OAAOrH,kBAAkB,CAAC+G,aAAa,CAACzH,OAAO,CAAC;IACpD;;IC3BA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASqF,QAAQA,CAAChB,OAAO,EAAE;IACvB,EAAA,MAAM3D,kBAAkB,GAAGqH,6BAA6B,EAAE;IAC1DrH,EAAAA,kBAAkB,CAAC2E,QAAQ,CAAChB,OAAO,CAAC;IACxC;;IC/BA;IACA;;IAEA;IACA;IACA;IACA;IAIA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASkG,gBAAgBA,CAAClG,OAAO,EAAEjC,OAAO,EAAE;MACxCiD,QAAQ,CAAChB,OAAO,CAAC;MACjBkF,QAAQ,CAACnH,OAAO,CAAC;IACrB;;IC3BA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMoI,sBAAsB,CAAC;IACzB;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACI5K,EAAAA,WAAWA,CAAC;QAAE6K,WAAW;IAAE/J,IAAAA;IAAoB,GAAC,EAAE;IAC9C;IACR;IACA;IACA;IACA;IACQ,IAAA,IAAI,CAACgK,eAAe,GAAG,MAAM,IAAI,CAAC7J,mBAAmB,CAAC4G,aAAa,CAAC,IAAI,CAACkD,YAAY,CAAC;QACtF,IAAI,CAACA,YAAY,GAAGF,WAAW;IAC/B,IAAA,IAAI,CAAC5J,mBAAmB,GACpBH,kBAAkB,IAAIqH,6BAA6B,EAAE;IAC7D,EAAA;IACJ;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e90d8cdae023c06cee62043229fe12190390393
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.precaching=function(t,e,s,n,i,c,r,o){"use strict";try{self["workbox:precaching:7.4.0"]&&_()}catch(t){}function a(t){if(!t)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s.WorkboxError("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),c=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:c.href}}class h{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class l{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.U.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.U=t}}class u extends c.Strategy{constructor(t={}){t.cacheName=e.cacheNames.getPrecacheName(t.cacheName),super(t),this.K=!1!==t.fallbackToNetwork,this.plugins.push(u.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.T(t,e):await this.I(t,e))}async I(t,e){let n;const i=e.params||{};if(!this.K)throw new s.WorkboxError("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,c=t.integrity,r=!c||c===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?c||s:void 0})),s&&r&&"no-cors"!==t.mode&&(this.P(),await e.cachePut(t,n.clone()))}return n}async T(t,e){this.P();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s.WorkboxError("bad-precaching-response",{url:t.url,status:n.status});return n}P(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==u.copyRedirectedCacheableResponsesPlugin&&(n===u.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(u.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}u.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},u.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await i.copyResponse(t):t};class f{constructor({cacheName:t,plugins:s=[],fallbackToNetwork:n=!0}={}){this.F=new Map,this.B=new Map,this.S=new Map,this.u=new u({cacheName:e.cacheNames.getPrecacheName(t),plugins:[...s,new l({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.$||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.$=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=a(n),c="string"!=typeof n&&n.revision?"reload":"default";if(this.F.has(i)&&this.F.get(i)!==t)throw new s.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:this.F.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.S.has(t)&&this.S.get(t)!==n.integrity)throw new s.WorkboxError("add-to-cache-list-conflicting-integrities",{url:i});this.S.set(t,n.integrity)}if(this.F.set(i,t),this.B.set(i,c),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return n.waitUntil(t,(async()=>{const e=new h;this.strategy.plugins.push(e);for(const[e,s]of this.F){const n=this.S.get(s),i=this.B.get(e),c=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:c,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return n.waitUntil(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.F.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.F}getCachedURLs(){return[...this.F.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.F.get(e.href)}getIntegrityForCacheKey(t){return this.S.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s.WorkboxError("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let w;const d=()=>(w||(w=new f),w);class y extends o.Route{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const c=new URL(t,location.href);c.hash="",yield c.href;const r=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(c,e);if(yield r.href,s&&r.pathname.endsWith("/")){const t=new URL(r.href);t.pathname+=s,yield t.href}if(n){const t=new URL(r.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:c});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function p(t){const e=d(),s=new y(e,t);r.registerRoute(s)}function R(t){d().precache(t)}return t.PrecacheController=f,t.PrecacheFallbackPlugin=class{constructor({fallbackURL:t,precacheController:e}){this.handlerDidError=()=>this.U.matchPrecache(this.D),this.D=t,this.U=e||d()}},t.PrecacheRoute=y,t.PrecacheStrategy=u,t.addPlugins=function(t){d().strategy.plugins.push(...t)},t.addRoute=p,t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const s=e.cacheNames.getPrecacheName();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(s).then((t=>{})))}))},t.createHandlerBoundToURL=function(t){return d().createHandlerBoundToURL(t)},t.getCacheKeyForURL=function(t){return d().getCacheKeyForURL(t)},t.matchPrecache=function(t){return d().matchPrecache(t)},t.precache=R,t.precacheAndRoute=function(t,e){R(t),p(e)},t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core,workbox.strategies,workbox.routing,workbox.routing);
+//# sourceMappingURL=workbox-precaching.prod.js.map
diff --git a/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js.map b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a975e28dd6b998664c783dd72eb00472aabe562b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/build/workbox-precaching.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-precaching.prod.js","sources":["../_version.js","../utils/createCacheKey.js","../utils/PrecacheInstallReportPlugin.js","../utils/PrecacheCacheKeyPlugin.js","../PrecacheStrategy.js","../PrecacheController.js","../utils/getOrCreatePrecacheController.js","../PrecacheRoute.js","../utils/generateURLVariations.js","../utils/removeIgnoredSearchParams.js","../addRoute.js","../precache.js","../PrecacheFallbackPlugin.js","../addPlugins.js","../cleanupOutdatedCaches.js","../utils/deleteOutdatedCaches.js","../createHandlerBoundToURL.js","../getCacheKeyForURL.js","../matchPrecache.js","../precacheAndRoute.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:precaching:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n    if (!entry) {\n        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n    }\n    // If a precache manifest entry is a string, it's assumed to be a versioned\n    // URL, like '/app.abcd1234.js'. Return as-is.\n    if (typeof entry === 'string') {\n        const urlObject = new URL(entry, location.href);\n        return {\n            cacheKey: urlObject.href,\n            url: urlObject.href,\n        };\n    }\n    const { revision, url } = entry;\n    if (!url) {\n        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n    }\n    // If there's just a URL and no revision, then it's also assumed to be a\n    // versioned URL.\n    if (!revision) {\n        const urlObject = new URL(url, location.href);\n        return {\n            cacheKey: urlObject.href,\n            url: urlObject.href,\n        };\n    }\n    // Otherwise, construct a properly versioned URL using the custom Workbox\n    // search parameter along with the revision info.\n    const cacheKeyURL = new URL(url, location.href);\n    const originalURL = new URL(url, location.href);\n    cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n    return {\n        cacheKey: cacheKeyURL.href,\n        url: originalURL.href,\n    };\n}\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n    constructor() {\n        this.updatedURLs = [];\n        this.notUpdatedURLs = [];\n        this.handlerWillStart = async ({ request, state, }) => {\n            // TODO: `state` should never be undefined...\n            if (state) {\n                state.originalRequest = request;\n            }\n        };\n        this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n            if (event.type === 'install') {\n                if (state &&\n                    state.originalRequest &&\n                    state.originalRequest instanceof Request) {\n                    // TODO: `state` should never be undefined...\n                    const url = state.originalRequest.url;\n                    if (cachedResponse) {\n                        this.notUpdatedURLs.push(url);\n                    }\n                    else {\n                        this.updatedURLs.push(url);\n                    }\n                }\n            }\n            return cachedResponse;\n        };\n    }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n    constructor({ precacheController }) {\n        this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n            // Params is type any, can't change right now.\n            /* eslint-disable */\n            const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n                this._precacheController.getCacheKeyForURL(request.url);\n            /* eslint-enable */\n            return cacheKey\n                ? new Request(cacheKey, { headers: request.headers })\n                : request;\n        };\n        this._precacheController = precacheController;\n    }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n    /**\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to the cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n     * of all fetch() requests made by this strategy.\n     * @param {Object} [options.matchOptions] The\n     * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n     * for any `cache.match()` or `cache.put()` calls made by this strategy.\n     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n     * get the response from the network if there's a precache miss.\n     */\n    constructor(options = {}) {\n        options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n        super(options);\n        this._fallbackToNetwork =\n            options.fallbackToNetwork === false ? false : true;\n        // Redirected responses cannot be used to satisfy a navigation request, so\n        // any redirected response must be \"copied\" rather than cloned, so the new\n        // response doesn't contain the `redirected` flag. See:\n        // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n        this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const response = await handler.cacheMatch(request);\n        if (response) {\n            return response;\n        }\n        // If this is an `install` event for an entry that isn't already cached,\n        // then populate the cache.\n        if (handler.event && handler.event.type === 'install') {\n            return await this._handleInstall(request, handler);\n        }\n        // Getting here means something went wrong. An entry that should have been\n        // precached wasn't found in the cache.\n        return await this._handleFetch(request, handler);\n    }\n    async _handleFetch(request, handler) {\n        let response;\n        const params = (handler.params || {});\n        // Fall back to the network if we're configured to do so.\n        if (this._fallbackToNetwork) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.warn(`The precached response for ` +\n                    `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n                    `found. Falling back to the network.`);\n            }\n            const integrityInManifest = params.integrity;\n            const integrityInRequest = request.integrity;\n            const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n            // Do not add integrity if the original request is no-cors\n            // See https://github.com/GoogleChrome/workbox/issues/3096\n            response = await handler.fetch(new Request(request, {\n                integrity: request.mode !== 'no-cors'\n                    ? integrityInRequest || integrityInManifest\n                    : undefined,\n            }));\n            // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n            // that the response matches the precache manifest's expectations,\n            // and there's either a) no integrity property in the incoming request\n            // or b) there is an integrity, and it matches the precache manifest.\n            // See https://github.com/GoogleChrome/workbox/issues/2858\n            // Also if the original request users no-cors we don't use integrity.\n            // See https://github.com/GoogleChrome/workbox/issues/3096\n            if (integrityInManifest &&\n                noIntegrityConflict &&\n                request.mode !== 'no-cors') {\n                this._useDefaultCacheabilityPluginIfNeeded();\n                const wasCached = await handler.cachePut(request, response.clone());\n                if (process.env.NODE_ENV !== 'production') {\n                    if (wasCached) {\n                        logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n                            `was used to \"repair\" the precache.`);\n                    }\n                }\n            }\n        }\n        else {\n            // This shouldn't normally happen, but there are edge cases:\n            // https://github.com/GoogleChrome/workbox/issues/1441\n            throw new WorkboxError('missing-precache-entry', {\n                cacheName: this.cacheName,\n                url: request.url,\n            });\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n            // Workbox is going to handle the route.\n            // print the routing details to the console.\n            logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n            logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n            logger.groupCollapsed(`View request details here.`);\n            logger.log(request);\n            logger.groupEnd();\n            logger.groupCollapsed(`View response details here.`);\n            logger.log(response);\n            logger.groupEnd();\n            logger.groupEnd();\n        }\n        return response;\n    }\n    async _handleInstall(request, handler) {\n        this._useDefaultCacheabilityPluginIfNeeded();\n        const response = await handler.fetch(request);\n        // Make sure we defer cachePut() until after we know the response\n        // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n        const wasCached = await handler.cachePut(request, response.clone());\n        if (!wasCached) {\n            // Throwing here will lead to the `install` handler failing, which\n            // we want to do if *any* of the responses aren't safe to cache.\n            throw new WorkboxError('bad-precaching-response', {\n                url: request.url,\n                status: response.status,\n            });\n        }\n        return response;\n    }\n    /**\n     * This method is complex, as there a number of things to account for:\n     *\n     * The `plugins` array can be set at construction, and/or it might be added to\n     * to at any time before the strategy is used.\n     *\n     * At the time the strategy is used (i.e. during an `install` event), there\n     * needs to be at least one plugin that implements `cacheWillUpdate` in the\n     * array, other than `copyRedirectedCacheableResponsesPlugin`.\n     *\n     * - If this method is called and there are no suitable `cacheWillUpdate`\n     * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n     *\n     * - If this method is called and there is exactly one `cacheWillUpdate`, then\n     * we don't have to do anything (this might be a previously added\n     * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n     *\n     * - If this method is called and there is more than one `cacheWillUpdate`,\n     * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n     * we need to remove it. (This situation is unlikely, but it could happen if\n     * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n     * and then later on after manually adding a custom `cacheWillUpdate`.)\n     *\n     * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n     *\n     * @private\n     */\n    _useDefaultCacheabilityPluginIfNeeded() {\n        let defaultPluginIndex = null;\n        let cacheWillUpdatePluginCount = 0;\n        for (const [index, plugin] of this.plugins.entries()) {\n            // Ignore the copy redirected plugin when determining what to do.\n            if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n                continue;\n            }\n            // Save the default plugin's index, in case it needs to be removed.\n            if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n                defaultPluginIndex = index;\n            }\n            if (plugin.cacheWillUpdate) {\n                cacheWillUpdatePluginCount++;\n            }\n        }\n        if (cacheWillUpdatePluginCount === 0) {\n            this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n        }\n        else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n            // Only remove the default plugin; multiple custom plugins are allowed.\n            this.plugins.splice(defaultPluginIndex, 1);\n        }\n        // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n    }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n    async cacheWillUpdate({ response }) {\n        if (!response || response.status >= 400) {\n            return null;\n        }\n        return response;\n    },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n    async cacheWillUpdate({ response }) {\n        return response.redirected ? await copyResponse(response) : response;\n    },\n};\nexport { PrecacheStrategy };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n    /**\n     * Create a new PrecacheController.\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] The cache to use for precaching.\n     * @param {string} [options.plugins] Plugins to use when precaching as well\n     * as responding to fetch events for precached assets.\n     * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n     * get the response from the network if there's a precache miss.\n     */\n    constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n        this._urlsToCacheKeys = new Map();\n        this._urlsToCacheModes = new Map();\n        this._cacheKeysToIntegrities = new Map();\n        this._strategy = new PrecacheStrategy({\n            cacheName: cacheNames.getPrecacheName(cacheName),\n            plugins: [\n                ...plugins,\n                new PrecacheCacheKeyPlugin({ precacheController: this }),\n            ],\n            fallbackToNetwork,\n        });\n        // Bind the install and activate methods to the instance.\n        this.install = this.install.bind(this);\n        this.activate = this.activate.bind(this);\n    }\n    /**\n     * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n     * used to cache assets and respond to fetch events.\n     */\n    get strategy() {\n        return this._strategy;\n    }\n    /**\n     * Adds items to the precache list, removing any duplicates and\n     * stores the files in the\n     * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n     * worker installs.\n     *\n     * This method can be called multiple times.\n     *\n     * @param {Array} [entries=[]] Array of entries to precache.\n     */\n    precache(entries) {\n        this.addToCacheList(entries);\n        if (!this._installAndActiveListenersAdded) {\n            self.addEventListener('install', this.install);\n            self.addEventListener('activate', this.activate);\n            this._installAndActiveListenersAdded = true;\n        }\n    }\n    /**\n     * This method will add items to the precache list, removing duplicates\n     * and ensuring the information is valid.\n     *\n     * @param {Array} entries\n     *     Array of entries to precache.\n     */\n    addToCacheList(entries) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isArray(entries, {\n                moduleName: 'workbox-precaching',\n                className: 'PrecacheController',\n                funcName: 'addToCacheList',\n                paramName: 'entries',\n            });\n        }\n        const urlsToWarnAbout = [];\n        for (const entry of entries) {\n            // See https://github.com/GoogleChrome/workbox/issues/2259\n            if (typeof entry === 'string') {\n                urlsToWarnAbout.push(entry);\n            }\n            else if (entry && entry.revision === undefined) {\n                urlsToWarnAbout.push(entry.url);\n            }\n            const { cacheKey, url } = createCacheKey(entry);\n            const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n            if (this._urlsToCacheKeys.has(url) &&\n                this._urlsToCacheKeys.get(url) !== cacheKey) {\n                throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n                    firstEntry: this._urlsToCacheKeys.get(url),\n                    secondEntry: cacheKey,\n                });\n            }\n            if (typeof entry !== 'string' && entry.integrity) {\n                if (this._cacheKeysToIntegrities.has(cacheKey) &&\n                    this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n                    throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n                        url,\n                    });\n                }\n                this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n            }\n            this._urlsToCacheKeys.set(url, cacheKey);\n            this._urlsToCacheModes.set(url, cacheMode);\n            if (urlsToWarnAbout.length > 0) {\n                const warningMessage = `Workbox is precaching URLs without revision ` +\n                    `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n                    `Learn more at https://bit.ly/wb-precache`;\n                if (process.env.NODE_ENV === 'production') {\n                    // Use console directly to display this warning without bloating\n                    // bundle sizes by pulling in all of the logger codebase in prod.\n                    console.warn(warningMessage);\n                }\n                else {\n                    logger.warn(warningMessage);\n                }\n            }\n        }\n    }\n    /**\n     * Precaches new and updated assets. Call this method from the service worker\n     * install event.\n     *\n     * Note: this method calls `event.waitUntil()` for you, so you do not need\n     * to call it yourself in your event handlers.\n     *\n     * @param {ExtendableEvent} event\n     * @return {Promise}\n     */\n    install(event) {\n        // waitUntil returns Promise\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n        return waitUntil(event, async () => {\n            const installReportPlugin = new PrecacheInstallReportPlugin();\n            this.strategy.plugins.push(installReportPlugin);\n            // Cache entries one at a time.\n            // See https://github.com/GoogleChrome/workbox/issues/2528\n            for (const [url, cacheKey] of this._urlsToCacheKeys) {\n                const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n                const cacheMode = this._urlsToCacheModes.get(url);\n                const request = new Request(url, {\n                    integrity,\n                    cache: cacheMode,\n                    credentials: 'same-origin',\n                });\n                await Promise.all(this.strategy.handleAll({\n                    params: { cacheKey },\n                    request,\n                    event,\n                }));\n            }\n            const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n            if (process.env.NODE_ENV !== 'production') {\n                printInstallDetails(updatedURLs, notUpdatedURLs);\n            }\n            return { updatedURLs, notUpdatedURLs };\n        });\n    }\n    /**\n     * Deletes assets that are no longer present in the current precache manifest.\n     * Call this method from the service worker activate event.\n     *\n     * Note: this method calls `event.waitUntil()` for you, so you do not need\n     * to call it yourself in your event handlers.\n     *\n     * @param {ExtendableEvent} event\n     * @return {Promise}\n     */\n    activate(event) {\n        // waitUntil returns Promise\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n        return waitUntil(event, async () => {\n            const cache = await self.caches.open(this.strategy.cacheName);\n            const currentlyCachedRequests = await cache.keys();\n            const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n            const deletedURLs = [];\n            for (const request of currentlyCachedRequests) {\n                if (!expectedCacheKeys.has(request.url)) {\n                    await cache.delete(request);\n                    deletedURLs.push(request.url);\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                printCleanupDetails(deletedURLs);\n            }\n            return { deletedURLs };\n        });\n    }\n    /**\n     * Returns a mapping of a precached URL to the corresponding cache key, taking\n     * into account the revision information for the URL.\n     *\n     * @return {Map} A URL to cache key mapping.\n     */\n    getURLsToCacheKeys() {\n        return this._urlsToCacheKeys;\n    }\n    /**\n     * Returns a list of all the URLs that have been precached by the current\n     * service worker.\n     *\n     * @return {Array} The precached URLs.\n     */\n    getCachedURLs() {\n        return [...this._urlsToCacheKeys.keys()];\n    }\n    /**\n     * Returns the cache key used for storing a given URL. If that URL is\n     * unversioned, like `/index.html', then the cache key will be the original\n     * URL with a search parameter appended to it.\n     *\n     * @param {string} url A URL whose cache key you want to look up.\n     * @return {string} The versioned URL that corresponds to a cache key\n     * for the original URL, or undefined if that URL isn't precached.\n     */\n    getCacheKeyForURL(url) {\n        const urlObject = new URL(url, location.href);\n        return this._urlsToCacheKeys.get(urlObject.href);\n    }\n    /**\n     * @param {string} url A cache key whose SRI you want to look up.\n     * @return {string} The subresource integrity associated with the cache key,\n     * or undefined if it's not set.\n     */\n    getIntegrityForCacheKey(cacheKey) {\n        return this._cacheKeysToIntegrities.get(cacheKey);\n    }\n    /**\n     * This acts as a drop-in replacement for\n     * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n     * with the following differences:\n     *\n     * - It knows what the name of the precache is, and only checks in that cache.\n     * - It allows you to pass in an \"original\" URL without versioning parameters,\n     * and it will automatically look up the correct cache key for the currently\n     * active revision of that URL.\n     *\n     * E.g., `matchPrecache('index.html')` will find the correct precached\n     * response for the currently active service worker, even if the actual cache\n     * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n     *\n     * @param {string|Request} request The key (without revisioning parameters)\n     * to look up in the precache.\n     * @return {Promise}\n     */\n    async matchPrecache(request) {\n        const url = request instanceof Request ? request.url : request;\n        const cacheKey = this.getCacheKeyForURL(url);\n        if (cacheKey) {\n            const cache = await self.caches.open(this.strategy.cacheName);\n            return cache.match(cacheKey);\n        }\n        return undefined;\n    }\n    /**\n     * Returns a function that looks up `url` in the precache (taking into\n     * account revision information), and returns the corresponding `Response`.\n     *\n     * @param {string} url The precached URL which will be used to lookup the\n     * `Response`.\n     * @return {workbox-routing~handlerCallback}\n     */\n    createHandlerBoundToURL(url) {\n        const cacheKey = this.getCacheKeyForURL(url);\n        if (!cacheKey) {\n            throw new WorkboxError('non-precached-url', { url });\n        }\n        return (options) => {\n            options.request = new Request(url);\n            options.params = Object.assign({ cacheKey }, options.params);\n            return this.strategy.handle(options);\n        };\n    }\n}\nexport { PrecacheController };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n    if (!precacheController) {\n        precacheController = new PrecacheController();\n    }\n    return precacheController;\n};\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n    /**\n     * @param {PrecacheController} precacheController A `PrecacheController`\n     * instance used to both match requests and respond to fetch events.\n     * @param {Object} [options] Options to control how requests are matched\n     * against the list of precached URLs.\n     * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n     * check cache entries for a URLs ending with '/' to see if there is a hit when\n     * appending the `directoryIndex` value.\n     * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n     * array of regex's to remove search params when looking for a cache match.\n     * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n     * check the cache for the URL with a `.html` added to the end of the end.\n     * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n     * This is a function that should take a URL and return an array of\n     * alternative URLs that should be checked for precache matches.\n     */\n    constructor(precacheController, options) {\n        const match = ({ request, }) => {\n            const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n            for (const possibleURL of generateURLVariations(request.url, options)) {\n                const cacheKey = urlsToCacheKeys.get(possibleURL);\n                if (cacheKey) {\n                    const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n                    return { cacheKey, integrity };\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n            }\n            return;\n        };\n        super(match, precacheController.strategy);\n    }\n}\nexport { PrecacheRoute };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n    const urlObject = new URL(url, location.href);\n    urlObject.hash = '';\n    yield urlObject.href;\n    const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n    yield urlWithoutIgnoredParams.href;\n    if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n        const directoryURL = new URL(urlWithoutIgnoredParams.href);\n        directoryURL.pathname += directoryIndex;\n        yield directoryURL.href;\n    }\n    if (cleanURLs) {\n        const cleanURL = new URL(urlWithoutIgnoredParams.href);\n        cleanURL.pathname += '.html';\n        yield cleanURL.href;\n    }\n    if (urlManipulation) {\n        const additionalURLs = urlManipulation({ url: urlObject });\n        for (const urlToAttempt of additionalURLs) {\n            yield urlToAttempt.href;\n        }\n    }\n}\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n    // Convert the iterable into an array at the start of the loop to make sure\n    // deletion doesn't mess up iteration.\n    for (const paramName of [...urlObject.searchParams.keys()]) {\n        if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n            urlObject.searchParams.delete(paramName);\n        }\n    }\n    return urlObject;\n}\n","/*\n  Copyright 2019 Google LLC\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n    const precacheController = getOrCreatePrecacheController();\n    const precacheRoute = new PrecacheRoute(precacheController, options);\n    registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n    const precacheController = getOrCreatePrecacheController();\n    precacheController.precache(entries);\n}\nexport { precache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * `PrecacheFallbackPlugin` allows you to specify an \"offline fallback\"\n * response to be used when a given strategy is unable to generate a response.\n *\n * It does this by intercepting the `handlerDidError` plugin callback\n * and returning a precached response, taking the expected revision parameter\n * into account automatically.\n *\n * Unless you explicitly pass in a `PrecacheController` instance to the\n * constructor, the default instance will be used. Generally speaking, most\n * developers will end up using the default.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheFallbackPlugin {\n    /**\n     * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.\n     *\n     * @param {Object} config\n     * @param {string} config.fallbackURL A precached URL to use as the fallback\n     *     if the associated strategy can't generate a response.\n     * @param {PrecacheController} [config.precacheController] An optional\n     *     PrecacheController instance. If not provided, the default\n     *     PrecacheController will be used.\n     */\n    constructor({ fallbackURL, precacheController, }) {\n        /**\n         * @return {Promise} The precache response for the fallback URL.\n         *\n         * @private\n         */\n        this.handlerDidError = () => this._precacheController.matchPrecache(this._fallbackURL);\n        this._fallbackURL = fallbackURL;\n        this._precacheController =\n            precacheController || getOrCreatePrecacheController();\n    }\n}\nexport { PrecacheFallbackPlugin };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds plugins to the precaching strategy.\n *\n * @param {Array} plugins\n *\n * @memberof workbox-precaching\n */\nfunction addPlugins(plugins) {\n    const precacheController = getOrCreatePrecacheController();\n    precacheController.strategy.plugins.push(...plugins);\n}\nexport { addPlugins };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';\nimport './_version.js';\n/**\n * Adds an `activate` event listener which will clean up incompatible\n * precaches that were created by older versions of Workbox.\n *\n * @memberof workbox-precaching\n */\nfunction cleanupOutdatedCaches() {\n    // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n    self.addEventListener('activate', ((event) => {\n        const cacheName = cacheNames.getPrecacheName();\n        event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {\n            if (process.env.NODE_ENV !== 'production') {\n                if (cachesDeleted.length > 0) {\n                    logger.log(`The following out-of-date precaches were cleaned up ` +\n                        `automatically:`, cachesDeleted);\n                }\n            }\n        }));\n    }));\n}\nexport { cleanupOutdatedCaches };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst SUBSTRING_TO_FIND = '-precache-';\n/**\n * Cleans up incompatible precaches that were created by older versions of\n * Workbox, by a service worker registered under the current scope.\n *\n * This is meant to be called as part of the `activate` event.\n *\n * This should be safe to use as long as you don't include `substringToFind`\n * (defaulting to `-precache-`) in your non-precache cache names.\n *\n * @param {string} currentPrecacheName The cache name currently in use for\n * precaching. This cache won't be deleted.\n * @param {string} [substringToFind='-precache-'] Cache names which include this\n * substring will be deleted (excluding `currentPrecacheName`).\n * @return {Array} A list of all the cache names that were deleted.\n *\n * @private\n * @memberof workbox-precaching\n */\nconst deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {\n    const cacheNames = await self.caches.keys();\n    const cacheNamesToDelete = cacheNames.filter((cacheName) => {\n        return (cacheName.includes(substringToFind) &&\n            cacheName.includes(self.registration.scope) &&\n            cacheName !== currentPrecacheName);\n    });\n    await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));\n    return cacheNamesToDelete;\n};\nexport { deleteOutdatedCaches };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Helper function that calls\n * {@link PrecacheController#createHandlerBoundToURL} on the default\n * {@link PrecacheController} instance.\n *\n * If you are creating your own {@link PrecacheController}, then call the\n * {@link PrecacheController#createHandlerBoundToURL} on that instance,\n * instead of using this function.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {workbox-routing~handlerCallback}\n *\n * @memberof workbox-precaching\n */\nfunction createHandlerBoundToURL(url) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.createHandlerBoundToURL(url);\n}\nexport { createHandlerBoundToURL };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Helper function that calls\n * {@link PrecacheController#matchPrecache} on the default\n * {@link PrecacheController} instance.\n *\n * If you are creating your own {@link PrecacheController}, then call\n * {@link PrecacheController#matchPrecache} on that instance,\n * instead of using this function.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n *\n * @memberof workbox-precaching\n */\nfunction matchPrecache(request) {\n    const precacheController = getOrCreatePrecacheController();\n    return precacheController.matchPrecache(request);\n}\nexport { matchPrecache };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n    precache(entries);\n    addRoute(options);\n}\nexport { precacheAndRoute };\n"],"names":["self","_","e","createCacheKey","entry","WorkboxError","urlObject","URL","location","href","cacheKey","url","revision","cacheKeyURL","originalURL","searchParams","set","PrecacheInstallReportPlugin","constructor","this","updatedURLs","notUpdatedURLs","handlerWillStart","async","request","state","originalRequest","cachedResponseWillBeUsed","event","cachedResponse","type","Request","push","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","params","_precacheController","getCacheKeyForURL","headers","PrecacheStrategy","Strategy","options","cacheName","cacheNames","getPrecacheName","super","_fallbackToNetwork","fallbackToNetwork","plugins","copyRedirectedCacheableResponsesPlugin","handler","response","cacheMatch","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","fetch","mode","undefined","_useDefaultCacheabilityPluginIfNeeded","cachePut","clone","status","defaultPluginIndex","cacheWillUpdatePluginCount","index","plugin","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","splice","redirected","copyResponse","PrecacheController","_urlsToCacheKeys","Map","_urlsToCacheModes","_cacheKeysToIntegrities","_strategy","install","bind","activate","strategy","precache","addToCacheList","_installAndActiveListenersAdded","addEventListener","urlsToWarnAbout","cacheMode","has","get","firstEntry","secondEntry","length","warningMessage","join","console","warn","waitUntil","installReportPlugin","cache","credentials","Promise","all","handleAll","caches","open","currentlyCachedRequests","keys","expectedCacheKeys","Set","values","deletedURLs","delete","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","match","createHandlerBoundToURL","Object","assign","handle","getOrCreatePrecacheController","PrecacheRoute","Route","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","regExp","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","addRoute","precacheRoute","registerRoute","fallbackURL","handlerDidError","matchPrecache","_fallbackURL","currentPrecacheName","substringToFind","cacheNamesToDelete","filter","includes","registration","scope","map","deleteOutdatedCaches","then","cachesDeleted"],"mappings":"6FAEA,IACIA,KAAK,6BAA+BC,GACxC,CACA,MAAOC,GAAK,CCeL,SAASC,EAAeC,GAC3B,IAAKA,EACD,MAAM,IAAIC,EAAAA,aAAa,oCAAqC,CAAED,UAIlE,GAAqB,iBAAVA,EAAoB,CAC3B,MAAME,EAAY,IAAIC,IAAIH,EAAOI,SAASC,MAC1C,MAAO,CACHC,SAAUJ,EAAUG,KACpBE,IAAKL,EAAUG,KAEvB,CACA,MAAMG,SAAEA,EAAQD,IAAEA,GAAQP,EAC1B,IAAKO,EACD,MAAM,IAAIN,EAAAA,aAAa,oCAAqC,CAAED,UAIlE,IAAKQ,EAAU,CACX,MAAMN,EAAY,IAAIC,IAAII,EAAKH,SAASC,MACxC,MAAO,CACHC,SAAUJ,E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K0F,iBAAiB,YAAc9D,IAChC,MAAMe,EAAYC,EAAAA,WAAWC,kBAC7BjB,EAAM0E,UCMe/E,OAAOqI,EAAqBC,EAnB/B,gBAoBtB,MACMC,SADmB9J,KAAK6G,OAAOG,QACC+C,QAAQpH,GAClCA,EAAUqH,SAASH,IACvBlH,EAAUqH,SAAShK,KAAKiK,aAAaC,QACrCvH,IAAciH,IAGtB,aADMlD,QAAQC,IAAImD,EAAmBK,KAAKxH,GAAc3C,KAAK6G,OAAOQ,OAAO1E,MACpEmH,CAAkB,EDdLM,CAAqBzH,GAAW0H,MAAMC,QAOnD,GAEX,4BEJA,SAAiC3J,GAE7B,OAD2BmH,IACDJ,wBAAwB/G,EACtD,sBCDA,SAA2BA,GAEvB,OAD2BmH,IACDxF,kBAAkB3B,EAChD,kBCPA,SAAuBa,GAEnB,OAD2BsG,IACD4B,cAAclI,EAC5C,kCCHA,SAA0B+C,EAAS7B,GAC/B6C,EAAShB,GACT8E,EAAS3G,EACb"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.d.ts b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3686945896bdbd52fca09a6fc259741f3c75c32a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.d.ts
@@ -0,0 +1,9 @@
+import './_version.js';
+/**
+ * Adds an `activate` event listener which will clean up incompatible
+ * precaches that were created by older versions of Workbox.
+ *
+ * @memberof workbox-precaching
+ */
+declare function cleanupOutdatedCaches(): void;
+export { cleanupOutdatedCaches };
diff --git a/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.js b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.js
new file mode 100644
index 0000000000000000000000000000000000000000..36fc50158d152cca2ae0779084748a9d14fb328c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.js
@@ -0,0 +1,32 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';
+import './_version.js';
+/**
+ * Adds an `activate` event listener which will clean up incompatible
+ * precaches that were created by older versions of Workbox.
+ *
+ * @memberof workbox-precaching
+ */
+function cleanupOutdatedCaches() {
+    // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+    self.addEventListener('activate', ((event) => {
+        const cacheName = cacheNames.getPrecacheName();
+        event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {
+            if (process.env.NODE_ENV !== 'production') {
+                if (cachesDeleted.length > 0) {
+                    logger.log(`The following out-of-date precaches were cleaned up ` +
+                        `automatically:`, cachesDeleted);
+                }
+            }
+        }));
+    }));
+}
+export { cleanupOutdatedCaches };
diff --git a/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..51228ab8ee7d53f3a58257607362717ac42ae59c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs
@@ -0,0 +1 @@
+export * from './cleanupOutdatedCaches.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.d.ts b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58a54c8acc5fe5d6fcb57ae8012cc3dd9e23ceaf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.d.ts
@@ -0,0 +1,21 @@
+import { RouteHandlerCallback } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * Helper function that calls
+ * {@link PrecacheController#createHandlerBoundToURL} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call the
+ * {@link PrecacheController#createHandlerBoundToURL} on that instance,
+ * instead of using this function.
+ *
+ * @param {string} url The precached URL which will be used to lookup the
+ * `Response`.
+ * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
+ * response from the network if there's a precache miss.
+ * @return {workbox-routing~handlerCallback}
+ *
+ * @memberof workbox-precaching
+ */
+declare function createHandlerBoundToURL(url: string): RouteHandlerCallback;
+export { createHandlerBoundToURL };
diff --git a/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.js b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.js
new file mode 100644
index 0000000000000000000000000000000000000000..113d503fe0dc1e3861ce92f9268ae8cecb72a0ec
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.js
@@ -0,0 +1,31 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * Helper function that calls
+ * {@link PrecacheController#createHandlerBoundToURL} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call the
+ * {@link PrecacheController#createHandlerBoundToURL} on that instance,
+ * instead of using this function.
+ *
+ * @param {string} url The precached URL which will be used to lookup the
+ * `Response`.
+ * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
+ * response from the network if there's a precache miss.
+ * @return {workbox-routing~handlerCallback}
+ *
+ * @memberof workbox-precaching
+ */
+function createHandlerBoundToURL(url) {
+    const precacheController = getOrCreatePrecacheController();
+    return precacheController.createHandlerBoundToURL(url);
+}
+export { createHandlerBoundToURL };
diff --git a/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.mjs b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..430fb8d59e4933a7c636726bb928063bc1a6f1eb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/createHandlerBoundToURL.mjs
@@ -0,0 +1 @@
+export * from './createHandlerBoundToURL.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.d.ts b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e1131a709ecbdfb0ee2f7a0cce80f454f585e361
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.d.ts
@@ -0,0 +1,22 @@
+import './_version.js';
+/**
+ * Takes in a URL, and returns the corresponding URL that could be used to
+ * lookup the entry in the precache.
+ *
+ * If a relative URL is provided, the location of the service worker file will
+ * be used as the base.
+ *
+ * For precached entries without revision information, the cache key will be the
+ * same as the original URL.
+ *
+ * For precached entries with revision information, the cache key will be the
+ * original URL with the addition of a query parameter used for keeping track of
+ * the revision info.
+ *
+ * @param {string} url The URL whose cache key to look up.
+ * @return {string} The cache key that corresponds to that URL.
+ *
+ * @memberof workbox-precaching
+ */
+declare function getCacheKeyForURL(url: string): string | undefined;
+export { getCacheKeyForURL };
diff --git a/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.js b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2012b3a2ece39d3e6d43052d626ccd53b5d78e7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.js
@@ -0,0 +1,33 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * Takes in a URL, and returns the corresponding URL that could be used to
+ * lookup the entry in the precache.
+ *
+ * If a relative URL is provided, the location of the service worker file will
+ * be used as the base.
+ *
+ * For precached entries without revision information, the cache key will be the
+ * same as the original URL.
+ *
+ * For precached entries with revision information, the cache key will be the
+ * original URL with the addition of a query parameter used for keeping track of
+ * the revision info.
+ *
+ * @param {string} url The URL whose cache key to look up.
+ * @return {string} The cache key that corresponds to that URL.
+ *
+ * @memberof workbox-precaching
+ */
+function getCacheKeyForURL(url) {
+    const precacheController = getOrCreatePrecacheController();
+    return precacheController.getCacheKeyForURL(url);
+}
+export { getCacheKeyForURL };
diff --git a/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.mjs b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..04413e30927761b5be55f080a991e5466ae5178e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/getCacheKeyForURL.mjs
@@ -0,0 +1 @@
+export * from './getCacheKeyForURL.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/index.d.ts b/tools/ui/node_modules/workbox-precaching/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e5c18e786ca149e898371dc9ea06fcc140933112
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/index.d.ts
@@ -0,0 +1,27 @@
+import { addPlugins } from './addPlugins.js';
+import { addRoute } from './addRoute.js';
+import { cleanupOutdatedCaches } from './cleanupOutdatedCaches.js';
+import { createHandlerBoundToURL } from './createHandlerBoundToURL.js';
+import { getCacheKeyForURL } from './getCacheKeyForURL.js';
+import { matchPrecache } from './matchPrecache.js';
+import { precache } from './precache.js';
+import { precacheAndRoute } from './precacheAndRoute.js';
+import { PrecacheController } from './PrecacheController.js';
+import { PrecacheRoute } from './PrecacheRoute.js';
+import { PrecacheStrategy } from './PrecacheStrategy.js';
+import { PrecacheFallbackPlugin } from './PrecacheFallbackPlugin.js';
+import './_version.js';
+/**
+ * Most consumers of this module will want to use the
+ * {@link workbox-precaching.precacheAndRoute}
+ * method to add assets to the cache and respond to network requests with these
+ * cached assets.
+ *
+ * If you require more control over caching and routing, you can use the
+ * {@link workbox-precaching.PrecacheController}
+ * interface.
+ *
+ * @module workbox-precaching
+ */
+export { addPlugins, addRoute, cleanupOutdatedCaches, createHandlerBoundToURL, getCacheKeyForURL, matchPrecache, precache, precacheAndRoute, PrecacheController, PrecacheRoute, PrecacheStrategy, PrecacheFallbackPlugin, };
+export * from './_types.js';
diff --git a/tools/ui/node_modules/workbox-precaching/index.js b/tools/ui/node_modules/workbox-precaching/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..db098a6997929510892c323d37e5d88fcaee165c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/index.js
@@ -0,0 +1,34 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { addPlugins } from './addPlugins.js';
+import { addRoute } from './addRoute.js';
+import { cleanupOutdatedCaches } from './cleanupOutdatedCaches.js';
+import { createHandlerBoundToURL } from './createHandlerBoundToURL.js';
+import { getCacheKeyForURL } from './getCacheKeyForURL.js';
+import { matchPrecache } from './matchPrecache.js';
+import { precache } from './precache.js';
+import { precacheAndRoute } from './precacheAndRoute.js';
+import { PrecacheController } from './PrecacheController.js';
+import { PrecacheRoute } from './PrecacheRoute.js';
+import { PrecacheStrategy } from './PrecacheStrategy.js';
+import { PrecacheFallbackPlugin } from './PrecacheFallbackPlugin.js';
+import './_version.js';
+/**
+ * Most consumers of this module will want to use the
+ * {@link workbox-precaching.precacheAndRoute}
+ * method to add assets to the cache and respond to network requests with these
+ * cached assets.
+ *
+ * If you require more control over caching and routing, you can use the
+ * {@link workbox-precaching.PrecacheController}
+ * interface.
+ *
+ * @module workbox-precaching
+ */
+export { addPlugins, addRoute, cleanupOutdatedCaches, createHandlerBoundToURL, getCacheKeyForURL, matchPrecache, precache, precacheAndRoute, PrecacheController, PrecacheRoute, PrecacheStrategy, PrecacheFallbackPlugin, };
+export * from './_types.js';
diff --git a/tools/ui/node_modules/workbox-precaching/index.mjs b/tools/ui/node_modules/workbox-precaching/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/matchPrecache.d.ts b/tools/ui/node_modules/workbox-precaching/matchPrecache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b491d659302e53a16ebd174e90910f66aad18115
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/matchPrecache.d.ts
@@ -0,0 +1,18 @@
+import './_version.js';
+/**
+ * Helper function that calls
+ * {@link PrecacheController#matchPrecache} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call
+ * {@link PrecacheController#matchPrecache} on that instance,
+ * instead of using this function.
+ *
+ * @param {string|Request} request The key (without revisioning parameters)
+ * to look up in the precache.
+ * @return {Promise}
+ *
+ * @memberof workbox-precaching
+ */
+declare function matchPrecache(request: string | Request): Promise;
+export { matchPrecache };
diff --git a/tools/ui/node_modules/workbox-precaching/matchPrecache.js b/tools/ui/node_modules/workbox-precaching/matchPrecache.js
new file mode 100644
index 0000000000000000000000000000000000000000..c889b90b5e289eb01980942455ccc329dc003a06
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/matchPrecache.js
@@ -0,0 +1,29 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * Helper function that calls
+ * {@link PrecacheController#matchPrecache} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call
+ * {@link PrecacheController#matchPrecache} on that instance,
+ * instead of using this function.
+ *
+ * @param {string|Request} request The key (without revisioning parameters)
+ * to look up in the precache.
+ * @return {Promise}
+ *
+ * @memberof workbox-precaching
+ */
+function matchPrecache(request) {
+    const precacheController = getOrCreatePrecacheController();
+    return precacheController.matchPrecache(request);
+}
+export { matchPrecache };
diff --git a/tools/ui/node_modules/workbox-precaching/matchPrecache.mjs b/tools/ui/node_modules/workbox-precaching/matchPrecache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..2695d17d5e6996e8e0bc7ff26f33354c4ea437a8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/matchPrecache.mjs
@@ -0,0 +1 @@
+export * from './matchPrecache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/package.json b/tools/ui/node_modules/workbox-precaching/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..59b2972b1d3a24ccda3341ebf95dde9fea7c7fd7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/package.json
@@ -0,0 +1,32 @@
+{
+  "name": "workbox-precaching",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "This module efficiently precaches assets.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.precaching",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1",
+    "workbox-routing": "7.4.1",
+    "workbox-strategies": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-precaching/precache.d.ts b/tools/ui/node_modules/workbox-precaching/precache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c2f8cdfbe285d27c93d757cc46652413082cdfa4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precache.d.ts
@@ -0,0 +1,23 @@
+import { PrecacheEntry } from './_types.js';
+import './_version.js';
+/**
+ * Adds items to the precache list, removing any duplicates and
+ * stores the files in the
+ * {@link workbox-core.cacheNames|"precache cache"} when the service
+ * worker installs.
+ *
+ * This method can be called multiple times.
+ *
+ * Please note: This method **will not** serve any of the cached files for you.
+ * It only precaches files. To respond to a network request you call
+ * {@link workbox-precaching.addRoute}.
+ *
+ * If you have a single array of files to precache, you can just call
+ * {@link workbox-precaching.precacheAndRoute}.
+ *
+ * @param {Array} [entries=[]] Array of entries to precache.
+ *
+ * @memberof workbox-precaching
+ */
+declare function precache(entries: Array): void;
+export { precache };
diff --git a/tools/ui/node_modules/workbox-precaching/precache.js b/tools/ui/node_modules/workbox-precaching/precache.js
new file mode 100644
index 0000000000000000000000000000000000000000..b6848f3d455cfdb473d36ea45959724989e895c1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precache.js
@@ -0,0 +1,33 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+/**
+ * Adds items to the precache list, removing any duplicates and
+ * stores the files in the
+ * {@link workbox-core.cacheNames|"precache cache"} when the service
+ * worker installs.
+ *
+ * This method can be called multiple times.
+ *
+ * Please note: This method **will not** serve any of the cached files for you.
+ * It only precaches files. To respond to a network request you call
+ * {@link workbox-precaching.addRoute}.
+ *
+ * If you have a single array of files to precache, you can just call
+ * {@link workbox-precaching.precacheAndRoute}.
+ *
+ * @param {Array} [entries=[]] Array of entries to precache.
+ *
+ * @memberof workbox-precaching
+ */
+function precache(entries) {
+    const precacheController = getOrCreatePrecacheController();
+    precacheController.precache(entries);
+}
+export { precache };
diff --git a/tools/ui/node_modules/workbox-precaching/precache.mjs b/tools/ui/node_modules/workbox-precaching/precache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..78d8e7e82312b2ab8fed2116ba89f349dfeb04d2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precache.mjs
@@ -0,0 +1 @@
+export * from './precache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/precacheAndRoute.d.ts b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..35d87a24133fce42ac88ef6db30a7d6cfd5d6a79
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.d.ts
@@ -0,0 +1,18 @@
+import { PrecacheRouteOptions, PrecacheEntry } from './_types.js';
+import './_version.js';
+/**
+ * This method will add entries to the precache list and add a route to
+ * respond to fetch events.
+ *
+ * This is a convenience method that will call
+ * {@link workbox-precaching.precache} and
+ * {@link workbox-precaching.addRoute} in a single call.
+ *
+ * @param {Array} entries Array of entries to precache.
+ * @param {Object} [options] See the
+ * {@link workbox-precaching.PrecacheRoute} options.
+ *
+ * @memberof workbox-precaching
+ */
+declare function precacheAndRoute(entries: Array, options?: PrecacheRouteOptions): void;
+export { precacheAndRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/precacheAndRoute.js b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..258f9e682e793ec2e18c9ffabb190d18ace71ad4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.js
@@ -0,0 +1,29 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { addRoute } from './addRoute.js';
+import { precache } from './precache.js';
+import './_version.js';
+/**
+ * This method will add entries to the precache list and add a route to
+ * respond to fetch events.
+ *
+ * This is a convenience method that will call
+ * {@link workbox-precaching.precache} and
+ * {@link workbox-precaching.addRoute} in a single call.
+ *
+ * @param {Array} entries Array of entries to precache.
+ * @param {Object} [options] See the
+ * {@link workbox-precaching.PrecacheRoute} options.
+ *
+ * @memberof workbox-precaching
+ */
+function precacheAndRoute(entries, options) {
+    precache(entries);
+    addRoute(options);
+}
+export { precacheAndRoute };
diff --git a/tools/ui/node_modules/workbox-precaching/precacheAndRoute.mjs b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..8d65e6b8fb990792a53cc0bfc654073b96c50e62
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/precacheAndRoute.mjs
@@ -0,0 +1 @@
+export * from './precacheAndRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/src/PrecacheController.ts b/tools/ui/node_modules/workbox-precaching/src/PrecacheController.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bb7f97e59926dc60b528a8f5fbd61f21a42414f9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/PrecacheController.ts
@@ -0,0 +1,366 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {waitUntil} from 'workbox-core/_private/waitUntil.js';
+import {Strategy} from 'workbox-strategies/Strategy.js';
+import {RouteHandlerCallback, WorkboxPlugin} from 'workbox-core/types.js';
+
+import {createCacheKey} from './utils/createCacheKey.js';
+import {PrecacheInstallReportPlugin} from './utils/PrecacheInstallReportPlugin.js';
+import {PrecacheCacheKeyPlugin} from './utils/PrecacheCacheKeyPlugin.js';
+import {printCleanupDetails} from './utils/printCleanupDetails.js';
+import {printInstallDetails} from './utils/printInstallDetails.js';
+import {PrecacheStrategy} from './PrecacheStrategy.js';
+import {PrecacheEntry, InstallResult, CleanupResult} from './_types.js';
+import './_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+declare global {
+  interface ServiceWorkerGlobalScope {
+    __WB_MANIFEST: Array;
+  }
+}
+
+interface PrecacheControllerOptions {
+  cacheName?: string;
+  plugins?: WorkboxPlugin[];
+  fallbackToNetwork?: boolean;
+}
+
+/**
+ * Performs efficient precaching of assets.
+ *
+ * @memberof workbox-precaching
+ */
+class PrecacheController {
+  private _installAndActiveListenersAdded?: boolean;
+  private readonly _strategy: Strategy;
+  private readonly _urlsToCacheKeys: Map = new Map();
+  private readonly _urlsToCacheModes: Map<
+    string,
+    | 'reload'
+    | 'default'
+    | 'no-store'
+    | 'no-cache'
+    | 'force-cache'
+    | 'only-if-cached'
+  > = new Map();
+  private readonly _cacheKeysToIntegrities: Map = new Map();
+
+  /**
+   * Create a new PrecacheController.
+   *
+   * @param {Object} [options]
+   * @param {string} [options.cacheName] The cache to use for precaching.
+   * @param {string} [options.plugins] Plugins to use when precaching as well
+   * as responding to fetch events for precached assets.
+   * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+   * get the response from the network if there's a precache miss.
+   */
+  constructor({
+    cacheName,
+    plugins = [],
+    fallbackToNetwork = true,
+  }: PrecacheControllerOptions = {}) {
+    this._strategy = new PrecacheStrategy({
+      cacheName: cacheNames.getPrecacheName(cacheName),
+      plugins: [
+        ...plugins,
+        new PrecacheCacheKeyPlugin({precacheController: this}),
+      ],
+      fallbackToNetwork,
+    });
+
+    // Bind the install and activate methods to the instance.
+    this.install = this.install.bind(this);
+    this.activate = this.activate.bind(this);
+  }
+
+  /**
+   * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and
+   * used to cache assets and respond to fetch events.
+   */
+  get strategy(): Strategy {
+    return this._strategy;
+  }
+
+  /**
+   * Adds items to the precache list, removing any duplicates and
+   * stores the files in the
+   * {@link workbox-core.cacheNames|"precache cache"} when the service
+   * worker installs.
+   *
+   * This method can be called multiple times.
+   *
+   * @param {Array} [entries=[]] Array of entries to precache.
+   */
+  precache(entries: Array): void {
+    this.addToCacheList(entries);
+
+    if (!this._installAndActiveListenersAdded) {
+      self.addEventListener('install', this.install);
+      self.addEventListener('activate', this.activate);
+      this._installAndActiveListenersAdded = true;
+    }
+  }
+
+  /**
+   * This method will add items to the precache list, removing duplicates
+   * and ensuring the information is valid.
+   *
+   * @param {Array} entries
+   *     Array of entries to precache.
+   */
+  addToCacheList(entries: Array): void {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isArray(entries, {
+        moduleName: 'workbox-precaching',
+        className: 'PrecacheController',
+        funcName: 'addToCacheList',
+        paramName: 'entries',
+      });
+    }
+
+    const urlsToWarnAbout: string[] = [];
+    for (const entry of entries) {
+      // See https://github.com/GoogleChrome/workbox/issues/2259
+      if (typeof entry === 'string') {
+        urlsToWarnAbout.push(entry);
+      } else if (entry && entry.revision === undefined) {
+        urlsToWarnAbout.push(entry.url);
+      }
+
+      const {cacheKey, url} = createCacheKey(entry);
+      const cacheMode =
+        typeof entry !== 'string' && entry.revision ? 'reload' : 'default';
+
+      if (
+        this._urlsToCacheKeys.has(url) &&
+        this._urlsToCacheKeys.get(url) !== cacheKey
+      ) {
+        throw new WorkboxError('add-to-cache-list-conflicting-entries', {
+          firstEntry: this._urlsToCacheKeys.get(url),
+          secondEntry: cacheKey,
+        });
+      }
+
+      if (typeof entry !== 'string' && entry.integrity) {
+        if (
+          this._cacheKeysToIntegrities.has(cacheKey) &&
+          this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity
+        ) {
+          throw new WorkboxError('add-to-cache-list-conflicting-integrities', {
+            url,
+          });
+        }
+        this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);
+      }
+
+      this._urlsToCacheKeys.set(url, cacheKey);
+      this._urlsToCacheModes.set(url, cacheMode);
+
+      if (urlsToWarnAbout.length > 0) {
+        const warningMessage =
+          `Workbox is precaching URLs without revision ` +
+          `info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` +
+          `Learn more at https://bit.ly/wb-precache`;
+        if (process.env.NODE_ENV === 'production') {
+          // Use console directly to display this warning without bloating
+          // bundle sizes by pulling in all of the logger codebase in prod.
+          console.warn(warningMessage);
+        } else {
+          logger.warn(warningMessage);
+        }
+      }
+    }
+  }
+
+  /**
+   * Precaches new and updated assets. Call this method from the service worker
+   * install event.
+   *
+   * Note: this method calls `event.waitUntil()` for you, so you do not need
+   * to call it yourself in your event handlers.
+   *
+   * @param {ExtendableEvent} event
+   * @return {Promise}
+   */
+  install(event: ExtendableEvent): Promise {
+    // waitUntil returns Promise
+    // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+    return waitUntil(event, async () => {
+      const installReportPlugin = new PrecacheInstallReportPlugin();
+      this.strategy.plugins.push(installReportPlugin);
+
+      // Cache entries one at a time.
+      // See https://github.com/GoogleChrome/workbox/issues/2528
+      for (const [url, cacheKey] of this._urlsToCacheKeys) {
+        const integrity = this._cacheKeysToIntegrities.get(cacheKey);
+        const cacheMode = this._urlsToCacheModes.get(url);
+
+        const request = new Request(url, {
+          integrity,
+          cache: cacheMode,
+          credentials: 'same-origin',
+        });
+
+        await Promise.all(
+          this.strategy.handleAll({
+            params: {cacheKey},
+            request,
+            event,
+          }),
+        );
+      }
+
+      const {updatedURLs, notUpdatedURLs} = installReportPlugin;
+
+      if (process.env.NODE_ENV !== 'production') {
+        printInstallDetails(updatedURLs, notUpdatedURLs);
+      }
+
+      return {updatedURLs, notUpdatedURLs};
+    });
+  }
+
+  /**
+   * Deletes assets that are no longer present in the current precache manifest.
+   * Call this method from the service worker activate event.
+   *
+   * Note: this method calls `event.waitUntil()` for you, so you do not need
+   * to call it yourself in your event handlers.
+   *
+   * @param {ExtendableEvent} event
+   * @return {Promise}
+   */
+  activate(event: ExtendableEvent): Promise {
+    // waitUntil returns Promise
+    // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+    return waitUntil(event, async () => {
+      const cache = await self.caches.open(this.strategy.cacheName);
+      const currentlyCachedRequests = await cache.keys();
+      const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());
+
+      const deletedURLs = [];
+      for (const request of currentlyCachedRequests) {
+        if (!expectedCacheKeys.has(request.url)) {
+          await cache.delete(request);
+          deletedURLs.push(request.url);
+        }
+      }
+
+      if (process.env.NODE_ENV !== 'production') {
+        printCleanupDetails(deletedURLs);
+      }
+
+      return {deletedURLs};
+    });
+  }
+
+  /**
+   * Returns a mapping of a precached URL to the corresponding cache key, taking
+   * into account the revision information for the URL.
+   *
+   * @return {Map} A URL to cache key mapping.
+   */
+  getURLsToCacheKeys(): Map {
+    return this._urlsToCacheKeys;
+  }
+
+  /**
+   * Returns a list of all the URLs that have been precached by the current
+   * service worker.
+   *
+   * @return {Array} The precached URLs.
+   */
+  getCachedURLs(): Array {
+    return [...this._urlsToCacheKeys.keys()];
+  }
+
+  /**
+   * Returns the cache key used for storing a given URL. If that URL is
+   * unversioned, like `/index.html', then the cache key will be the original
+   * URL with a search parameter appended to it.
+   *
+   * @param {string} url A URL whose cache key you want to look up.
+   * @return {string} The versioned URL that corresponds to a cache key
+   * for the original URL, or undefined if that URL isn't precached.
+   */
+  getCacheKeyForURL(url: string): string | undefined {
+    const urlObject = new URL(url, location.href);
+    return this._urlsToCacheKeys.get(urlObject.href);
+  }
+
+  /**
+   * @param {string} url A cache key whose SRI you want to look up.
+   * @return {string} The subresource integrity associated with the cache key,
+   * or undefined if it's not set.
+   */
+  getIntegrityForCacheKey(cacheKey: string): string | undefined {
+    return this._cacheKeysToIntegrities.get(cacheKey);
+  }
+
+  /**
+   * This acts as a drop-in replacement for
+   * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)
+   * with the following differences:
+   *
+   * - It knows what the name of the precache is, and only checks in that cache.
+   * - It allows you to pass in an "original" URL without versioning parameters,
+   * and it will automatically look up the correct cache key for the currently
+   * active revision of that URL.
+   *
+   * E.g., `matchPrecache('index.html')` will find the correct precached
+   * response for the currently active service worker, even if the actual cache
+   * key is `'/index.html?__WB_REVISION__=1234abcd'`.
+   *
+   * @param {string|Request} request The key (without revisioning parameters)
+   * to look up in the precache.
+   * @return {Promise}
+   */
+  async matchPrecache(
+    request: string | Request,
+  ): Promise {
+    const url = request instanceof Request ? request.url : request;
+    const cacheKey = this.getCacheKeyForURL(url);
+    if (cacheKey) {
+      const cache = await self.caches.open(this.strategy.cacheName);
+      return cache.match(cacheKey);
+    }
+    return undefined;
+  }
+
+  /**
+   * Returns a function that looks up `url` in the precache (taking into
+   * account revision information), and returns the corresponding `Response`.
+   *
+   * @param {string} url The precached URL which will be used to lookup the
+   * `Response`.
+   * @return {workbox-routing~handlerCallback}
+   */
+  createHandlerBoundToURL(url: string): RouteHandlerCallback {
+    const cacheKey = this.getCacheKeyForURL(url);
+    if (!cacheKey) {
+      throw new WorkboxError('non-precached-url', {url});
+    }
+    return (options) => {
+      options.request = new Request(url);
+      options.params = {cacheKey, ...options.params};
+
+      return this.strategy.handle(options);
+    };
+  }
+}
+
+export {PrecacheController};
diff --git a/tools/ui/node_modules/workbox-precaching/src/PrecacheFallbackPlugin.ts b/tools/ui/node_modules/workbox-precaching/src/PrecacheFallbackPlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0c3dfa12e05445d380235293968068574b795dbb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/PrecacheFallbackPlugin.ts
@@ -0,0 +1,65 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin} from 'workbox-core/types.js';
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import {PrecacheController} from './PrecacheController.js';
+
+import './_version.js';
+
+/**
+ * `PrecacheFallbackPlugin` allows you to specify an "offline fallback"
+ * response to be used when a given strategy is unable to generate a response.
+ *
+ * It does this by intercepting the `handlerDidError` plugin callback
+ * and returning a precached response, taking the expected revision parameter
+ * into account automatically.
+ *
+ * Unless you explicitly pass in a `PrecacheController` instance to the
+ * constructor, the default instance will be used. Generally speaking, most
+ * developers will end up using the default.
+ *
+ * @memberof workbox-precaching
+ */
+class PrecacheFallbackPlugin implements WorkboxPlugin {
+  private readonly _fallbackURL: string;
+  private readonly _precacheController: PrecacheController;
+
+  /**
+   * Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.
+   *
+   * @param {Object} config
+   * @param {string} config.fallbackURL A precached URL to use as the fallback
+   *     if the associated strategy can't generate a response.
+   * @param {PrecacheController} [config.precacheController] An optional
+   *     PrecacheController instance. If not provided, the default
+   *     PrecacheController will be used.
+   */
+  constructor({
+    fallbackURL,
+    precacheController,
+  }: {
+    fallbackURL: string;
+    precacheController?: PrecacheController;
+  }) {
+    this._fallbackURL = fallbackURL;
+    this._precacheController =
+      precacheController || getOrCreatePrecacheController();
+  }
+
+  /**
+   * @return {Promise} The precache response for the fallback URL.
+   *
+   * @private
+   */
+  handlerDidError: WorkboxPlugin['handlerDidError'] = () =>
+    this._precacheController.matchPrecache(this._fallbackURL);
+}
+
+export {PrecacheFallbackPlugin};
diff --git a/tools/ui/node_modules/workbox-precaching/src/PrecacheRoute.ts b/tools/ui/node_modules/workbox-precaching/src/PrecacheRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..63c31720dd763d519de2e3f4d3836e90fbae200d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/PrecacheRoute.ts
@@ -0,0 +1,77 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {
+  RouteMatchCallback,
+  RouteMatchCallbackOptions,
+} from 'workbox-core/types.js';
+import {Route} from 'workbox-routing/Route.js';
+
+import {PrecacheRouteOptions} from './_types.js';
+import {PrecacheController} from './PrecacheController.js';
+import {generateURLVariations} from './utils/generateURLVariations.js';
+
+import './_version.js';
+
+/**
+ * A subclass of {@link workbox-routing.Route} that takes a
+ * {@link workbox-precaching.PrecacheController}
+ * instance and uses it to match incoming requests and handle fetching
+ * responses from the precache.
+ *
+ * @memberof workbox-precaching
+ * @extends workbox-routing.Route
+ */
+class PrecacheRoute extends Route {
+  /**
+   * @param {PrecacheController} precacheController A `PrecacheController`
+   * instance used to both match requests and respond to fetch events.
+   * @param {Object} [options] Options to control how requests are matched
+   * against the list of precached URLs.
+   * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will
+   * check cache entries for a URLs ending with '/' to see if there is a hit when
+   * appending the `directoryIndex` value.
+   * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An
+   * array of regex's to remove search params when looking for a cache match.
+   * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will
+   * check the cache for the URL with a `.html` added to the end of the end.
+   * @param {workbox-precaching~urlManipulation} [options.urlManipulation]
+   * This is a function that should take a URL and return an array of
+   * alternative URLs that should be checked for precache matches.
+   */
+  constructor(
+    precacheController: PrecacheController,
+    options?: PrecacheRouteOptions,
+  ) {
+    const match: RouteMatchCallback = ({
+      request,
+    }: RouteMatchCallbackOptions) => {
+      const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
+      for (const possibleURL of generateURLVariations(request.url, options)) {
+        const cacheKey = urlsToCacheKeys.get(possibleURL);
+        if (cacheKey) {
+          const integrity =
+            precacheController.getIntegrityForCacheKey(cacheKey);
+          return {cacheKey, integrity};
+        }
+      }
+      if (process.env.NODE_ENV !== 'production') {
+        logger.debug(
+          `Precaching did not find a match for ` + getFriendlyURL(request.url),
+        );
+      }
+      return;
+    };
+
+    super(match, precacheController.strategy);
+  }
+}
+
+export {PrecacheRoute};
diff --git a/tools/ui/node_modules/workbox-precaching/src/PrecacheStrategy.ts b/tools/ui/node_modules/workbox-precaching/src/PrecacheStrategy.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a5e2173f2a832edfd628d86b9b1bedf1e731bb75
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/PrecacheStrategy.ts
@@ -0,0 +1,287 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {copyResponse} from 'workbox-core/copyResponse.js';
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {WorkboxPlugin} from 'workbox-core/types.js';
+import {Strategy, StrategyOptions} from 'workbox-strategies/Strategy.js';
+import {StrategyHandler} from 'workbox-strategies/StrategyHandler.js';
+
+import './_version.js';
+
+interface PrecacheStrategyOptions extends StrategyOptions {
+  fallbackToNetwork?: boolean;
+}
+
+/**
+ * A {@link workbox-strategies.Strategy} implementation
+ * specifically designed to work with
+ * {@link workbox-precaching.PrecacheController}
+ * to both cache and fetch precached assets.
+ *
+ * Note: an instance of this class is created automatically when creating a
+ * `PrecacheController`; it's generally not necessary to create this yourself.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-precaching
+ */
+class PrecacheStrategy extends Strategy {
+  private readonly _fallbackToNetwork: boolean;
+
+  static readonly defaultPrecacheCacheabilityPlugin: WorkboxPlugin = {
+    async cacheWillUpdate({response}) {
+      if (!response || response.status >= 400) {
+        return null;
+      }
+
+      return response;
+    },
+  };
+
+  static readonly copyRedirectedCacheableResponsesPlugin: WorkboxPlugin = {
+    async cacheWillUpdate({response}) {
+      return response.redirected ? await copyResponse(response) : response;
+    },
+  };
+
+  /**
+   *
+   * @param {Object} [options]
+   * @param {string} [options.cacheName] Cache name to store and retrieve
+   * requests. Defaults to the cache names provided by
+   * {@link workbox-core.cacheNames}.
+   * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}
+   * to use in conjunction with this caching strategy.
+   * @param {Object} [options.fetchOptions] Values passed along to the
+   * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}
+   * of all fetch() requests made by this strategy.
+   * @param {Object} [options.matchOptions] The
+   * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}
+   * for any `cache.match()` or `cache.put()` calls made by this strategy.
+   * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
+   * get the response from the network if there's a precache miss.
+   */
+  constructor(options: PrecacheStrategyOptions = {}) {
+    options.cacheName = cacheNames.getPrecacheName(options.cacheName);
+    super(options);
+
+    this._fallbackToNetwork =
+      options.fallbackToNetwork === false ? false : true;
+
+    // Redirected responses cannot be used to satisfy a navigation request, so
+    // any redirected response must be "copied" rather than cloned, so the new
+    // response doesn't contain the `redirected` flag. See:
+    // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1
+    this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);
+  }
+
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    const response = await handler.cacheMatch(request);
+    if (response) {
+      return response;
+    }
+
+    // If this is an `install` event for an entry that isn't already cached,
+    // then populate the cache.
+    if (handler.event && handler.event.type === 'install') {
+      return await this._handleInstall(request, handler);
+    }
+
+    // Getting here means something went wrong. An entry that should have been
+    // precached wasn't found in the cache.
+    return await this._handleFetch(request, handler);
+  }
+
+  async _handleFetch(
+    request: Request,
+    handler: StrategyHandler,
+  ): Promise {
+    let response;
+    const params = (handler.params || {}) as {
+      cacheKey?: string;
+      integrity?: string;
+    };
+
+    // Fall back to the network if we're configured to do so.
+    if (this._fallbackToNetwork) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.warn(
+          `The precached response for ` +
+            `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +
+            `found. Falling back to the network.`,
+        );
+      }
+
+      const integrityInManifest = params.integrity;
+      const integrityInRequest = request.integrity;
+      const noIntegrityConflict =
+        !integrityInRequest || integrityInRequest === integrityInManifest;
+
+      // Do not add integrity if the original request is no-cors
+      // See https://github.com/GoogleChrome/workbox/issues/3096
+      response = await handler.fetch(
+        new Request(request, {
+          integrity:
+            request.mode !== 'no-cors'
+              ? integrityInRequest || integrityInManifest
+              : undefined,
+        }),
+      );
+
+      // It's only "safe" to repair the cache if we're using SRI to guarantee
+      // that the response matches the precache manifest's expectations,
+      // and there's either a) no integrity property in the incoming request
+      // or b) there is an integrity, and it matches the precache manifest.
+      // See https://github.com/GoogleChrome/workbox/issues/2858
+      // Also if the original request users no-cors we don't use integrity.
+      // See https://github.com/GoogleChrome/workbox/issues/3096
+      if (
+        integrityInManifest &&
+        noIntegrityConflict &&
+        request.mode !== 'no-cors'
+      ) {
+        this._useDefaultCacheabilityPluginIfNeeded();
+        const wasCached = await handler.cachePut(request, response.clone());
+        if (process.env.NODE_ENV !== 'production') {
+          if (wasCached) {
+            logger.log(
+              `A response for ${getFriendlyURL(request.url)} ` +
+                `was used to "repair" the precache.`,
+            );
+          }
+        }
+      }
+    } else {
+      // This shouldn't normally happen, but there are edge cases:
+      // https://github.com/GoogleChrome/workbox/issues/1441
+      throw new WorkboxError('missing-precache-entry', {
+        cacheName: this.cacheName,
+        url: request.url,
+      });
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      const cacheKey =
+        params.cacheKey || (await handler.getCacheKey(request, 'read'));
+
+      // Workbox is going to handle the route.
+      // print the routing details to the console.
+      logger.groupCollapsed(
+        `Precaching is responding to: ` + getFriendlyURL(request.url),
+      );
+      logger.log(
+        `Serving the precached url: ${getFriendlyURL(
+          cacheKey instanceof Request ? cacheKey.url : cacheKey,
+        )}`,
+      );
+
+      logger.groupCollapsed(`View request details here.`);
+      logger.log(request);
+      logger.groupEnd();
+
+      logger.groupCollapsed(`View response details here.`);
+      logger.log(response);
+      logger.groupEnd();
+
+      logger.groupEnd();
+    }
+
+    return response;
+  }
+
+  async _handleInstall(
+    request: Request,
+    handler: StrategyHandler,
+  ): Promise {
+    this._useDefaultCacheabilityPluginIfNeeded();
+
+    const response = await handler.fetch(request);
+
+    // Make sure we defer cachePut() until after we know the response
+    // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737
+    const wasCached = await handler.cachePut(request, response.clone());
+    if (!wasCached) {
+      // Throwing here will lead to the `install` handler failing, which
+      // we want to do if *any* of the responses aren't safe to cache.
+      throw new WorkboxError('bad-precaching-response', {
+        url: request.url,
+        status: response.status,
+      });
+    }
+
+    return response;
+  }
+
+  /**
+   * This method is complex, as there a number of things to account for:
+   *
+   * The `plugins` array can be set at construction, and/or it might be added to
+   * to at any time before the strategy is used.
+   *
+   * At the time the strategy is used (i.e. during an `install` event), there
+   * needs to be at least one plugin that implements `cacheWillUpdate` in the
+   * array, other than `copyRedirectedCacheableResponsesPlugin`.
+   *
+   * - If this method is called and there are no suitable `cacheWillUpdate`
+   * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.
+   *
+   * - If this method is called and there is exactly one `cacheWillUpdate`, then
+   * we don't have to do anything (this might be a previously added
+   * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).
+   *
+   * - If this method is called and there is more than one `cacheWillUpdate`,
+   * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,
+   * we need to remove it. (This situation is unlikely, but it could happen if
+   * the strategy is used multiple times, the first without a `cacheWillUpdate`,
+   * and then later on after manually adding a custom `cacheWillUpdate`.)
+   *
+   * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.
+   *
+   * @private
+   */
+  _useDefaultCacheabilityPluginIfNeeded(): void {
+    let defaultPluginIndex: number | null = null;
+    let cacheWillUpdatePluginCount = 0;
+
+    for (const [index, plugin] of this.plugins.entries()) {
+      // Ignore the copy redirected plugin when determining what to do.
+      if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {
+        continue;
+      }
+
+      // Save the default plugin's index, in case it needs to be removed.
+      if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {
+        defaultPluginIndex = index;
+      }
+
+      if (plugin.cacheWillUpdate) {
+        cacheWillUpdatePluginCount++;
+      }
+    }
+
+    if (cacheWillUpdatePluginCount === 0) {
+      this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);
+    } else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {
+      // Only remove the default plugin; multiple custom plugins are allowed.
+      this.plugins.splice(defaultPluginIndex, 1);
+    }
+    // Nothing needs to be done if cacheWillUpdatePluginCount is 1
+  }
+}
+
+export {PrecacheStrategy};
diff --git a/tools/ui/node_modules/workbox-precaching/src/_types.ts b/tools/ui/node_modules/workbox-precaching/src/_types.ts
new file mode 100644
index 0000000000000000000000000000000000000000..506d1bc2387e8a24c72df71c8cac74ae1fdabb65
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/_types.ts
@@ -0,0 +1,85 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.js';
+
+export interface InstallResult {
+  updatedURLs: string[];
+  notUpdatedURLs: string[];
+}
+
+export interface CleanupResult {
+  deletedCacheRequests: string[];
+}
+
+export declare interface PrecacheEntry {
+  integrity?: string;
+  url: string;
+  revision?: string | null;
+}
+
+export interface PrecacheRouteOptions {
+  directoryIndex?: string;
+  ignoreURLParametersMatching?: RegExp[];
+  cleanURLs?: boolean;
+  urlManipulation?: urlManipulation;
+}
+
+export type urlManipulation = ({url}: {url: URL}) => URL[];
+
+// * * * IMPORTANT! * * *
+// ------------------------------------------------------------------------- //
+// jdsoc type definitions cannot be declared above TypeScript definitions or
+// they'll be stripped from the built `.js` files, and they'll only be in the
+// `d.ts` files, which aren't read by the jsdoc generator. As a result we
+// have to put declare them below.
+
+/**
+ * @typedef {Object} InstallResult
+ * @property {Array} updatedURLs List of URLs that were updated during
+ * installation.
+ * @property {Array} notUpdatedURLs List of URLs that were already up to
+ * date.
+ *
+ * @memberof workbox-precaching
+ */
+
+/**
+ * @typedef {Object} CleanupResult
+ * @property {Array} deletedCacheRequests List of URLs that were deleted
+ * while cleaning up the cache.
+ *
+ * @memberof workbox-precaching
+ */
+
+/**
+ * @typedef {Object} PrecacheEntry
+ * @property {string} url URL to precache.
+ * @property {string} [revision] Revision information for the URL.
+ * @property {string} [integrity] Integrity metadata that will be used when
+ * making the network request for the URL.
+ *
+ * @memberof workbox-precaching
+ */
+
+/**
+ * The "urlManipulation" callback can be used to determine if there are any
+ * additional permutations of a URL that should be used to check against
+ * the available precached files.
+ *
+ * For example, Workbox supports checking for '/index.html' when the URL
+ * '/' is provided. This callback allows additional, custom checks.
+ *
+ * @callback ~urlManipulation
+ * @param {Object} context
+ * @param {URL} context.url The request's URL.
+ * @return {Array} To add additional urls to test, return an Array of
+ * URLs. Please note that these **should not be strings**, but URL objects.
+ *
+ * @memberof workbox-precaching
+ */
diff --git a/tools/ui/node_modules/workbox-precaching/src/_version.ts b/tools/ui/node_modules/workbox-precaching/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d93d5d58f503498247c4d249d3ee40a229fc9ef0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:precaching:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/src/addPlugins.ts b/tools/ui/node_modules/workbox-precaching/src/addPlugins.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f4651a6003a688977e9d20c0fa264fae2d1860dd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/addPlugins.ts
@@ -0,0 +1,25 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin} from 'workbox-core/types.js';
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+
+/**
+ * Adds plugins to the precaching strategy.
+ *
+ * @param {Array} plugins
+ *
+ * @memberof workbox-precaching
+ */
+function addPlugins(plugins: WorkboxPlugin[]): void {
+  const precacheController = getOrCreatePrecacheController();
+  precacheController.strategy.plugins.push(...plugins);
+}
+
+export {addPlugins};
diff --git a/tools/ui/node_modules/workbox-precaching/src/addRoute.ts b/tools/ui/node_modules/workbox-precaching/src/addRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a3899c5bbe2c74623939d5b202efbce36058ba77
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/addRoute.ts
@@ -0,0 +1,38 @@
+/*
+  Copyright 2019 Google LLC
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {registerRoute} from 'workbox-routing/registerRoute.js';
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import {PrecacheRoute} from './PrecacheRoute.js';
+import {PrecacheRouteOptions} from './_types.js';
+
+import './_version.js';
+
+/**
+ * Add a `fetch` listener to the service worker that will
+ * respond to
+ * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}
+ * with precached assets.
+ *
+ * Requests for assets that aren't precached, the `FetchEvent` will not be
+ * responded to, allowing the event to fall through to other `fetch` event
+ * listeners.
+ *
+ * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}
+ * options.
+ *
+ * @memberof workbox-precaching
+ */
+function addRoute(options?: PrecacheRouteOptions): void {
+  const precacheController = getOrCreatePrecacheController();
+
+  const precacheRoute = new PrecacheRoute(precacheController, options);
+  registerRoute(precacheRoute);
+}
+
+export {addRoute};
diff --git a/tools/ui/node_modules/workbox-precaching/src/cleanupOutdatedCaches.ts b/tools/ui/node_modules/workbox-precaching/src/cleanupOutdatedCaches.ts
new file mode 100644
index 0000000000000000000000000000000000000000..319cc75a70e24f0b162bcd4ed0755334391ee40c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/cleanupOutdatedCaches.ts
@@ -0,0 +1,41 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {deleteOutdatedCaches} from './utils/deleteOutdatedCaches.js';
+import './_version.js';
+
+/**
+ * Adds an `activate` event listener which will clean up incompatible
+ * precaches that were created by older versions of Workbox.
+ *
+ * @memberof workbox-precaching
+ */
+function cleanupOutdatedCaches(): void {
+  // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+  self.addEventListener('activate', ((event: ExtendableEvent) => {
+    const cacheName = cacheNames.getPrecacheName();
+
+    event.waitUntil(
+      deleteOutdatedCaches(cacheName).then((cachesDeleted) => {
+        if (process.env.NODE_ENV !== 'production') {
+          if (cachesDeleted.length > 0) {
+            logger.log(
+              `The following out-of-date precaches were cleaned up ` +
+                `automatically:`,
+              cachesDeleted,
+            );
+          }
+        }
+      }),
+    );
+  }) as EventListener);
+}
+
+export {cleanupOutdatedCaches};
diff --git a/tools/ui/node_modules/workbox-precaching/src/createHandlerBoundToURL.ts b/tools/ui/node_modules/workbox-precaching/src/createHandlerBoundToURL.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a5694c22424e75c51bf35712138af1dd1eaed0e7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/createHandlerBoundToURL.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import {RouteHandlerCallback} from 'workbox-core/types.js';
+import './_version.js';
+
+/**
+ * Helper function that calls
+ * {@link PrecacheController#createHandlerBoundToURL} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call the
+ * {@link PrecacheController#createHandlerBoundToURL} on that instance,
+ * instead of using this function.
+ *
+ * @param {string} url The precached URL which will be used to lookup the
+ * `Response`.
+ * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
+ * response from the network if there's a precache miss.
+ * @return {workbox-routing~handlerCallback}
+ *
+ * @memberof workbox-precaching
+ */
+function createHandlerBoundToURL(url: string): RouteHandlerCallback {
+  const precacheController = getOrCreatePrecacheController();
+  return precacheController.createHandlerBoundToURL(url);
+}
+
+export {createHandlerBoundToURL};
diff --git a/tools/ui/node_modules/workbox-precaching/src/getCacheKeyForURL.ts b/tools/ui/node_modules/workbox-precaching/src/getCacheKeyForURL.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1a73806c5f8fd0290162517c221152116711e3bf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/getCacheKeyForURL.ts
@@ -0,0 +1,36 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import './_version.js';
+
+/**
+ * Takes in a URL, and returns the corresponding URL that could be used to
+ * lookup the entry in the precache.
+ *
+ * If a relative URL is provided, the location of the service worker file will
+ * be used as the base.
+ *
+ * For precached entries without revision information, the cache key will be the
+ * same as the original URL.
+ *
+ * For precached entries with revision information, the cache key will be the
+ * original URL with the addition of a query parameter used for keeping track of
+ * the revision info.
+ *
+ * @param {string} url The URL whose cache key to look up.
+ * @return {string} The cache key that corresponds to that URL.
+ *
+ * @memberof workbox-precaching
+ */
+function getCacheKeyForURL(url: string): string | undefined {
+  const precacheController = getOrCreatePrecacheController();
+  return precacheController.getCacheKeyForURL(url);
+}
+
+export {getCacheKeyForURL};
diff --git a/tools/ui/node_modules/workbox-precaching/src/index.ts b/tools/ui/node_modules/workbox-precaching/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d4d140c5670e53e8dadf712a384c08dc0dd1eacf
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/index.ts
@@ -0,0 +1,52 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {addPlugins} from './addPlugins.js';
+import {addRoute} from './addRoute.js';
+import {cleanupOutdatedCaches} from './cleanupOutdatedCaches.js';
+import {createHandlerBoundToURL} from './createHandlerBoundToURL.js';
+import {getCacheKeyForURL} from './getCacheKeyForURL.js';
+import {matchPrecache} from './matchPrecache.js';
+import {precache} from './precache.js';
+import {precacheAndRoute} from './precacheAndRoute.js';
+import {PrecacheController} from './PrecacheController.js';
+import {PrecacheRoute} from './PrecacheRoute.js';
+import {PrecacheStrategy} from './PrecacheStrategy.js';
+import {PrecacheFallbackPlugin} from './PrecacheFallbackPlugin.js';
+
+import './_version.js';
+
+/**
+ * Most consumers of this module will want to use the
+ * {@link workbox-precaching.precacheAndRoute}
+ * method to add assets to the cache and respond to network requests with these
+ * cached assets.
+ *
+ * If you require more control over caching and routing, you can use the
+ * {@link workbox-precaching.PrecacheController}
+ * interface.
+ *
+ * @module workbox-precaching
+ */
+
+export {
+  addPlugins,
+  addRoute,
+  cleanupOutdatedCaches,
+  createHandlerBoundToURL,
+  getCacheKeyForURL,
+  matchPrecache,
+  precache,
+  precacheAndRoute,
+  PrecacheController,
+  PrecacheRoute,
+  PrecacheStrategy,
+  PrecacheFallbackPlugin,
+};
+
+export * from './_types.js';
diff --git a/tools/ui/node_modules/workbox-precaching/src/matchPrecache.ts b/tools/ui/node_modules/workbox-precaching/src/matchPrecache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3c64cce3912a3ab4bbe48b6fa5523389b2a311ff
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/matchPrecache.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+
+import './_version.js';
+
+/**
+ * Helper function that calls
+ * {@link PrecacheController#matchPrecache} on the default
+ * {@link PrecacheController} instance.
+ *
+ * If you are creating your own {@link PrecacheController}, then call
+ * {@link PrecacheController#matchPrecache} on that instance,
+ * instead of using this function.
+ *
+ * @param {string|Request} request The key (without revisioning parameters)
+ * to look up in the precache.
+ * @return {Promise}
+ *
+ * @memberof workbox-precaching
+ */
+function matchPrecache(
+  request: string | Request,
+): Promise {
+  const precacheController = getOrCreatePrecacheController();
+  return precacheController.matchPrecache(request);
+}
+
+export {matchPrecache};
diff --git a/tools/ui/node_modules/workbox-precaching/src/precache.ts b/tools/ui/node_modules/workbox-precaching/src/precache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45c8d7e8220c06a5dde498a2181e00dedff049a7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/precache.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
+import {PrecacheEntry} from './_types.js';
+import './_version.js';
+
+/**
+ * Adds items to the precache list, removing any duplicates and
+ * stores the files in the
+ * {@link workbox-core.cacheNames|"precache cache"} when the service
+ * worker installs.
+ *
+ * This method can be called multiple times.
+ *
+ * Please note: This method **will not** serve any of the cached files for you.
+ * It only precaches files. To respond to a network request you call
+ * {@link workbox-precaching.addRoute}.
+ *
+ * If you have a single array of files to precache, you can just call
+ * {@link workbox-precaching.precacheAndRoute}.
+ *
+ * @param {Array} [entries=[]] Array of entries to precache.
+ *
+ * @memberof workbox-precaching
+ */
+function precache(entries: Array): void {
+  const precacheController = getOrCreatePrecacheController();
+  precacheController.precache(entries);
+}
+
+export {precache};
diff --git a/tools/ui/node_modules/workbox-precaching/src/precacheAndRoute.ts b/tools/ui/node_modules/workbox-precaching/src/precacheAndRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7167a01cdccf6b57b5dafc1d3c6f1f601a07fafb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/precacheAndRoute.ts
@@ -0,0 +1,36 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {addRoute} from './addRoute.js';
+import {precache} from './precache.js';
+import {PrecacheRouteOptions, PrecacheEntry} from './_types.js';
+import './_version.js';
+
+/**
+ * This method will add entries to the precache list and add a route to
+ * respond to fetch events.
+ *
+ * This is a convenience method that will call
+ * {@link workbox-precaching.precache} and
+ * {@link workbox-precaching.addRoute} in a single call.
+ *
+ * @param {Array} entries Array of entries to precache.
+ * @param {Object} [options] See the
+ * {@link workbox-precaching.PrecacheRoute} options.
+ *
+ * @memberof workbox-precaching
+ */
+function precacheAndRoute(
+  entries: Array,
+  options?: PrecacheRouteOptions,
+): void {
+  precache(entries);
+  addRoute(options);
+}
+
+export {precacheAndRoute};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheCacheKeyPlugin.ts b/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheCacheKeyPlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d6c4e4ae19db44d33a12bdf71b8972232d63187a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheCacheKeyPlugin.ts
@@ -0,0 +1,45 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin, WorkboxPluginCallbackParam} from 'workbox-core/types.js';
+
+import {PrecacheController} from '../PrecacheController.js';
+
+import '../_version.js';
+
+/**
+ * A plugin, designed to be used with PrecacheController, to translate URLs into
+ * the corresponding cache key, based on the current revision info.
+ *
+ * @private
+ */
+class PrecacheCacheKeyPlugin implements WorkboxPlugin {
+  private readonly _precacheController: PrecacheController;
+
+  constructor({precacheController}: {precacheController: PrecacheController}) {
+    this._precacheController = precacheController;
+  }
+
+  cacheKeyWillBeUsed: WorkboxPlugin['cacheKeyWillBeUsed'] = async ({
+    request,
+    params,
+  }: WorkboxPluginCallbackParam['cacheKeyWillBeUsed']) => {
+    // Params is type any, can't change right now.
+    /* eslint-disable */
+    const cacheKey =
+      params?.cacheKey ||
+      this._precacheController.getCacheKeyForURL(request.url);
+    /* eslint-enable */
+
+    return cacheKey
+      ? new Request(cacheKey, {headers: request.headers})
+      : request;
+  };
+}
+
+export {PrecacheCacheKeyPlugin};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheInstallReportPlugin.ts b/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheInstallReportPlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..97970c58a3478cd0f094c9d2627493cc8b58962e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/PrecacheInstallReportPlugin.ts
@@ -0,0 +1,58 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin, WorkboxPluginCallbackParam} from 'workbox-core/types.js';
+
+import '../_version.js';
+
+/**
+ * A plugin, designed to be used with PrecacheController, to determine the
+ * of assets that were updated (or not updated) during the install event.
+ *
+ * @private
+ */
+class PrecacheInstallReportPlugin implements WorkboxPlugin {
+  updatedURLs: string[] = [];
+  notUpdatedURLs: string[] = [];
+
+  handlerWillStart: WorkboxPlugin['handlerWillStart'] = async ({
+    request,
+    state,
+  }: WorkboxPluginCallbackParam['handlerWillStart']) => {
+    // TODO: `state` should never be undefined...
+    if (state) {
+      state.originalRequest = request;
+    }
+  };
+
+  cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'] = async ({
+    event,
+    state,
+    cachedResponse,
+  }: WorkboxPluginCallbackParam['cachedResponseWillBeUsed']) => {
+    if (event.type === 'install') {
+      if (
+        state &&
+        state.originalRequest &&
+        state.originalRequest instanceof Request
+      ) {
+        // TODO: `state` should never be undefined...
+        const url = state.originalRequest.url;
+
+        if (cachedResponse) {
+          this.notUpdatedURLs.push(url);
+        } else {
+          this.updatedURLs.push(url);
+        }
+      }
+    }
+    return cachedResponse;
+  };
+}
+
+export {PrecacheInstallReportPlugin};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/createCacheKey.ts b/tools/ui/node_modules/workbox-precaching/src/utils/createCacheKey.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b0045b90564bbd7e2bd716ebf37410ff1f404faa
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/createCacheKey.ts
@@ -0,0 +1,69 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {PrecacheEntry} from '../_types.js';
+import '../_version.js';
+
+interface CacheKey {
+  cacheKey: string;
+  url: string;
+}
+
+// Name of the search parameter used to store revision info.
+const REVISION_SEARCH_PARAM = '__WB_REVISION__';
+
+/**
+ * Converts a manifest entry into a versioned URL suitable for precaching.
+ *
+ * @param {Object|string} entry
+ * @return {string} A URL with versioning info.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function createCacheKey(entry: PrecacheEntry | string): CacheKey {
+  if (!entry) {
+    throw new WorkboxError('add-to-cache-list-unexpected-type', {entry});
+  }
+
+  // If a precache manifest entry is a string, it's assumed to be a versioned
+  // URL, like '/app.abcd1234.js'. Return as-is.
+  if (typeof entry === 'string') {
+    const urlObject = new URL(entry, location.href);
+    return {
+      cacheKey: urlObject.href,
+      url: urlObject.href,
+    };
+  }
+
+  const {revision, url} = entry;
+  if (!url) {
+    throw new WorkboxError('add-to-cache-list-unexpected-type', {entry});
+  }
+
+  // If there's just a URL and no revision, then it's also assumed to be a
+  // versioned URL.
+  if (!revision) {
+    const urlObject = new URL(url, location.href);
+    return {
+      cacheKey: urlObject.href,
+      url: urlObject.href,
+    };
+  }
+
+  // Otherwise, construct a properly versioned URL using the custom Workbox
+  // search parameter along with the revision info.
+  const cacheKeyURL = new URL(url, location.href);
+  const originalURL = new URL(url, location.href);
+  cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);
+  return {
+    cacheKey: cacheKeyURL.href,
+    url: originalURL.href,
+  };
+}
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/deleteOutdatedCaches.ts b/tools/ui/node_modules/workbox-precaching/src/utils/deleteOutdatedCaches.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f37c62bbdeb81992ed28bea4ab4a1b0cf3be6c8b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/deleteOutdatedCaches.ts
@@ -0,0 +1,55 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+const SUBSTRING_TO_FIND = '-precache-';
+
+/**
+ * Cleans up incompatible precaches that were created by older versions of
+ * Workbox, by a service worker registered under the current scope.
+ *
+ * This is meant to be called as part of the `activate` event.
+ *
+ * This should be safe to use as long as you don't include `substringToFind`
+ * (defaulting to `-precache-`) in your non-precache cache names.
+ *
+ * @param {string} currentPrecacheName The cache name currently in use for
+ * precaching. This cache won't be deleted.
+ * @param {string} [substringToFind='-precache-'] Cache names which include this
+ * substring will be deleted (excluding `currentPrecacheName`).
+ * @return {Array} A list of all the cache names that were deleted.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+const deleteOutdatedCaches = async (
+  currentPrecacheName: string,
+  substringToFind: string = SUBSTRING_TO_FIND,
+): Promise => {
+  const cacheNames = await self.caches.keys();
+
+  const cacheNamesToDelete = cacheNames.filter((cacheName) => {
+    return (
+      cacheName.includes(substringToFind) &&
+      cacheName.includes(self.registration.scope) &&
+      cacheName !== currentPrecacheName
+    );
+  });
+
+  await Promise.all(
+    cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)),
+  );
+
+  return cacheNamesToDelete;
+};
+
+export {deleteOutdatedCaches};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/generateURLVariations.ts b/tools/ui/node_modules/workbox-precaching/src/utils/generateURLVariations.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aa17d404254eeda3dbd0b50ba746ebc1e1b4ecd2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/generateURLVariations.ts
@@ -0,0 +1,60 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {removeIgnoredSearchParams} from './removeIgnoredSearchParams.js';
+import {PrecacheRouteOptions} from '../_types.js';
+import '../_version.js';
+
+/**
+ * Generator function that yields possible variations on the original URL to
+ * check, one at a time.
+ *
+ * @param {string} url
+ * @param {Object} options
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function* generateURLVariations(
+  url: string,
+  {
+    ignoreURLParametersMatching = [/^utm_/, /^fbclid$/],
+    directoryIndex = 'index.html',
+    cleanURLs = true,
+    urlManipulation,
+  }: PrecacheRouteOptions = {},
+): Generator {
+  const urlObject = new URL(url, location.href);
+  urlObject.hash = '';
+  yield urlObject.href;
+
+  const urlWithoutIgnoredParams = removeIgnoredSearchParams(
+    urlObject,
+    ignoreURLParametersMatching,
+  );
+  yield urlWithoutIgnoredParams.href;
+
+  if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {
+    const directoryURL = new URL(urlWithoutIgnoredParams.href);
+    directoryURL.pathname += directoryIndex;
+    yield directoryURL.href;
+  }
+
+  if (cleanURLs) {
+    const cleanURL = new URL(urlWithoutIgnoredParams.href);
+    cleanURL.pathname += '.html';
+    yield cleanURL.href;
+  }
+
+  if (urlManipulation) {
+    const additionalURLs = urlManipulation({url: urlObject});
+    for (const urlToAttempt of additionalURLs) {
+      yield urlToAttempt.href;
+    }
+  }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/getCacheKeyForURL.ts b/tools/ui/node_modules/workbox-precaching/src/utils/getCacheKeyForURL.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b58c41752107c1b0f9a2fa4471ec9a20d53a4c5d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/getCacheKeyForURL.ts
@@ -0,0 +1,38 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {getOrCreatePrecacheController} from './getOrCreatePrecacheController.js';
+import {generateURLVariations} from './generateURLVariations.js';
+import {PrecacheRouteOptions} from '../_types.js';
+import '../_version.js';
+
+/**
+ * This function will take the request URL and manipulate it based on the
+ * configuration options.
+ *
+ * @param {string} url
+ * @param {Object} options
+ * @return {string} Returns the URL in the cache that matches the request,
+ * if possible.
+ *
+ * @private
+ */
+export const getCacheKeyForURL = (
+  url: string,
+  options: PrecacheRouteOptions,
+): string | void => {
+  const precacheController = getOrCreatePrecacheController();
+
+  const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
+  for (const possibleURL of generateURLVariations(url, options)) {
+    const possibleCacheKey = urlsToCacheKeys.get(possibleURL);
+    if (possibleCacheKey) {
+      return possibleCacheKey;
+    }
+  }
+};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/getOrCreatePrecacheController.ts b/tools/ui/node_modules/workbox-precaching/src/utils/getOrCreatePrecacheController.ts
new file mode 100644
index 0000000000000000000000000000000000000000..429650d44ada2ac960c72c0bc28a0dca51595947
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/getOrCreatePrecacheController.ts
@@ -0,0 +1,23 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {PrecacheController} from '../PrecacheController.js';
+import '../_version.js';
+
+let precacheController: PrecacheController | undefined;
+
+/**
+ * @return {PrecacheController}
+ * @private
+ */
+export const getOrCreatePrecacheController = (): PrecacheController => {
+  if (!precacheController) {
+    precacheController = new PrecacheController();
+  }
+  return precacheController;
+};
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/printCleanupDetails.ts b/tools/ui/node_modules/workbox-precaching/src/utils/printCleanupDetails.ts
new file mode 100644
index 0000000000000000000000000000000000000000..68df0feeb7cb968d23e523cd615eafd6620eed28
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/printCleanupDetails.ts
@@ -0,0 +1,45 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import '../_version.js';
+
+/**
+ * @param {string} groupTitle
+ * @param {Array} deletedURLs
+ *
+ * @private
+ */
+const logGroup = (groupTitle: string, deletedURLs: string[]) => {
+  logger.groupCollapsed(groupTitle);
+
+  for (const url of deletedURLs) {
+    logger.log(url);
+  }
+
+  logger.groupEnd();
+};
+
+/**
+ * @param {Array} deletedURLs
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function printCleanupDetails(deletedURLs: string[]): void {
+  const deletionCount = deletedURLs.length;
+  if (deletionCount > 0) {
+    logger.groupCollapsed(
+      `During precaching cleanup, ` +
+        `${deletionCount} cached ` +
+        `request${deletionCount === 1 ? ' was' : 's were'} deleted.`,
+    );
+    logGroup('Deleted Cache Requests', deletedURLs);
+    logger.groupEnd();
+  }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/printInstallDetails.ts b/tools/ui/node_modules/workbox-precaching/src/utils/printInstallDetails.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f74c58a320bafc87cf12e840f312ffa15632ae9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/printInstallDetails.ts
@@ -0,0 +1,63 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import '../_version.js';
+
+/**
+ * @param {string} groupTitle
+ * @param {Array} urls
+ *
+ * @private
+ */
+function _nestedGroup(groupTitle: string, urls: string[]): void {
+  if (urls.length === 0) {
+    return;
+  }
+
+  logger.groupCollapsed(groupTitle);
+
+  for (const url of urls) {
+    logger.log(url);
+  }
+
+  logger.groupEnd();
+}
+
+/**
+ * @param {Array} urlsToPrecache
+ * @param {Array} urlsAlreadyPrecached
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function printInstallDetails(
+  urlsToPrecache: string[],
+  urlsAlreadyPrecached: string[],
+): void {
+  const precachedCount = urlsToPrecache.length;
+  const alreadyPrecachedCount = urlsAlreadyPrecached.length;
+
+  if (precachedCount || alreadyPrecachedCount) {
+    let message = `Precaching ${precachedCount} file${
+      precachedCount === 1 ? '' : 's'
+    }.`;
+
+    if (alreadyPrecachedCount > 0) {
+      message +=
+        ` ${alreadyPrecachedCount} ` +
+        `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;
+    }
+
+    logger.groupCollapsed(message);
+
+    _nestedGroup(`View newly precached URLs.`, urlsToPrecache);
+    _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);
+    logger.groupEnd();
+  }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/src/utils/removeIgnoredSearchParams.ts b/tools/ui/node_modules/workbox-precaching/src/utils/removeIgnoredSearchParams.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b02dfe7041d6b7b87bcf640e1edea828bb782f7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/src/utils/removeIgnoredSearchParams.ts
@@ -0,0 +1,36 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+/**
+ * Removes any URL search parameters that should be ignored.
+ *
+ * @param {URL} urlObject The original URL.
+ * @param {Array} ignoreURLParametersMatching RegExps to test against
+ * each search parameter name. Matches mean that the search parameter should be
+ * ignored.
+ * @return {URL} The URL with any ignored search parameters removed.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function removeIgnoredSearchParams(
+  urlObject: URL,
+  ignoreURLParametersMatching: RegExp[] = [],
+): URL {
+  // Convert the iterable into an array at the start of the loop to make sure
+  // deletion doesn't mess up iteration.
+  for (const paramName of [...urlObject.searchParams.keys()]) {
+    if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {
+      urlObject.searchParams.delete(paramName);
+    }
+  }
+
+  return urlObject;
+}
diff --git a/tools/ui/node_modules/workbox-precaching/tsconfig.json b/tools/ui/node_modules/workbox-precaching/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..ff2b28d5b864204f1e20b69d0250b2b2f48535c0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/tsconfig.json
@@ -0,0 +1,14 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [
+    {"path": "../workbox-core/"},
+    {"path": "../workbox-routing/"},
+    {"path": "../workbox-strategies/"}
+  ]
+}
diff --git a/tools/ui/node_modules/workbox-precaching/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-precaching/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..702b685dea80c486f1d16ba6b41ccc11da86ccb5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/cachenames.d.ts","../workbox-core/_private/logger.d.ts","../workbox-core/_private/workboxerror.d.ts","../workbox-core/_private/waituntil.d.ts","../workbox-strategies/_version.d.ts","../workbox-strategies/strategyhandler.d.ts","../workbox-strategies/strategy.d.ts","./src/_version.ts","./src/_types.ts","./src/utils/createcachekey.ts","./src/utils/precacheinstallreportplugin.ts","./src/utils/precachecachekeyplugin.ts","./src/utils/printcleanupdetails.ts","./src/utils/printinstalldetails.ts","../workbox-core/copyresponse.d.ts","../workbox-core/_private/getfriendlyurl.d.ts","./src/precachestrategy.ts","./src/precachecontroller.ts","./src/utils/getorcreateprecachecontroller.ts","./src/precachefallbackplugin.ts","../workbox-routing/_version.d.ts","../workbox-routing/utils/constants.d.ts","../workbox-routing/route.d.ts","./src/utils/removeignoredsearchparams.ts","./src/utils/generateurlvariations.ts","./src/precacheroute.ts","./src/addplugins.ts","../workbox-routing/registerroute.d.ts","./src/addroute.ts","./src/utils/deleteoutdatedcaches.ts","./src/cleanupoutdatedcaches.ts","./src/createhandlerboundtourl.ts","./src/getcachekeyforurl.ts","./src/matchprecache.ts","./src/precache.ts","./src/precacheandroute.ts","./src/index.ts","./src/utils/getcachekeyforurl.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca","dda5c129fa8b8e72bee6609a4fc48148f58f2f656d70a395d3122431193569f9",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},"0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5","70d9e4746e3ba572a12da28136b854e5503119e96c2524d99575d4b7c7379e70","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","c0f693310aa76645335728d3636021e61130aff7651ae44c512662a194ac3b63","98962a67c31e31dbb0f7eb27082465ca9bfd4b59c9f36537a70c27b1a3982e65",{"version":"4ef8fbb8e1f38ed2383f84f9457bdfe1750e5e82317332a4e9a6fca74f2adad7","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"717580c5220e7be35f3d1094397a6584054aca2974d1ac8b1120b08f43396d58","signature":"14fec12122e38fcbb50d67790413a06eb82cfceae2d5d6d701ed6cb7e0201386"},{"version":"318cceb64a9d525593c0b83fb01ab56f57501731a774f50374b8fd1bb3fdefa4","signature":"75cf664f9d7789dbfb02631947b1c92692be060794e9354ab1258bc5292e61b6"},{"version":"0bccbf130c403f382a3f764b7f29124714707575256f54422e9a13903d465474","signature":"07bb19ad16557bf77726a1ba8cacd61d2520485b2fdb0c5e9fb6f9ca4c5212d4"},{"version":"198263e8a544df822b565311b4c6838395e4ef7ed735bc907a6d0a7168d28a9a","signature":"f5130cc54750ddfe75faeca4a4b68b35f3864e5fa93c5dfe59646d61f961cce5"},{"version":"dedda7af4c58341ac1386cfe143987b6c82aefc61984d71bfbdd42e8169d9e0c","signature":"bb83191f176f70c773daaf6239f53c548b8798764a1cc80537d1d8562ca99c20"},{"version":"e3e65472dca112b309eb2045455e8b798cd16fe2c1d290647c4ce7e2a5a2bde6","signature":"a3ee0be941da59515eb02f2ee2e84619703fc991f781a9ee2962c94c5303a48a"},"3a5d48aa1814dbcc6a6a1d22bb94c6870450e168c5fed6b73825590372b3edb3","9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff",{"version":"04fc16b768e79fb4b197a30c7f5486fd43e595825a406c630609b6dbbd9381ea","signature":"4a73873d165994e1a298004edc8caa6328499cdec93a6ef7da4b726aa97ad5dd"},{"version":"2d31378456dc2b2adc805ee8a2a430eab0c791f691e3c73384bd3e8a96af718f","signature":"f6135bf64c7d1f8ff926b129274d6f7dd27617e901b6bb5010f2d30de6b54e67","affectsGlobalScope":true},{"version":"753e1ca9502457b2cc88f45bd975fab5aa824c9dde04cbae000bfcd3f69c338b","signature":"1319e659c3f79ed86ff73ec6752bffac628907b738ea890dbc73e466fc3d1ea1"},{"version":"ca19a3df4d8ce037f063c483fc2a432b1b9a0f704c833cb8fc16c382ee6317fb","signature":"ece766b45f14f581723c6fa3ffdb07af6f985d95fd350867d02187f987280620"},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","8d0f0aa989374cc6c7bc141649a9ca7d76b221a39375c8b98b844c3ad8c9b090","03e238c606e3567428238c11720093a64d3ef151ba465b7bf0ae8cca27540853",{"version":"742162c4626ca8f07f0786cb927d72cc260068e6464296775f0b4f5b4ddc1781","signature":"975ceb4448c2de3ce38d844ac807eadffcbb416367e8d1fc285b4505f80ac8a2"},{"version":"96c0409441a71f58a78b0d38cc8fcab602becf411abd66813fd221e4ed65b914","signature":"0d5c90206c34b13ea68817077e2c29d071f537c999a743304ec85bf95f7c8267"},{"version":"42f9ae54d21027d366e31e5e2cbe7dfbd8f778a58ced5fb2148b88e40897afaf","signature":"02019739688164f9c2f40e6c9a2614bbd09d43646386266718a99660e3481d6e"},{"version":"a52f2606577756ee1b0a7eb89f248aa34b247dbab749d827c5cf4d995e42ea62","signature":"c4fec0a8801ab5524d3afde4835af651d22484abcd51dcd7701f3666b816faa5"},"3c7281c1b6ec0997a6d02f43a1946fbf32eabf25c3404e79d28c5d20c13fd6c6",{"version":"2db2e1106985de24808d19242d26b652156450ab221ec6824afb45fa3c3c5e11","signature":"c1996190abbc73c09f3b563504ebe2f538409406f94ad5faf84004312dec0bbf"},{"version":"55b6a20ae11b403a531bb54fbeeb9f96e19e811657bc4ff042106b29d5ea50df","signature":"dc199f077c3b26c127a65ad5254ac72ce4db64b87d2f0f1af5d3ca61dc2f3424"},{"version":"03b4ba2287d9a0860bf2c0db17a31c60f9a358119b6170ddc4db9d7eb2a48192","signature":"15518325c9a2dc356f39c671b9054e78e4333ec23d1dd14bd0f49ae7fbf7d7c3"},{"version":"bf0633930c7868784eb3d50b7a5c73d3ab3ab837d60017d695d8ad019c6dc420","signature":"f3d7c81878a3a516a2ee532eec1f09064836982f8f7ffc4bc1d86e480fb0e6fc"},{"version":"c468bcaa8849dbad9f717008831927efde1869fbc5ffc5b425b8ba9c290b46be","signature":"82eae436585acea3d48584754f6f9653f026fecdbd08e94d3ec436535b5dce7f"},{"version":"0b4e4105d9d063ccc30fc095ebee3d4ea9b46406698a3186ddbf541347edb78b","signature":"4b2df5d613f0277020ba60d7f59a794e9993b97e2be3dc98719bcae1b754e699"},{"version":"91e19848f3e624280552f1a1de4540e34f7ae0a52e8d002180045ab5690dbb97","signature":"cf382ef2386e23a254c173e40c6d3ae8ad42244faa93d765b90f7c16eb975503"},{"version":"cd76d3a165b1ddea2d62b7066b157bba6e84d28e4cc3d2da922e958fe5067c65","signature":"cfd7e03a8a7c58cfb04d86f60af79ff4185527d133d25aa8d4cf964c6a0d4db2"},{"version":"df6ca50bef9c8a82a43f4dcce9c9f892886102cf433002e619b4fba41df14742","signature":"d08df3a0744475c03a927841abf2d474d7b3582fbfaa736970e7e018351ec723"},{"version":"c0fabe840b4de8896eddfb083a602eecd2d4d431b78eb66981ec990ad86124df","signature":"e70119843c7d6ded01dc8d769605c9535be112875f3a9cc88ef0b14311b5cd18"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[102,144],[84,102,144],[84,85,86,87,88,102,144],[84,86,102,144],[93,95,102,144],[92,93,94,102,144],[102,144,157,193],[102,144,156,193,195],[102,144,218],[102,144,203],[102,144,207,208,209],[102,144,206],[102,144,208],[102,144,198,204,205,210,213,215,216,217],[102,144,205,211,212,218],[102,144,211,214],[102,144,205,206,211,218],[102,144,205,218],[102,144,199,200,201,202],[102,141,144],[102,143,144],[102,144,149,178],[102,144,145,150,156,157,164,175,186],[102,144,145,146,156,164],[97,98,99,102,144],[102,144,147,187],[102,144,148,149,157,165],[102,144,149,175,183],[102,144,150,152,156,164],[102,143,144,151],[102,144,152,153],[102,144,156],[102,144,154,156],[102,143,144,156],[102,144,156,157,158,175,186],[102,144,156,157,158,171,175,178],[102,139,144,191],[102,144,152,156,159,164,175,186],[102,144,156,157,159,160,164,175,183,186],[102,144,159,161,175,183,186],[102,144,156,162],[102,144,163,186,191],[102,144,152,156,164,175],[102,144,165],[102,144,166],[102,143,144,167],[102,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192],[102,144,169],[102,144,170],[102,144,156,171,172],[102,144,171,173,187,189],[102,144,156,175,176,178],[102,144,177,178],[102,144,175,176],[102,144,178],[102,144,179],[102,141,144,175],[102,144,156,181,182],[102,144,181,182],[102,144,149,164,175,183],[102,144,184],[144],[100,101,102,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192],[102,144,164,185],[102,144,159,170,186],[102,144,149,187],[102,144,175,188],[102,144,163,189],[102,144,190],[102,144,149,156,158,167,175,186,189,191],[102,144,175,192],[102,144,224,263],[102,144,224,248,263],[102,144,263],[102,144,224],[102,144,224,249,263],[102,144,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262],[102,144,249,263],[102,144,267],[102,144,193,270,271,272,273,274,275,276,277,278,279,280],[102,144,269,270,279],[102,144,270,279],[102,144,264,269,270,279],[102,144,269,270,271,272,273,274,275,276,277,278,280],[102,144,270],[102,144,149,269,279],[102,111,115,144,186],[102,111,144,175,186],[102,106,144],[102,108,111,144,183,186],[102,144,164,183],[102,144,193],[102,106,144,193],[102,108,111,144,164,186],[102,103,104,107,110,144,156,175,186],[102,111,118,144],[102,103,109,144],[102,111,132,133,144],[102,107,111,144,178,186,193],[102,132,144,193],[102,105,106,144,193],[102,111,144],[102,105,106,107,108,109,110,111,112,113,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,133,134,135,136,137,138,144],[102,111,126,144],[102,111,118,119,144],[102,109,111,119,120,144],[102,110,144],[102,103,106,111,144],[102,111,115,119,120,144],[102,115,144],[102,109,111,114,144,186],[102,103,108,111,118,144],[102,144,175],[102,106,111,132,144,191,193],[44,102,144],[44,64,102,144],[54,64,71,73,102,144],[46,47,75,102,144],[64,102,144],[54,62,63,65,71,72,74,76,77,78,79,80,81,102,144],[54,64,102,144],[54,74,80,102,144],[44,45,46,47,48,49,52,54,55,56,57,58,59,62,102,144],[44,63,64,102,144],[44,47,54,61,63,68,70,102,144],[44,46,47,48,51,52,60,61,102,144],[48,54,102,144],[54,69,102,144],[54,64,70,102,144],[63,102,144],[44,63,102,144],[47,102,144],[44,67,68,102,144],[44,67,102,144],[44,51,102,144],[44,52,102,144],[44],[54],[54,62,63,65,71,72,74,76,77,78,79,80,81],[44,52,54],[44,63],[54,63,68],[44,51,52],[63]],"referencedMap":[[42,1],[86,2],[84,1],[89,3],[85,2],[90,1],[87,4],[88,2],[91,1],[96,5],[92,1],[95,6],[93,1],[194,7],[196,8],[197,1],[94,1],[198,1],[219,9],[204,10],[210,11],[208,1],[207,12],[209,13],[218,14],[213,15],[215,16],[216,17],[217,18],[211,1],[212,18],[214,18],[206,18],[205,1],[200,1],[199,1],[202,10],[203,19],[201,10],[195,1],[220,1],[141,20],[142,20],[143,21],[144,22],[145,23],[146,24],[97,1],[100,25],[98,1],[99,1],[147,26],[148,27],[149,28],[150,29],[151,30],[152,31],[153,31],[155,32],[154,33],[156,34],[157,35],[158,36],[140,37],[159,38],[160,39],[161,40],[162,41],[163,42],[164,43],[165,44],[166,45],[167,46],[168,47],[169,48],[170,49],[171,50],[172,50],[173,51],[174,1],[175,52],[177,53],[176,54],[178,55],[179,56],[180,57],[181,58],[182,59],[183,60],[184,61],[102,62],[101,1],[193,63],[185,64],[186,65],[187,66],[188,67],[189,68],[190,69],[191,70],[192,71],[221,1],[222,1],[223,1],[248,72],[249,73],[224,74],[227,74],[246,72],[247,72],[237,72],[236,75],[234,72],[229,72],[242,72],[240,72],[244,72],[228,72],[241,72],[245,72],[230,72],[231,72],[243,72],[225,72],[232,72],[233,72],[235,72],[239,72],[250,76],[238,72],[226,72],[263,77],[262,1],[257,76],[259,78],[258,76],[251,76],[252,76],[254,76],[256,76],[260,78],[261,78],[253,78],[255,78],[264,1],[265,1],[266,1],[268,79],[267,1],[281,80],[280,81],[271,82],[272,83],[279,84],[273,83],[274,82],[275,82],[276,82],[277,85],[270,86],[278,81],[269,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[118,87],[128,88],[117,87],[138,89],[109,90],[108,91],[137,92],[131,93],[136,94],[111,95],[125,96],[110,97],[134,98],[106,99],[105,92],[135,100],[107,101],[112,102],[113,1],[116,102],[103,1],[139,103],[129,104],[120,105],[121,106],[123,107],[119,108],[122,109],[132,92],[114,110],[115,111],[124,112],[104,113],[127,104],[126,102],[130,1],[133,114],[45,115],[46,1],[61,1],[47,1],[49,1],[48,115],[43,1],[60,1],[44,1],[54,1],[53,1],[72,116],[74,117],[76,118],[77,116],[78,119],[82,120],[79,119],[80,121],[81,122],[63,123],[65,124],[71,125],[62,126],[55,127],[75,1],[70,128],[83,129],[64,130],[57,131],[56,115],[58,132],[59,132],[69,1],[66,1],[73,133],[68,134],[67,1],[50,1],[52,135],[51,136]],"exportedModulesMap":[[42,1],[86,2],[84,1],[89,3],[85,2],[90,1],[87,4],[88,2],[91,1],[96,5],[92,1],[95,6],[93,1],[194,7],[196,8],[197,1],[94,1],[198,1],[219,9],[204,10],[210,11],[208,1],[207,12],[209,13],[218,14],[213,15],[215,16],[216,17],[217,18],[211,1],[212,18],[214,18],[206,18],[205,1],[200,1],[199,1],[202,10],[203,19],[201,10],[195,1],[220,1],[141,20],[142,20],[143,21],[144,22],[145,23],[146,24],[97,1],[100,25],[98,1],[99,1],[147,26],[148,27],[149,28],[150,29],[151,30],[152,31],[153,31],[155,32],[154,33],[156,34],[157,35],[158,36],[140,37],[159,38],[160,39],[161,40],[162,41],[163,42],[164,43],[165,44],[166,45],[167,46],[168,47],[169,48],[170,49],[171,50],[172,50],[173,51],[174,1],[175,52],[177,53],[176,54],[178,55],[179,56],[180,57],[181,58],[182,59],[183,60],[184,61],[102,62],[101,1],[193,63],[185,64],[186,65],[187,66],[188,67],[189,68],[190,69],[191,70],[192,71],[221,1],[222,1],[223,1],[248,72],[249,73],[224,74],[227,74],[246,72],[247,72],[237,72],[236,75],[234,72],[229,72],[242,72],[240,72],[244,72],[228,72],[241,72],[245,72],[230,72],[231,72],[243,72],[225,72],[232,72],[233,72],[235,72],[239,72],[250,76],[238,72],[226,72],[263,77],[262,1],[257,76],[259,78],[258,76],[251,76],[252,76],[254,76],[256,76],[260,78],[261,78],[253,78],[255,78],[264,1],[265,1],[266,1],[268,79],[267,1],[281,80],[280,81],[271,82],[272,83],[279,84],[273,83],[274,82],[275,82],[276,82],[277,85],[270,86],[278,81],[269,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[118,87],[128,88],[117,87],[138,89],[109,90],[108,91],[137,92],[131,93],[136,94],[111,95],[125,96],[110,97],[134,98],[106,99],[105,92],[135,100],[107,101],[112,102],[113,1],[116,102],[103,1],[139,103],[129,104],[120,105],[121,106],[123,107],[119,108],[122,109],[132,92],[114,110],[115,111],[124,112],[104,113],[127,104],[126,102],[130,1],[133,114],[45,115],[46,1],[61,1],[47,1],[49,1],[48,115],[43,1],[60,1],[44,1],[72,137],[74,138],[77,137],[82,139],[80,138],[81,138],[63,140],[65,141],[71,142],[62,143],[55,138],[70,138],[83,138],[64,144],[57,141],[56,137],[66,1],[73,133],[68,134],[67,1],[50,1],[52,135],[51,136]],"semanticDiagnosticsPerFile":[42,86,84,89,85,90,87,88,91,96,92,95,93,194,196,197,94,198,219,204,210,208,207,209,218,213,215,216,217,211,212,214,206,205,200,199,202,203,201,195,220,141,142,143,144,145,146,97,100,98,99,147,148,149,150,151,152,153,155,154,156,157,158,140,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,177,176,178,179,180,181,182,183,184,102,101,193,185,186,187,188,189,190,191,192,221,222,223,248,249,224,227,246,247,237,236,234,229,242,240,244,228,241,245,230,231,243,225,232,233,235,239,250,238,226,263,262,257,259,258,251,252,254,256,260,261,253,255,264,265,266,268,267,281,280,271,272,279,273,274,275,276,277,270,278,269,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,118,128,117,138,109,108,137,131,136,111,125,110,134,106,105,135,107,112,113,116,103,139,129,120,121,123,119,122,132,114,115,124,104,127,126,130,133,45,46,61,47,49,48,43,60,44,54,53,72,74,76,77,78,82,79,80,81,63,65,71,62,55,75,70,83,64,57,56,58,59,69,66,73,68,67,50,52,51],"latestChangedDtsFile":"./utils/getCacheKeyForURL.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.d.ts b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4159082c6d7e7b40590802a0e669feb38f8fb070
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.d.ts
@@ -0,0 +1,17 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import { PrecacheController } from '../PrecacheController.js';
+import '../_version.js';
+/**
+ * A plugin, designed to be used with PrecacheController, to translate URLs into
+ * the corresponding cache key, based on the current revision info.
+ *
+ * @private
+ */
+declare class PrecacheCacheKeyPlugin implements WorkboxPlugin {
+    private readonly _precacheController;
+    constructor({ precacheController }: {
+        precacheController: PrecacheController;
+    });
+    cacheKeyWillBeUsed: WorkboxPlugin['cacheKeyWillBeUsed'];
+}
+export { PrecacheCacheKeyPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..70007446012f48874ebd8924c82af8f6acdec94b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js
@@ -0,0 +1,30 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * A plugin, designed to be used with PrecacheController, to translate URLs into
+ * the corresponding cache key, based on the current revision info.
+ *
+ * @private
+ */
+class PrecacheCacheKeyPlugin {
+    constructor({ precacheController }) {
+        this.cacheKeyWillBeUsed = async ({ request, params, }) => {
+            // Params is type any, can't change right now.
+            /* eslint-disable */
+            const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||
+                this._precacheController.getCacheKeyForURL(request.url);
+            /* eslint-enable */
+            return cacheKey
+                ? new Request(cacheKey, { headers: request.headers })
+                : request;
+        };
+        this._precacheController = precacheController;
+    }
+}
+export { PrecacheCacheKeyPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.mjs b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..579827e9e0be8804d68076f915fea3244779162c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.mjs
@@ -0,0 +1 @@
+export * from './PrecacheCacheKeyPlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.d.ts b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fb152b9dd3cf3ea62544678c6a1ea8c23f23048a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.d.ts
@@ -0,0 +1,15 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import '../_version.js';
+/**
+ * A plugin, designed to be used with PrecacheController, to determine the
+ * of assets that were updated (or not updated) during the install event.
+ *
+ * @private
+ */
+declare class PrecacheInstallReportPlugin implements WorkboxPlugin {
+    updatedURLs: string[];
+    notUpdatedURLs: string[];
+    handlerWillStart: WorkboxPlugin['handlerWillStart'];
+    cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'];
+}
+export { PrecacheInstallReportPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..3fb1cb696bfdcc29fd9d3ee1e748a5a515af2e41
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js
@@ -0,0 +1,44 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * A plugin, designed to be used with PrecacheController, to determine the
+ * of assets that were updated (or not updated) during the install event.
+ *
+ * @private
+ */
+class PrecacheInstallReportPlugin {
+    constructor() {
+        this.updatedURLs = [];
+        this.notUpdatedURLs = [];
+        this.handlerWillStart = async ({ request, state, }) => {
+            // TODO: `state` should never be undefined...
+            if (state) {
+                state.originalRequest = request;
+            }
+        };
+        this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {
+            if (event.type === 'install') {
+                if (state &&
+                    state.originalRequest &&
+                    state.originalRequest instanceof Request) {
+                    // TODO: `state` should never be undefined...
+                    const url = state.originalRequest.url;
+                    if (cachedResponse) {
+                        this.notUpdatedURLs.push(url);
+                    }
+                    else {
+                        this.updatedURLs.push(url);
+                    }
+                }
+            }
+            return cachedResponse;
+        };
+    }
+}
+export { PrecacheInstallReportPlugin };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.mjs b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..2fd1a14ee3ccf688c4d80558a6c40528f9cfdb82
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.mjs
@@ -0,0 +1 @@
+export * from './PrecacheInstallReportPlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.d.ts b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4b9596c77a23e38724cea75a89cdc4e983b2cfac
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.d.ts
@@ -0,0 +1,17 @@
+import { PrecacheEntry } from '../_types.js';
+import '../_version.js';
+interface CacheKey {
+    cacheKey: string;
+    url: string;
+}
+/**
+ * Converts a manifest entry into a versioned URL suitable for precaching.
+ *
+ * @param {Object|string} entry
+ * @return {string} A URL with versioning info.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export declare function createCacheKey(entry: PrecacheEntry | string): CacheKey;
+export {};
diff --git a/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.js b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.js
new file mode 100644
index 0000000000000000000000000000000000000000..a4f20cdcafd00a1bfddd55ae3690f3cd67d3eb62
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.js
@@ -0,0 +1,56 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import '../_version.js';
+// Name of the search parameter used to store revision info.
+const REVISION_SEARCH_PARAM = '__WB_REVISION__';
+/**
+ * Converts a manifest entry into a versioned URL suitable for precaching.
+ *
+ * @param {Object|string} entry
+ * @return {string} A URL with versioning info.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function createCacheKey(entry) {
+    if (!entry) {
+        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });
+    }
+    // If a precache manifest entry is a string, it's assumed to be a versioned
+    // URL, like '/app.abcd1234.js'. Return as-is.
+    if (typeof entry === 'string') {
+        const urlObject = new URL(entry, location.href);
+        return {
+            cacheKey: urlObject.href,
+            url: urlObject.href,
+        };
+    }
+    const { revision, url } = entry;
+    if (!url) {
+        throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });
+    }
+    // If there's just a URL and no revision, then it's also assumed to be a
+    // versioned URL.
+    if (!revision) {
+        const urlObject = new URL(url, location.href);
+        return {
+            cacheKey: urlObject.href,
+            url: urlObject.href,
+        };
+    }
+    // Otherwise, construct a properly versioned URL using the custom Workbox
+    // search parameter along with the revision info.
+    const cacheKeyURL = new URL(url, location.href);
+    const originalURL = new URL(url, location.href);
+    cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);
+    return {
+        cacheKey: cacheKeyURL.href,
+        url: originalURL.href,
+    };
+}
diff --git a/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.mjs b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..559f584ac6114996bc8410ac6d0551d2fb259618
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/createCacheKey.mjs
@@ -0,0 +1 @@
+export * from './createCacheKey.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.d.ts b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2f5ae807efbdf15464e0a43aecf6b4913975752e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.d.ts
@@ -0,0 +1,21 @@
+import '../_version.js';
+/**
+ * Cleans up incompatible precaches that were created by older versions of
+ * Workbox, by a service worker registered under the current scope.
+ *
+ * This is meant to be called as part of the `activate` event.
+ *
+ * This should be safe to use as long as you don't include `substringToFind`
+ * (defaulting to `-precache-`) in your non-precache cache names.
+ *
+ * @param {string} currentPrecacheName The cache name currently in use for
+ * precaching. This cache won't be deleted.
+ * @param {string} [substringToFind='-precache-'] Cache names which include this
+ * substring will be deleted (excluding `currentPrecacheName`).
+ * @return {Array} A list of all the cache names that were deleted.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+declare const deleteOutdatedCaches: (currentPrecacheName: string, substringToFind?: string) => Promise;
+export { deleteOutdatedCaches };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.js b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.js
new file mode 100644
index 0000000000000000000000000000000000000000..aeef71383d2306399cff01044df658e3c829246e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.js
@@ -0,0 +1,38 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+const SUBSTRING_TO_FIND = '-precache-';
+/**
+ * Cleans up incompatible precaches that were created by older versions of
+ * Workbox, by a service worker registered under the current scope.
+ *
+ * This is meant to be called as part of the `activate` event.
+ *
+ * This should be safe to use as long as you don't include `substringToFind`
+ * (defaulting to `-precache-`) in your non-precache cache names.
+ *
+ * @param {string} currentPrecacheName The cache name currently in use for
+ * precaching. This cache won't be deleted.
+ * @param {string} [substringToFind='-precache-'] Cache names which include this
+ * substring will be deleted (excluding `currentPrecacheName`).
+ * @return {Array} A list of all the cache names that were deleted.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+const deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {
+    const cacheNames = await self.caches.keys();
+    const cacheNamesToDelete = cacheNames.filter((cacheName) => {
+        return (cacheName.includes(substringToFind) &&
+            cacheName.includes(self.registration.scope) &&
+            cacheName !== currentPrecacheName);
+    });
+    await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));
+    return cacheNamesToDelete;
+};
+export { deleteOutdatedCaches };
diff --git a/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.mjs b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..03cbf0907f0be1f7f9bea03f28123dc7f044bf18
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/deleteOutdatedCaches.mjs
@@ -0,0 +1 @@
+export * from './deleteOutdatedCaches.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.d.ts b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b7f9b6a4d78f86141072270695d9220382d9279b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.d.ts
@@ -0,0 +1,13 @@
+import { PrecacheRouteOptions } from '../_types.js';
+import '../_version.js';
+/**
+ * Generator function that yields possible variations on the original URL to
+ * check, one at a time.
+ *
+ * @param {string} url
+ * @param {Object} options
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export declare function generateURLVariations(url: string, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, }?: PrecacheRouteOptions): Generator;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.js b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.js
new file mode 100644
index 0000000000000000000000000000000000000000..eddb6ce51d7839f7dd3fe793911a0fc1d6ca042a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.js
@@ -0,0 +1,42 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';
+import '../_version.js';
+/**
+ * Generator function that yields possible variations on the original URL to
+ * check, one at a time.
+ *
+ * @param {string} url
+ * @param {Object} options
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {
+    const urlObject = new URL(url, location.href);
+    urlObject.hash = '';
+    yield urlObject.href;
+    const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);
+    yield urlWithoutIgnoredParams.href;
+    if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {
+        const directoryURL = new URL(urlWithoutIgnoredParams.href);
+        directoryURL.pathname += directoryIndex;
+        yield directoryURL.href;
+    }
+    if (cleanURLs) {
+        const cleanURL = new URL(urlWithoutIgnoredParams.href);
+        cleanURL.pathname += '.html';
+        yield cleanURL.href;
+    }
+    if (urlManipulation) {
+        const additionalURLs = urlManipulation({ url: urlObject });
+        for (const urlToAttempt of additionalURLs) {
+            yield urlToAttempt.href;
+        }
+    }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.mjs b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..b936b1ea0fc0ab15e147fd90fcbcafcae5dbf0f1
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/generateURLVariations.mjs
@@ -0,0 +1 @@
+export * from './generateURLVariations.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.d.ts b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8612f7db99dd89b75cad114237fa411fb5238004
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.d.ts
@@ -0,0 +1,14 @@
+import { PrecacheRouteOptions } from '../_types.js';
+import '../_version.js';
+/**
+ * This function will take the request URL and manipulate it based on the
+ * configuration options.
+ *
+ * @param {string} url
+ * @param {Object} options
+ * @return {string} Returns the URL in the cache that matches the request,
+ * if possible.
+ *
+ * @private
+ */
+export declare const getCacheKeyForURL: (url: string, options: PrecacheRouteOptions) => string | void;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.js b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.js
new file mode 100644
index 0000000000000000000000000000000000000000..f83276e67eedc4784ef49a16c7a5213ec8eaaa73
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.js
@@ -0,0 +1,31 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';
+import { generateURLVariations } from './generateURLVariations.js';
+import '../_version.js';
+/**
+ * This function will take the request URL and manipulate it based on the
+ * configuration options.
+ *
+ * @param {string} url
+ * @param {Object} options
+ * @return {string} Returns the URL in the cache that matches the request,
+ * if possible.
+ *
+ * @private
+ */
+export const getCacheKeyForURL = (url, options) => {
+    const precacheController = getOrCreatePrecacheController();
+    const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
+    for (const possibleURL of generateURLVariations(url, options)) {
+        const possibleCacheKey = urlsToCacheKeys.get(possibleURL);
+        if (possibleCacheKey) {
+            return possibleCacheKey;
+        }
+    }
+};
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.mjs b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..04413e30927761b5be55f080a991e5466ae5178e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getCacheKeyForURL.mjs
@@ -0,0 +1 @@
+export * from './getCacheKeyForURL.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.d.ts b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c8524fe4ac447a065650e1f0ee6ba1c419b5a87d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.d.ts
@@ -0,0 +1,7 @@
+import { PrecacheController } from '../PrecacheController.js';
+import '../_version.js';
+/**
+ * @return {PrecacheController}
+ * @private
+ */
+export declare const getOrCreatePrecacheController: () => PrecacheController;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js
new file mode 100644
index 0000000000000000000000000000000000000000..8fbf3a17fdc6b7d4cfbc2f07261c918247c8b6db
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js
@@ -0,0 +1,20 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { PrecacheController } from '../PrecacheController.js';
+import '../_version.js';
+let precacheController;
+/**
+ * @return {PrecacheController}
+ * @private
+ */
+export const getOrCreatePrecacheController = () => {
+    if (!precacheController) {
+        precacheController = new PrecacheController();
+    }
+    return precacheController;
+};
diff --git a/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.mjs b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..c8b64d28e0a2346f628310cf482663f171f62af5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.mjs
@@ -0,0 +1 @@
+export * from './getOrCreatePrecacheController.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.d.ts b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0ed415ef6ba4ca0a7c8b54b36b123f645b46ac67
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.d.ts
@@ -0,0 +1,8 @@
+import '../_version.js';
+/**
+ * @param {Array} deletedURLs
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export declare function printCleanupDetails(deletedURLs: string[]): void;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.js b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.js
new file mode 100644
index 0000000000000000000000000000000000000000..f6da6b3780d15c6424d5324e073101928f993f42
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.js
@@ -0,0 +1,38 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import '../_version.js';
+/**
+ * @param {string} groupTitle
+ * @param {Array} deletedURLs
+ *
+ * @private
+ */
+const logGroup = (groupTitle, deletedURLs) => {
+    logger.groupCollapsed(groupTitle);
+    for (const url of deletedURLs) {
+        logger.log(url);
+    }
+    logger.groupEnd();
+};
+/**
+ * @param {Array} deletedURLs
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function printCleanupDetails(deletedURLs) {
+    const deletionCount = deletedURLs.length;
+    if (deletionCount > 0) {
+        logger.groupCollapsed(`During precaching cleanup, ` +
+            `${deletionCount} cached ` +
+            `request${deletionCount === 1 ? ' was' : 's were'} deleted.`);
+        logGroup('Deleted Cache Requests', deletedURLs);
+        logger.groupEnd();
+    }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.mjs b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..3bd27e1eb2aeab1dd1eb5f81ae395891eda2c605
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printCleanupDetails.mjs
@@ -0,0 +1 @@
+export * from './printCleanupDetails.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.d.ts b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f6f4bb90ae988232826703386c8a44470dd1d6da
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.d.ts
@@ -0,0 +1,9 @@
+import '../_version.js';
+/**
+ * @param {Array} urlsToPrecache
+ * @param {Array} urlsAlreadyPrecached
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export declare function printInstallDetails(urlsToPrecache: string[], urlsAlreadyPrecached: string[]): void;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.js b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.js
new file mode 100644
index 0000000000000000000000000000000000000000..e2c0b90ae37ce798dc9d143c34326bd101e5189c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.js
@@ -0,0 +1,48 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import '../_version.js';
+/**
+ * @param {string} groupTitle
+ * @param {Array} urls
+ *
+ * @private
+ */
+function _nestedGroup(groupTitle, urls) {
+    if (urls.length === 0) {
+        return;
+    }
+    logger.groupCollapsed(groupTitle);
+    for (const url of urls) {
+        logger.log(url);
+    }
+    logger.groupEnd();
+}
+/**
+ * @param {Array} urlsToPrecache
+ * @param {Array} urlsAlreadyPrecached
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {
+    const precachedCount = urlsToPrecache.length;
+    const alreadyPrecachedCount = urlsAlreadyPrecached.length;
+    if (precachedCount || alreadyPrecachedCount) {
+        let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`;
+        if (alreadyPrecachedCount > 0) {
+            message +=
+                ` ${alreadyPrecachedCount} ` +
+                    `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;
+        }
+        logger.groupCollapsed(message);
+        _nestedGroup(`View newly precached URLs.`, urlsToPrecache);
+        _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);
+        logger.groupEnd();
+    }
+}
diff --git a/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.mjs b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..7427057bc6d433932bf253b192fac55580e1b37b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/printInstallDetails.mjs
@@ -0,0 +1 @@
+export * from './printInstallDetails.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.d.ts b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0202c891683e0c714a8fa592f1292d33ccfdc9ad
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.d.ts
@@ -0,0 +1,14 @@
+import '../_version.js';
+/**
+ * Removes any URL search parameters that should be ignored.
+ *
+ * @param {URL} urlObject The original URL.
+ * @param {Array} ignoreURLParametersMatching RegExps to test against
+ * each search parameter name. Matches mean that the search parameter should be
+ * ignored.
+ * @return {URL} The URL with any ignored search parameters removed.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export declare function removeIgnoredSearchParams(urlObject: URL, ignoreURLParametersMatching?: RegExp[]): URL;
diff --git a/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js
new file mode 100644
index 0000000000000000000000000000000000000000..d783ba8825bd374cbd3e18238b38751820fd7122
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js
@@ -0,0 +1,30 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * Removes any URL search parameters that should be ignored.
+ *
+ * @param {URL} urlObject The original URL.
+ * @param {Array} ignoreURLParametersMatching RegExps to test against
+ * each search parameter name. Matches mean that the search parameter should be
+ * ignored.
+ * @return {URL} The URL with any ignored search parameters removed.
+ *
+ * @private
+ * @memberof workbox-precaching
+ */
+export function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {
+    // Convert the iterable into an array at the start of the loop to make sure
+    // deletion doesn't mess up iteration.
+    for (const paramName of [...urlObject.searchParams.keys()]) {
+        if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {
+            urlObject.searchParams.delete(paramName);
+        }
+    }
+    return urlObject;
+}
diff --git a/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.mjs b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..82105f9bc3e6b5a6c9fdb8df6e309f9e8383a907
--- /dev/null
+++ b/tools/ui/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.mjs
@@ -0,0 +1 @@
+export * from './removeIgnoredSearchParams.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/LICENSE b/tools/ui/node_modules/workbox-range-requests/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-range-requests/README.md b/tools/ui/node_modules/workbox-range-requests/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..ac4afc6fd88dbff78f75a6a32a27983ada6b43a3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-range-requests
diff --git a/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.d.ts b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..35e241aa0fd4a50f2357d7aa1f16ff0b18641437
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.d.ts
@@ -0,0 +1,26 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * The range request plugin makes it easy for a request with a 'Range' header to
+ * be fulfilled by a cached response.
+ *
+ * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
+ * and returning the appropriate subset of the cached response body.
+ *
+ * @memberof workbox-range-requests
+ */
+declare class RangeRequestsPlugin implements WorkboxPlugin {
+    /**
+     * @param {Object} options
+     * @param {Request} options.request The original request, which may or may not
+     * contain a Range: header.
+     * @param {Response} options.cachedResponse The complete cached response.
+     * @return {Promise} If request contains a 'Range' header, then a
+     * new response with status 206 whose body is a subset of `cachedResponse` is
+     * returned. Otherwise, `cachedResponse` is returned as-is.
+     *
+     * @private
+     */
+    cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'];
+}
+export { RangeRequestsPlugin };
diff --git a/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.js b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..35d77877c347c5745577aeae650919de2fb3ad9b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.js
@@ -0,0 +1,44 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { createPartialResponse } from './createPartialResponse.js';
+import './_version.js';
+/**
+ * The range request plugin makes it easy for a request with a 'Range' header to
+ * be fulfilled by a cached response.
+ *
+ * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
+ * and returning the appropriate subset of the cached response body.
+ *
+ * @memberof workbox-range-requests
+ */
+class RangeRequestsPlugin {
+    constructor() {
+        /**
+         * @param {Object} options
+         * @param {Request} options.request The original request, which may or may not
+         * contain a Range: header.
+         * @param {Response} options.cachedResponse The complete cached response.
+         * @return {Promise} If request contains a 'Range' header, then a
+         * new response with status 206 whose body is a subset of `cachedResponse` is
+         * returned. Otherwise, `cachedResponse` is returned as-is.
+         *
+         * @private
+         */
+        this.cachedResponseWillBeUsed = async ({ request, cachedResponse, }) => {
+            // Only return a sliced response if there's something valid in the cache,
+            // and there's a Range: header in the request.
+            if (cachedResponse && request.headers.has('range')) {
+                return await createPartialResponse(request, cachedResponse);
+            }
+            // If there was no Range: header, or if cachedResponse wasn't valid, just
+            // pass it through as-is.
+            return cachedResponse;
+        };
+    }
+}
+export { RangeRequestsPlugin };
diff --git a/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.mjs b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..10aa495d58ec8d2e8a07ccef99591edac6280a58
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/RangeRequestsPlugin.mjs
@@ -0,0 +1 @@
+export * from './RangeRequestsPlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/_version.d.ts b/tools/ui/node_modules/workbox-range-requests/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-range-requests/_version.js b/tools/ui/node_modules/workbox-range-requests/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..869636eb16bf0d8af299739fb4a413da3cfd4b8f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:range-requests:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-range-requests/_version.mjs b/tools/ui/node_modules/workbox-range-requests/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..eea9088de15fce8500b25af6336738244b85a22a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:range-requests:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..9225f0065ad1030eae10c86ff973fb4d737b2715
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js
@@ -0,0 +1,242 @@
+this.workbox = this.workbox || {};
+this.workbox.rangeRequests = (function (exports, WorkboxError_js, assert_js, logger_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:range-requests:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @param {Blob} blob A source blob.
+     * @param {number} [start] The offset to use as the start of the
+     * slice.
+     * @param {number} [end] The offset to use as the end of the slice.
+     * @return {Object} An object with `start` and `end` properties, reflecting
+     * the effective boundaries to use given the size of the blob.
+     *
+     * @private
+     */
+    function calculateEffectiveBoundaries(blob, start, end) {
+      {
+        assert_js.assert.isInstance(blob, Blob, {
+          moduleName: 'workbox-range-requests',
+          funcName: 'calculateEffectiveBoundaries',
+          paramName: 'blob'
+        });
+      }
+      const blobSize = blob.size;
+      if (end && end > blobSize || start && start < 0) {
+        throw new WorkboxError_js.WorkboxError('range-not-satisfiable', {
+          size: blobSize,
+          end,
+          start
+        });
+      }
+      let effectiveStart;
+      let effectiveEnd;
+      if (start !== undefined && end !== undefined) {
+        effectiveStart = start;
+        // Range values are inclusive, so add 1 to the value.
+        effectiveEnd = end + 1;
+      } else if (start !== undefined && end === undefined) {
+        effectiveStart = start;
+        effectiveEnd = blobSize;
+      } else if (end !== undefined && start === undefined) {
+        effectiveStart = blobSize - end;
+        effectiveEnd = blobSize;
+      }
+      return {
+        start: effectiveStart,
+        end: effectiveEnd
+      };
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @param {string} rangeHeader A Range: header value.
+     * @return {Object} An object with `start` and `end` properties, reflecting
+     * the parsed value of the Range: header. If either the `start` or `end` are
+     * omitted, then `null` will be returned.
+     *
+     * @private
+     */
+    function parseRangeHeader(rangeHeader) {
+      {
+        assert_js.assert.isType(rangeHeader, 'string', {
+          moduleName: 'workbox-range-requests',
+          funcName: 'parseRangeHeader',
+          paramName: 'rangeHeader'
+        });
+      }
+      const normalizedRangeHeader = rangeHeader.trim().toLowerCase();
+      if (!normalizedRangeHeader.startsWith('bytes=')) {
+        throw new WorkboxError_js.WorkboxError('unit-must-be-bytes', {
+          normalizedRangeHeader
+        });
+      }
+      // Specifying multiple ranges separate by commas is valid syntax, but this
+      // library only attempts to handle a single, contiguous sequence of bytes.
+      // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax
+      if (normalizedRangeHeader.includes(',')) {
+        throw new WorkboxError_js.WorkboxError('single-range-only', {
+          normalizedRangeHeader
+        });
+      }
+      const rangeParts = /(\d*)-(\d*)/.exec(normalizedRangeHeader);
+      // We need either at least one of the start or end values.
+      if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {
+        throw new WorkboxError_js.WorkboxError('invalid-range-values', {
+          normalizedRangeHeader
+        });
+      }
+      return {
+        start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),
+        end: rangeParts[2] === '' ? undefined : Number(rangeParts[2])
+      };
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Given a `Request` and `Response` objects as input, this will return a
+     * promise for a new `Response`.
+     *
+     * If the original `Response` already contains partial content (i.e. it has
+     * a status of 206), then this assumes it already fulfills the `Range:`
+     * requirements, and will return it as-is.
+     *
+     * @param {Request} request A request, which should contain a Range:
+     * header.
+     * @param {Response} originalResponse A response.
+     * @return {Promise} Either a `206 Partial Content` response, with
+     * the response body set to the slice of content specified by the request's
+     * `Range:` header, or a `416 Range Not Satisfiable` response if the
+     * conditions of the `Range:` header can't be met.
+     *
+     * @memberof workbox-range-requests
+     */
+    async function createPartialResponse(request, originalResponse) {
+      try {
+        if ("dev" !== 'production') {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-range-requests',
+            funcName: 'createPartialResponse',
+            paramName: 'request'
+          });
+          assert_js.assert.isInstance(originalResponse, Response, {
+            moduleName: 'workbox-range-requests',
+            funcName: 'createPartialResponse',
+            paramName: 'originalResponse'
+          });
+        }
+        if (originalResponse.status === 206) {
+          // If we already have a 206, then just pass it through as-is;
+          // see https://github.com/GoogleChrome/workbox/issues/1720
+          return originalResponse;
+        }
+        const rangeHeader = request.headers.get('range');
+        if (!rangeHeader) {
+          throw new WorkboxError_js.WorkboxError('no-range-header');
+        }
+        const boundaries = parseRangeHeader(rangeHeader);
+        const originalBlob = await originalResponse.blob();
+        const effectiveBoundaries = calculateEffectiveBoundaries(originalBlob, boundaries.start, boundaries.end);
+        const slicedBlob = originalBlob.slice(effectiveBoundaries.start, effectiveBoundaries.end);
+        const slicedBlobSize = slicedBlob.size;
+        const slicedResponse = new Response(slicedBlob, {
+          // Status code 206 is for a Partial Content response.
+          // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
+          status: 206,
+          statusText: 'Partial Content',
+          headers: originalResponse.headers
+        });
+        slicedResponse.headers.set('Content-Length', String(slicedBlobSize));
+        slicedResponse.headers.set('Content-Range', `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` + `${originalBlob.size}`);
+        return slicedResponse;
+      } catch (error) {
+        {
+          logger_js.logger.warn(`Unable to construct a partial response; returning a ` + `416 Range Not Satisfiable response instead.`);
+          logger_js.logger.groupCollapsed(`View details here.`);
+          logger_js.logger.log(error);
+          logger_js.logger.log(request);
+          logger_js.logger.log(originalResponse);
+          logger_js.logger.groupEnd();
+        }
+        return new Response('', {
+          status: 416,
+          statusText: 'Range Not Satisfiable'
+        });
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * The range request plugin makes it easy for a request with a 'Range' header to
+     * be fulfilled by a cached response.
+     *
+     * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
+     * and returning the appropriate subset of the cached response body.
+     *
+     * @memberof workbox-range-requests
+     */
+    class RangeRequestsPlugin {
+      constructor() {
+        /**
+         * @param {Object} options
+         * @param {Request} options.request The original request, which may or may not
+         * contain a Range: header.
+         * @param {Response} options.cachedResponse The complete cached response.
+         * @return {Promise} If request contains a 'Range' header, then a
+         * new response with status 206 whose body is a subset of `cachedResponse` is
+         * returned. Otherwise, `cachedResponse` is returned as-is.
+         *
+         * @private
+         */
+        this.cachedResponseWillBeUsed = async ({
+          request,
+          cachedResponse
+        }) => {
+          // Only return a sliced response if there's something valid in the cache,
+          // and there's a Range: header in the request.
+          if (cachedResponse && request.headers.has('range')) {
+            return await createPartialResponse(request, cachedResponse);
+          }
+          // If there was no Range: header, or if cachedResponse wasn't valid, just
+          // pass it through as-is.
+          return cachedResponse;
+        };
+      }
+    }
+
+    exports.RangeRequestsPlugin = RangeRequestsPlugin;
+    exports.createPartialResponse = createPartialResponse;
+
+    return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private);
+//# sourceMappingURL=workbox-range-requests.dev.js.map
diff --git a/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js.map b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..80fd0a30253604722f5c9107fcadbc35c06b2d1b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-range-requests.dev.js","sources":["../_version.js","../utils/calculateEffectiveBoundaries.js","../utils/parseRangeHeader.js","../createPartialResponse.js","../RangeRequestsPlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:range-requests:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {Blob} blob A source blob.\n * @param {number} [start] The offset to use as the start of the\n * slice.\n * @param {number} [end] The offset to use as the end of the slice.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the effective boundaries to use given the size of the blob.\n *\n * @private\n */\nfunction calculateEffectiveBoundaries(blob, start, end) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isInstance(blob, Blob, {\n            moduleName: 'workbox-range-requests',\n            funcName: 'calculateEffectiveBoundaries',\n            paramName: 'blob',\n        });\n    }\n    const blobSize = blob.size;\n    if ((end && end > blobSize) || (start && start < 0)) {\n        throw new WorkboxError('range-not-satisfiable', {\n            size: blobSize,\n            end,\n            start,\n        });\n    }\n    let effectiveStart;\n    let effectiveEnd;\n    if (start !== undefined && end !== undefined) {\n        effectiveStart = start;\n        // Range values are inclusive, so add 1 to the value.\n        effectiveEnd = end + 1;\n    }\n    else if (start !== undefined && end === undefined) {\n        effectiveStart = start;\n        effectiveEnd = blobSize;\n    }\n    else if (end !== undefined && start === undefined) {\n        effectiveStart = blobSize - end;\n        effectiveEnd = blobSize;\n    }\n    return {\n        start: effectiveStart,\n        end: effectiveEnd,\n    };\n}\nexport { calculateEffectiveBoundaries };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {string} rangeHeader A Range: header value.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the parsed value of the Range: header. If either the `start` or `end` are\n * omitted, then `null` will be returned.\n *\n * @private\n */\nfunction parseRangeHeader(rangeHeader) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isType(rangeHeader, 'string', {\n            moduleName: 'workbox-range-requests',\n            funcName: 'parseRangeHeader',\n            paramName: 'rangeHeader',\n        });\n    }\n    const normalizedRangeHeader = rangeHeader.trim().toLowerCase();\n    if (!normalizedRangeHeader.startsWith('bytes=')) {\n        throw new WorkboxError('unit-must-be-bytes', { normalizedRangeHeader });\n    }\n    // Specifying multiple ranges separate by commas is valid syntax, but this\n    // library only attempts to handle a single, contiguous sequence of bytes.\n    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax\n    if (normalizedRangeHeader.includes(',')) {\n        throw new WorkboxError('single-range-only', { normalizedRangeHeader });\n    }\n    const rangeParts = /(\\d*)-(\\d*)/.exec(normalizedRangeHeader);\n    // We need either at least one of the start or end values.\n    if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {\n        throw new WorkboxError('invalid-range-values', { normalizedRangeHeader });\n    }\n    return {\n        start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),\n        end: rangeParts[2] === '' ? undefined : Number(rangeParts[2]),\n    };\n}\nexport { parseRangeHeader };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { calculateEffectiveBoundaries } from './utils/calculateEffectiveBoundaries.js';\nimport { parseRangeHeader } from './utils/parseRangeHeader.js';\nimport './_version.js';\n/**\n * Given a `Request` and `Response` objects as input, this will return a\n * promise for a new `Response`.\n *\n * If the original `Response` already contains partial content (i.e. it has\n * a status of 206), then this assumes it already fulfills the `Range:`\n * requirements, and will return it as-is.\n *\n * @param {Request} request A request, which should contain a Range:\n * header.\n * @param {Response} originalResponse A response.\n * @return {Promise} Either a `206 Partial Content` response, with\n * the response body set to the slice of content specified by the request's\n * `Range:` header, or a `416 Range Not Satisfiable` response if the\n * conditions of the `Range:` header can't be met.\n *\n * @memberof workbox-range-requests\n */\nasync function createPartialResponse(request, originalResponse) {\n    try {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-range-requests',\n                funcName: 'createPartialResponse',\n                paramName: 'request',\n            });\n            assert.isInstance(originalResponse, Response, {\n                moduleName: 'workbox-range-requests',\n                funcName: 'createPartialResponse',\n                paramName: 'originalResponse',\n            });\n        }\n        if (originalResponse.status === 206) {\n            // If we already have a 206, then just pass it through as-is;\n            // see https://github.com/GoogleChrome/workbox/issues/1720\n            return originalResponse;\n        }\n        const rangeHeader = request.headers.get('range');\n        if (!rangeHeader) {\n            throw new WorkboxError('no-range-header');\n        }\n        const boundaries = parseRangeHeader(rangeHeader);\n        const originalBlob = await originalResponse.blob();\n        const effectiveBoundaries = calculateEffectiveBoundaries(originalBlob, boundaries.start, boundaries.end);\n        const slicedBlob = originalBlob.slice(effectiveBoundaries.start, effectiveBoundaries.end);\n        const slicedBlobSize = slicedBlob.size;\n        const slicedResponse = new Response(slicedBlob, {\n            // Status code 206 is for a Partial Content response.\n            // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206\n            status: 206,\n            statusText: 'Partial Content',\n            headers: originalResponse.headers,\n        });\n        slicedResponse.headers.set('Content-Length', String(slicedBlobSize));\n        slicedResponse.headers.set('Content-Range', `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` +\n            `${originalBlob.size}`);\n        return slicedResponse;\n    }\n    catch (error) {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.warn(`Unable to construct a partial response; returning a ` +\n                `416 Range Not Satisfiable response instead.`);\n            logger.groupCollapsed(`View details here.`);\n            logger.log(error);\n            logger.log(request);\n            logger.log(originalResponse);\n            logger.groupEnd();\n        }\n        return new Response('', {\n            status: 416,\n            statusText: 'Range Not Satisfiable',\n        });\n    }\n}\nexport { createPartialResponse };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { createPartialResponse } from './createPartialResponse.js';\nimport './_version.js';\n/**\n * The range request plugin makes it easy for a request with a 'Range' header to\n * be fulfilled by a cached response.\n *\n * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback\n * and returning the appropriate subset of the cached response body.\n *\n * @memberof workbox-range-requests\n */\nclass RangeRequestsPlugin {\n    constructor() {\n        /**\n         * @param {Object} options\n         * @param {Request} options.request The original request, which may or may not\n         * contain a Range: header.\n         * @param {Response} options.cachedResponse The complete cached response.\n         * @return {Promise} If request contains a 'Range' header, then a\n         * new response with status 206 whose body is a subset of `cachedResponse` is\n         * returned. Otherwise, `cachedResponse` is returned as-is.\n         *\n         * @private\n         */\n        this.cachedResponseWillBeUsed = async ({ request, cachedResponse, }) => {\n            // Only return a sliced response if there's something valid in the cache,\n            // and there's a Range: header in the request.\n            if (cachedResponse && request.headers.has('range')) {\n                return await createPartialResponse(request, cachedResponse);\n            }\n            // If there was no Range: header, or if cachedResponse wasn't valid, just\n            // pass it through as-is.\n            return cachedResponse;\n        };\n    }\n}\nexport { RangeRequestsPlugin };\n"],"names":["self","_","e","calculateEffectiveBoundaries","blob","start","end","assert","isInstance","Blob","moduleName","funcName","paramName","blobSize","size","WorkboxError","effectiveStart","effectiveEnd","undefined","parseRangeHeader","rangeHeader","isType","normalizedRangeHeader","trim","toLowerCase","startsWith","includes","rangeParts","exec","Number","createPartialResponse","request","originalResponse","process","Request","Response","status","headers","get","boundaries","originalBlob","effectiveBoundaries","slicedBlob","slice","slicedBlobSize","slicedResponse","statusText","set","String","error","logger","warn","groupCollapsed","log","groupEnd","RangeRequestsPlugin","constructor","cachedResponseWillBeUsed","cachedResponse","has"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,8BAA8B,CAAC,IAAIC,CAAC,EAAE;IAC/C,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAIA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASC,4BAA4BA,CAACC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAE;IACpD,EAA2C;IACvCC,IAAAA,gBAAM,CAACC,UAAU,CAACJ,IAAI,EAAEK,IAAI,EAAE;IAC1BC,MAAAA,UAAU,EAAE,wBAAwB;IACpCC,MAAAA,QAAQ,EAAE,8BAA8B;IACxCC,MAAAA,SAAS,EAAE;IACf,KAAC,CAAC;IACN,EAAA;IACA,EAAA,MAAMC,QAAQ,GAAGT,IAAI,CAACU,IAAI;MAC1B,IAAKR,GAAG,IAAIA,GAAG,GAAGO,QAAQ,IAAMR,KAAK,IAAIA,KAAK,GAAG,CAAE,EAAE;IACjD,IAAA,MAAM,IAAIU,4BAAY,CAAC,uBAAuB,EAAE;IAC5CD,MAAAA,IAAI,EAAED,QAAQ;UACdP,GAAG;IACHD,MAAAA;IACJ,KAAC,CAA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Y,CAAC1B,IAAK,CAAA,CAAC,CAAC;IAC3B,IAAA,OAAO+B,cAAc;MACzB,CAAC,CACD,OAAOI,KAAK,EAAE;IACV,IAA2C;IACvCC,MAAAA,gBAAM,CAACC,IAAI,CAAE,CAAA,oDAAA,CAAqD,GAC7D,6CAA4C,CAAC;IAClDD,MAAAA,gBAAM,CAACE,cAAc,CAAE,CAAA,kBAAA,CAAmB,CAAC;IAC3CF,MAAAA,gBAAM,CAACG,GAAG,CAACJ,KAAK,CAAC;IACjBC,MAAAA,gBAAM,CAACG,GAAG,CAACtB,OAAO,CAAC;IACnBmB,MAAAA,gBAAM,CAACG,GAAG,CAACrB,gBAAgB,CAAC;UAC5BkB,gBAAM,CAACI,QAAQ,EAAE;IACrB,IAAA;IACA,IAAA,OAAO,IAAInB,QAAQ,CAAC,EAAE,EAAE;IACpBC,MAAAA,MAAM,EAAE,GAAG;IACXU,MAAAA,UAAU,EAAE;IAChB,KAAC,CAAC;IACN,EAAA;IACJ;;ICtFA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMS,mBAAmB,CAAC;IACtBC,EAAAA,WAAWA,GAAG;IACV;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;QACQ,IAAI,CAACC,wBAAwB,GAAG,OAAO;UAAE1B,OAAO;IAAE2B,MAAAA;IAAgB,KAAC,KAAK;IACpE;IACA;UACA,IAAIA,cAAc,IAAI3B,OAAO,CAACM,OAAO,CAACsB,GAAG,CAAC,OAAO,CAAC,EAAE;IAChD,QAAA,OAAO,MAAM7B,qBAAqB,CAACC,OAAO,EAAE2B,cAAc,CAAC;IAC/D,MAAA;IACA;IACA;IACA,MAAA,OAAOA,cAAc;QACzB,CAAC;IACL,EAAA;IACJ;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..b336ada0f712c22ef65fab4f19069c0eeca4b3dc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.rangeRequests=function(t,e,n){"use strict";try{self["workbox:range-requests:7.4.0"]&&_()}catch(t){}async function r(t,n){try{if(206===n.status)return n;const r=t.headers.get("range");if(!r)throw new e.WorkboxError("no-range-header");const s=function(t){const n=t.trim().toLowerCase();if(!n.startsWith("bytes="))throw new e.WorkboxError("unit-must-be-bytes",{normalizedRangeHeader:n});if(n.includes(","))throw new e.WorkboxError("single-range-only",{normalizedRangeHeader:n});const r=/(\d*)-(\d*)/.exec(n);if(!r||!r[1]&&!r[2])throw new e.WorkboxError("invalid-range-values",{normalizedRangeHeader:n});return{start:""===r[1]?void 0:Number(r[1]),end:""===r[2]?void 0:Number(r[2])}}(r),a=await n.blob(),o=function(t,n,r){const s=t.size;if(r&&r>s||n&&n<0)throw new e.WorkboxError("range-not-satisfiable",{size:s,end:r,start:n});let a,o;return void 0!==n&&void 0!==r?(a=n,o=r+1):void 0!==n&&void 0===r?(a=n,o=s):void 0!==r&&void 0===n&&(a=s-r,o=s),{start:a,end:o}}(a,s.start,s.end),i=a.slice(o.start,o.end),d=i.size,u=new Response(i,{status:206,statusText:"Partial Content",headers:n.headers});return u.headers.set("Content-Length",String(d)),u.headers.set("Content-Range",`bytes ${o.start}-${o.end-1}/${a.size}`),u}catch(t){return new Response("",{status:416,statusText:"Range Not Satisfiable"})}}return t.RangeRequestsPlugin=class{constructor(){this.cachedResponseWillBeUsed=async({request:t,cachedResponse:e})=>e&&t.headers.has("range")?await r(t,e):e}},t.createPartialResponse=r,t}({},workbox.core._private,workbox.core._private);
+//# sourceMappingURL=workbox-range-requests.prod.js.map
diff --git a/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js.map b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..c6fe2c4c98bebf15326b3892af00fd85dd5a8194
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/build/workbox-range-requests.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-range-requests.prod.js","sources":["../_version.js","../createPartialResponse.js","../utils/parseRangeHeader.js","../utils/calculateEffectiveBoundaries.js","../RangeRequestsPlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:range-requests:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { calculateEffectiveBoundaries } from './utils/calculateEffectiveBoundaries.js';\nimport { parseRangeHeader } from './utils/parseRangeHeader.js';\nimport './_version.js';\n/**\n * Given a `Request` and `Response` objects as input, this will return a\n * promise for a new `Response`.\n *\n * If the original `Response` already contains partial content (i.e. it has\n * a status of 206), then this assumes it already fulfills the `Range:`\n * requirements, and will return it as-is.\n *\n * @param {Request} request A request, which should contain a Range:\n * header.\n * @param {Response} originalResponse A response.\n * @return {Promise} Either a `206 Partial Content` response, with\n * the response body set to the slice of content specified by the request's\n * `Range:` header, or a `416 Range Not Satisfiable` response if the\n * conditions of the `Range:` header can't be met.\n *\n * @memberof workbox-range-requests\n */\nasync function createPartialResponse(request, originalResponse) {\n    try {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-range-requests',\n                funcName: 'createPartialResponse',\n                paramName: 'request',\n            });\n            assert.isInstance(originalResponse, Response, {\n                moduleName: 'workbox-range-requests',\n                funcName: 'createPartialResponse',\n                paramName: 'originalResponse',\n            });\n        }\n        if (originalResponse.status === 206) {\n            // If we already have a 206, then just pass it through as-is;\n            // see https://github.com/GoogleChrome/workbox/issues/1720\n            return originalResponse;\n        }\n        const rangeHeader = request.headers.get('range');\n        if (!rangeHeader) {\n            throw new WorkboxError('no-range-header');\n        }\n        const boundaries = parseRangeHeader(rangeHeader);\n        const originalBlob = await originalResponse.blob();\n        const effectiveBoundaries = calculateEffectiveBoundaries(originalBlob, boundaries.start, boundaries.end);\n        const slicedBlob = originalBlob.slice(effectiveBoundaries.start, effectiveBoundaries.end);\n        const slicedBlobSize = slicedBlob.size;\n        const slicedResponse = new Response(slicedBlob, {\n            // Status code 206 is for a Partial Content response.\n            // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206\n            status: 206,\n            statusText: 'Partial Content',\n            headers: originalResponse.headers,\n        });\n        slicedResponse.headers.set('Content-Length', String(slicedBlobSize));\n        slicedResponse.headers.set('Content-Range', `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` +\n            `${originalBlob.size}`);\n        return slicedResponse;\n    }\n    catch (error) {\n        if (process.env.NODE_ENV !== 'production') {\n            logger.warn(`Unable to construct a partial response; returning a ` +\n                `416 Range Not Satisfiable response instead.`);\n            logger.groupCollapsed(`View details here.`);\n            logger.log(error);\n            logger.log(request);\n            logger.log(originalResponse);\n            logger.groupEnd();\n        }\n        return new Response('', {\n            status: 416,\n            statusText: 'Range Not Satisfiable',\n        });\n    }\n}\nexport { createPartialResponse };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {string} rangeHeader A Range: header value.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the parsed value of the Range: header. If either the `start` or `end` are\n * omitted, then `null` will be returned.\n *\n * @private\n */\nfunction parseRangeHeader(rangeHeader) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isType(rangeHeader, 'string', {\n            moduleName: 'workbox-range-requests',\n            funcName: 'parseRangeHeader',\n            paramName: 'rangeHeader',\n        });\n    }\n    const normalizedRangeHeader = rangeHeader.trim().toLowerCase();\n    if (!normalizedRangeHeader.startsWith('bytes=')) {\n        throw new WorkboxError('unit-must-be-bytes', { normalizedRangeHeader });\n    }\n    // Specifying multiple ranges separate by commas is valid syntax, but this\n    // library only attempts to handle a single, contiguous sequence of bytes.\n    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax\n    if (normalizedRangeHeader.includes(',')) {\n        throw new WorkboxError('single-range-only', { normalizedRangeHeader });\n    }\n    const rangeParts = /(\\d*)-(\\d*)/.exec(normalizedRangeHeader);\n    // We need either at least one of the start or end values.\n    if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {\n        throw new WorkboxError('invalid-range-values', { normalizedRangeHeader });\n    }\n    return {\n        start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),\n        end: rangeParts[2] === '' ? undefined : Number(rangeParts[2]),\n    };\n}\nexport { parseRangeHeader };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {Blob} blob A source blob.\n * @param {number} [start] The offset to use as the start of the\n * slice.\n * @param {number} [end] The offset to use as the end of the slice.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the effective boundaries to use given the size of the blob.\n *\n * @private\n */\nfunction calculateEffectiveBoundaries(blob, start, end) {\n    if (process.env.NODE_ENV !== 'production') {\n        assert.isInstance(blob, Blob, {\n            moduleName: 'workbox-range-requests',\n            funcName: 'calculateEffectiveBoundaries',\n            paramName: 'blob',\n        });\n    }\n    const blobSize = blob.size;\n    if ((end && end > blobSize) || (start && start < 0)) {\n        throw new WorkboxError('range-not-satisfiable', {\n            size: blobSize,\n            end,\n            start,\n        });\n    }\n    let effectiveStart;\n    let effectiveEnd;\n    if (start !== undefined && end !== undefined) {\n        effectiveStart = start;\n        // Range values are inclusive, so add 1 to the value.\n        effectiveEnd = end + 1;\n    }\n    else if (start !== undefined && end === undefined) {\n        effectiveStart = start;\n        effectiveEnd = blobSize;\n    }\n    else if (end !== undefined && start === undefined) {\n        effectiveStart = blobSize - end;\n        effectiveEnd = blobSize;\n    }\n    return {\n        start: effectiveStart,\n        end: effectiveEnd,\n    };\n}\nexport { calculateEffectiveBoundaries };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { createPartialResponse } from './createPartialResponse.js';\nimport './_version.js';\n/**\n * The range request plugin makes it easy for a request with a 'Range' header to\n * be fulfilled by a cached response.\n *\n * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback\n * and returning the appropriate subset of the cached response body.\n *\n * @memberof workbox-range-requests\n */\nclass RangeRequestsPlugin {\n    constructor() {\n        /**\n         * @param {Object} options\n         * @param {Request} options.request The original request, which may or may not\n         * contain a Range: header.\n         * @param {Response} options.cachedResponse The complete cached response.\n         * @return {Promise} If request contains a 'Range' header, then a\n         * new response with status 206 whose body is a subset of `cachedResponse` is\n         * returned. Otherwise, `cachedResponse` is returned as-is.\n         *\n         * @private\n         */\n        this.cachedResponseWillBeUsed = async ({ request, cachedResponse, }) => {\n            // Only return a sliced response if there's something valid in the cache,\n            // and there's a Range: header in the request.\n            if (cachedResponse && request.headers.has('range')) {\n                return await createPartialResponse(request, cachedResponse);\n            }\n            // If there was no Range: header, or if cachedResponse wasn't valid, just\n            // pass it through as-is.\n            return cachedResponse;\n        };\n    }\n}\nexport { RangeRequestsPlugin };\n"],"names":["self","_","e","async","createPartialResponse","request","originalResponse","status","rangeHeader","headers","get","WorkboxError","boundaries","normalizedRangeHeader","trim","toLowerCase","startsWith","includes","rangeParts","exec","start","undefined","Number","end","parseRangeHeader","originalBlob","blob","effectiveBoundaries","blobSize","size","effectiveStart","effectiveEnd","calculateEffectiveBoundaries","slicedBlob","slice","slicedBlobSize","slicedResponse","Response","statusText","set","String","error","constructor","this","cachedResponseWillBeUsed","cachedResponse","has"],"mappings":"sFAEA,IACIA,KAAK,iCAAmCC,GAC5C,CACA,MAAOC,GAAK,CC0BZC,eAAeC,EAAsBC,EAASC,GAC1C,IAaI,GAAgC,MAA5BA,EAAiBC,OAGjB,OAAOD,EAEX,MAAME,EAAcH,EAAQI,QAAQC,IAAI,SACxC,IAAKF,EACD,MAAM,IAAIG,EAAAA,aAAa,mBAE3B,MAAMC,ECpCd,SAA0BJ,GAQtB,MAAMK,EAAwBL,EAAYM,OAAOC,cACjD,IAAKF,EAAsBG,WAAW,UAClC,MAAM,IAAIL,EAAAA,aAAa,qBAAsB,CAAEE,0BAKnD,GAAIA,EAAsBI,SAAS,KAC/B,MAAM,IAAIN,EAAAA,aAAa,oBAAqB,CAAEE,0BAElD,MAAMK,EAAa,cAAcC,KAAKN,GAEtC,IAAKK,IAAgBA,EAAW,KAAMA,EAAW,GAC7C,MAAM,IAAIP,EAAAA,aAAa,uBAAwB,CAAEE,0BAErD,MAAO,CACHO,MAAyB,KAAlBF,EAAW,QAAYG,EAAYC,OAAOJ,EAAW,IAC5DK,IAAuB,KAAlBL,EAAW,QAAYG,EAAYC,OAAOJ,EAAW,IAElE,CDS2BM,CAAiBhB,GAC9BiB,QAAqBnB,EAAiBoB,OACtCC,EEpCd,SAAsCD,EAAMN,EAAOG,GAQ/C,MAAMK,EAAWF,EAAKG,KACtB,GAAKN,GAAOA,EAAMK,GAAcR,GAASA,EAAQ,EAC7C,MAAM,IAAIT,EAAAA,aAAa,wBAAyB,CAC5CkB,KAAMD,EACNL,MACAH,UAGR,IAAIU,EACAC,EAcJ,YAbcV,IAAVD,QAA+BC,IAARE,GACvBO,EAAiBV,EAEjBW,EAAeR,EAAM,QAENF,IAAVD,QAA+BC,IAARE,GAC5BO,EAAiBV,EACjBW,EAAeH,QAEFP,IAARE,QAA+BF,IAAVD,IAC1BU,EAAiBF,EAAWL,EAC5BQ,EAAeH,GAEZ,CACHR,MAAOU,EACPP,IAAKQ,EAEb,CFCoCC,CAA6BP,EAAcb,EAAWQ,MAAOR,EAAWW,KAC9FU,EAAaR,EAAaS,MAAMP,EAAoBP,MAAOO,EAAoBJ,KAC/EY,EAAiBF,EAAWJ,KAC5BO,EAAiB,IAAIC,SAASJ,EAAY,CAG5C1B,OAAQ,IACR+B,WAAY,kBACZ7B,QAASH,EAAiBG,UAK9B,OAHA2B,EAAe3B,QAAQ8B,IAAI,iBAAkBC,OAAOL,IACpDC,EAAe3B,QAAQ8B,IAAI,gBAAkB,SAAQZ,EAAoBP,SAASO,EAAoBJ,IAAM,KACrGE,EAAaI,QACbO,CACX,CACA,MAAOK,GAUH,OAAO,IAAIJ,SAAS,GAAI,CACpB9B,OAAQ,IACR+B,WAAY,yBAEpB,CACJ,8BGpEA,MACII,cAYIC,KAAKC,yBAA2BzC,OAASE,UAASwC,oBAG1CA,GAAkBxC,EAAQI,QAAQqC,IAAI,eACzB1C,EAAsBC,EAASwC,GAIzCA,CAEf"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/createPartialResponse.d.ts b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e2f050ed494768a5ed971131f10012aff0ca77aa
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.d.ts
@@ -0,0 +1,21 @@
+import './_version.js';
+/**
+ * Given a `Request` and `Response` objects as input, this will return a
+ * promise for a new `Response`.
+ *
+ * If the original `Response` already contains partial content (i.e. it has
+ * a status of 206), then this assumes it already fulfills the `Range:`
+ * requirements, and will return it as-is.
+ *
+ * @param {Request} request A request, which should contain a Range:
+ * header.
+ * @param {Response} originalResponse A response.
+ * @return {Promise} Either a `206 Partial Content` response, with
+ * the response body set to the slice of content specified by the request's
+ * `Range:` header, or a `416 Range Not Satisfiable` response if the
+ * conditions of the `Range:` header can't be met.
+ *
+ * @memberof workbox-range-requests
+ */
+declare function createPartialResponse(request: Request, originalResponse: Response): Promise;
+export { createPartialResponse };
diff --git a/tools/ui/node_modules/workbox-range-requests/createPartialResponse.js b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.js
new file mode 100644
index 0000000000000000000000000000000000000000..2bbf3f5c3ed51fc85e862b1c220b47d12e24fb61
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.js
@@ -0,0 +1,88 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { calculateEffectiveBoundaries } from './utils/calculateEffectiveBoundaries.js';
+import { parseRangeHeader } from './utils/parseRangeHeader.js';
+import './_version.js';
+/**
+ * Given a `Request` and `Response` objects as input, this will return a
+ * promise for a new `Response`.
+ *
+ * If the original `Response` already contains partial content (i.e. it has
+ * a status of 206), then this assumes it already fulfills the `Range:`
+ * requirements, and will return it as-is.
+ *
+ * @param {Request} request A request, which should contain a Range:
+ * header.
+ * @param {Response} originalResponse A response.
+ * @return {Promise} Either a `206 Partial Content` response, with
+ * the response body set to the slice of content specified by the request's
+ * `Range:` header, or a `416 Range Not Satisfiable` response if the
+ * conditions of the `Range:` header can't be met.
+ *
+ * @memberof workbox-range-requests
+ */
+async function createPartialResponse(request, originalResponse) {
+    try {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-range-requests',
+                funcName: 'createPartialResponse',
+                paramName: 'request',
+            });
+            assert.isInstance(originalResponse, Response, {
+                moduleName: 'workbox-range-requests',
+                funcName: 'createPartialResponse',
+                paramName: 'originalResponse',
+            });
+        }
+        if (originalResponse.status === 206) {
+            // If we already have a 206, then just pass it through as-is;
+            // see https://github.com/GoogleChrome/workbox/issues/1720
+            return originalResponse;
+        }
+        const rangeHeader = request.headers.get('range');
+        if (!rangeHeader) {
+            throw new WorkboxError('no-range-header');
+        }
+        const boundaries = parseRangeHeader(rangeHeader);
+        const originalBlob = await originalResponse.blob();
+        const effectiveBoundaries = calculateEffectiveBoundaries(originalBlob, boundaries.start, boundaries.end);
+        const slicedBlob = originalBlob.slice(effectiveBoundaries.start, effectiveBoundaries.end);
+        const slicedBlobSize = slicedBlob.size;
+        const slicedResponse = new Response(slicedBlob, {
+            // Status code 206 is for a Partial Content response.
+            // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
+            status: 206,
+            statusText: 'Partial Content',
+            headers: originalResponse.headers,
+        });
+        slicedResponse.headers.set('Content-Length', String(slicedBlobSize));
+        slicedResponse.headers.set('Content-Range', `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` +
+            `${originalBlob.size}`);
+        return slicedResponse;
+    }
+    catch (error) {
+        if (process.env.NODE_ENV !== 'production') {
+            logger.warn(`Unable to construct a partial response; returning a ` +
+                `416 Range Not Satisfiable response instead.`);
+            logger.groupCollapsed(`View details here.`);
+            logger.log(error);
+            logger.log(request);
+            logger.log(originalResponse);
+            logger.groupEnd();
+        }
+        return new Response('', {
+            status: 416,
+            statusText: 'Range Not Satisfiable',
+        });
+    }
+}
+export { createPartialResponse };
diff --git a/tools/ui/node_modules/workbox-range-requests/createPartialResponse.mjs b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..9ba6eda307a12002d5ab066c0636a6cf8cdbed0d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/createPartialResponse.mjs
@@ -0,0 +1 @@
+export * from './createPartialResponse.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/index.d.ts b/tools/ui/node_modules/workbox-range-requests/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c6ea160e8ab36b7591570252a30a51791af2a979
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/index.d.ts
@@ -0,0 +1,7 @@
+import { createPartialResponse } from './createPartialResponse.js';
+import { RangeRequestsPlugin } from './RangeRequestsPlugin.js';
+import './_version.js';
+/**
+ * @module workbox-range-requests
+ */
+export { createPartialResponse, RangeRequestsPlugin };
diff --git a/tools/ui/node_modules/workbox-range-requests/index.js b/tools/ui/node_modules/workbox-range-requests/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..5912fccad7910aa91bfc07d5322c830127b03ec4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/index.js
@@ -0,0 +1,14 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { createPartialResponse } from './createPartialResponse.js';
+import { RangeRequestsPlugin } from './RangeRequestsPlugin.js';
+import './_version.js';
+/**
+ * @module workbox-range-requests
+ */
+export { createPartialResponse, RangeRequestsPlugin };
diff --git a/tools/ui/node_modules/workbox-range-requests/index.mjs b/tools/ui/node_modules/workbox-range-requests/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/package.json b/tools/ui/node_modules/workbox-range-requests/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6be70b0d3910afad68ec73ae90f4a999498404ed
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/package.json
@@ -0,0 +1,35 @@
+{
+  "name": "workbox-range-requests",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "This library creates a new Response, given a source Response and a Range header value.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "caching",
+    "cache",
+    "range",
+    "media",
+    "workbox-plugin"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.rangeRequests",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-range-requests/src/RangeRequestsPlugin.ts b/tools/ui/node_modules/workbox-range-requests/src/RangeRequestsPlugin.ts
new file mode 100644
index 0000000000000000000000000000000000000000..80b06982518ba631769a2cf1f8aa2b1665338de4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/RangeRequestsPlugin.ts
@@ -0,0 +1,50 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxPlugin} from 'workbox-core/types.js';
+import {createPartialResponse} from './createPartialResponse.js';
+import './_version.js';
+
+/**
+ * The range request plugin makes it easy for a request with a 'Range' header to
+ * be fulfilled by a cached response.
+ *
+ * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
+ * and returning the appropriate subset of the cached response body.
+ *
+ * @memberof workbox-range-requests
+ */
+class RangeRequestsPlugin implements WorkboxPlugin {
+  /**
+   * @param {Object} options
+   * @param {Request} options.request The original request, which may or may not
+   * contain a Range: header.
+   * @param {Response} options.cachedResponse The complete cached response.
+   * @return {Promise} If request contains a 'Range' header, then a
+   * new response with status 206 whose body is a subset of `cachedResponse` is
+   * returned. Otherwise, `cachedResponse` is returned as-is.
+   *
+   * @private
+   */
+  cachedResponseWillBeUsed: WorkboxPlugin['cachedResponseWillBeUsed'] = async ({
+    request,
+    cachedResponse,
+  }) => {
+    // Only return a sliced response if there's something valid in the cache,
+    // and there's a Range: header in the request.
+    if (cachedResponse && request.headers.has('range')) {
+      return await createPartialResponse(request, cachedResponse);
+    }
+
+    // If there was no Range: header, or if cachedResponse wasn't valid, just
+    // pass it through as-is.
+    return cachedResponse;
+  };
+}
+
+export {RangeRequestsPlugin};
diff --git a/tools/ui/node_modules/workbox-range-requests/src/_version.ts b/tools/ui/node_modules/workbox-range-requests/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a1d14bb325cc144fca7e835188692f36c77a1697
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:range-requests:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/src/createPartialResponse.ts b/tools/ui/node_modules/workbox-range-requests/src/createPartialResponse.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e7eca6f28f18954252061ea75b0decfebb42355a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/createPartialResponse.ts
@@ -0,0 +1,115 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {calculateEffectiveBoundaries} from './utils/calculateEffectiveBoundaries.js';
+import {parseRangeHeader} from './utils/parseRangeHeader.js';
+import './_version.js';
+
+/**
+ * Given a `Request` and `Response` objects as input, this will return a
+ * promise for a new `Response`.
+ *
+ * If the original `Response` already contains partial content (i.e. it has
+ * a status of 206), then this assumes it already fulfills the `Range:`
+ * requirements, and will return it as-is.
+ *
+ * @param {Request} request A request, which should contain a Range:
+ * header.
+ * @param {Response} originalResponse A response.
+ * @return {Promise} Either a `206 Partial Content` response, with
+ * the response body set to the slice of content specified by the request's
+ * `Range:` header, or a `416 Range Not Satisfiable` response if the
+ * conditions of the `Range:` header can't be met.
+ *
+ * @memberof workbox-range-requests
+ */
+async function createPartialResponse(
+  request: Request,
+  originalResponse: Response,
+): Promise {
+  try {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-range-requests',
+        funcName: 'createPartialResponse',
+        paramName: 'request',
+      });
+
+      assert!.isInstance(originalResponse, Response, {
+        moduleName: 'workbox-range-requests',
+        funcName: 'createPartialResponse',
+        paramName: 'originalResponse',
+      });
+    }
+
+    if (originalResponse.status === 206) {
+      // If we already have a 206, then just pass it through as-is;
+      // see https://github.com/GoogleChrome/workbox/issues/1720
+      return originalResponse;
+    }
+
+    const rangeHeader = request.headers.get('range');
+    if (!rangeHeader) {
+      throw new WorkboxError('no-range-header');
+    }
+
+    const boundaries = parseRangeHeader(rangeHeader);
+    const originalBlob = await originalResponse.blob();
+
+    const effectiveBoundaries = calculateEffectiveBoundaries(
+      originalBlob,
+      boundaries.start,
+      boundaries.end,
+    );
+
+    const slicedBlob = originalBlob.slice(
+      effectiveBoundaries.start,
+      effectiveBoundaries.end,
+    );
+    const slicedBlobSize = slicedBlob.size;
+
+    const slicedResponse = new Response(slicedBlob, {
+      // Status code 206 is for a Partial Content response.
+      // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
+      status: 206,
+      statusText: 'Partial Content',
+      headers: originalResponse.headers,
+    });
+
+    slicedResponse.headers.set('Content-Length', String(slicedBlobSize));
+    slicedResponse.headers.set(
+      'Content-Range',
+      `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` +
+        `${originalBlob.size}`,
+    );
+
+    return slicedResponse;
+  } catch (error) {
+    if (process.env.NODE_ENV !== 'production') {
+      logger.warn(
+        `Unable to construct a partial response; returning a ` +
+          `416 Range Not Satisfiable response instead.`,
+      );
+      logger.groupCollapsed(`View details here.`);
+      logger.log(error);
+      logger.log(request);
+      logger.log(originalResponse);
+      logger.groupEnd();
+    }
+
+    return new Response('', {
+      status: 416,
+      statusText: 'Range Not Satisfiable',
+    });
+  }
+}
+
+export {createPartialResponse};
diff --git a/tools/ui/node_modules/workbox-range-requests/src/index.ts b/tools/ui/node_modules/workbox-range-requests/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..52e4c9caf5946a227f33095586575e4ff35e98db
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/index.ts
@@ -0,0 +1,17 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {createPartialResponse} from './createPartialResponse.js';
+import {RangeRequestsPlugin} from './RangeRequestsPlugin.js';
+import './_version.js';
+
+/**
+ * @module workbox-range-requests
+ */
+
+export {createPartialResponse, RangeRequestsPlugin};
diff --git a/tools/ui/node_modules/workbox-range-requests/src/utils/calculateEffectiveBoundaries.ts b/tools/ui/node_modules/workbox-range-requests/src/utils/calculateEffectiveBoundaries.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d4cb72478b657d4a858e5bb936047dec2fd296a6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/utils/calculateEffectiveBoundaries.ts
@@ -0,0 +1,67 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {assert} from 'workbox-core/_private/assert.js';
+import '../_version.js';
+
+/**
+ * @param {Blob} blob A source blob.
+ * @param {number} [start] The offset to use as the start of the
+ * slice.
+ * @param {number} [end] The offset to use as the end of the slice.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the effective boundaries to use given the size of the blob.
+ *
+ * @private
+ */
+function calculateEffectiveBoundaries(
+  blob: Blob,
+  start?: number,
+  end?: number,
+): {start: number; end: number} {
+  if (process.env.NODE_ENV !== 'production') {
+    assert!.isInstance(blob, Blob, {
+      moduleName: 'workbox-range-requests',
+      funcName: 'calculateEffectiveBoundaries',
+      paramName: 'blob',
+    });
+  }
+
+  const blobSize = blob.size;
+
+  if ((end && end > blobSize) || (start && start < 0)) {
+    throw new WorkboxError('range-not-satisfiable', {
+      size: blobSize,
+      end,
+      start,
+    });
+  }
+
+  let effectiveStart: number;
+  let effectiveEnd: number;
+
+  if (start !== undefined && end !== undefined) {
+    effectiveStart = start;
+    // Range values are inclusive, so add 1 to the value.
+    effectiveEnd = end + 1;
+  } else if (start !== undefined && end === undefined) {
+    effectiveStart = start;
+    effectiveEnd = blobSize;
+  } else if (end !== undefined && start === undefined) {
+    effectiveStart = blobSize - end;
+    effectiveEnd = blobSize;
+  }
+
+  return {
+    start: effectiveStart!,
+    end: effectiveEnd!,
+  };
+}
+
+export {calculateEffectiveBoundaries};
diff --git a/tools/ui/node_modules/workbox-range-requests/src/utils/parseRangeHeader.ts b/tools/ui/node_modules/workbox-range-requests/src/utils/parseRangeHeader.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c3e1d02ed50d1d1e22b661bf00b5b4e689406034
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/src/utils/parseRangeHeader.ts
@@ -0,0 +1,54 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {assert} from 'workbox-core/_private/assert.js';
+import '../_version.js';
+
+/**
+ * @param {string} rangeHeader A Range: header value.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the parsed value of the Range: header. If either the `start` or `end` are
+ * omitted, then `null` will be returned.
+ *
+ * @private
+ */
+function parseRangeHeader(rangeHeader: string): {start?: number; end?: number} {
+  if (process.env.NODE_ENV !== 'production') {
+    assert!.isType(rangeHeader, 'string', {
+      moduleName: 'workbox-range-requests',
+      funcName: 'parseRangeHeader',
+      paramName: 'rangeHeader',
+    });
+  }
+
+  const normalizedRangeHeader = rangeHeader.trim().toLowerCase();
+  if (!normalizedRangeHeader.startsWith('bytes=')) {
+    throw new WorkboxError('unit-must-be-bytes', {normalizedRangeHeader});
+  }
+
+  // Specifying multiple ranges separate by commas is valid syntax, but this
+  // library only attempts to handle a single, contiguous sequence of bytes.
+  // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax
+  if (normalizedRangeHeader.includes(',')) {
+    throw new WorkboxError('single-range-only', {normalizedRangeHeader});
+  }
+
+  const rangeParts = /(\d*)-(\d*)/.exec(normalizedRangeHeader);
+  // We need either at least one of the start or end values.
+  if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {
+    throw new WorkboxError('invalid-range-values', {normalizedRangeHeader});
+  }
+
+  return {
+    start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),
+    end: rangeParts[2] === '' ? undefined : Number(rangeParts[2]),
+  };
+}
+
+export {parseRangeHeader};
diff --git a/tools/ui/node_modules/workbox-range-requests/tsconfig.json b/tools/ui/node_modules/workbox-range-requests/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..2457eadcf8e39664b6315f538007e7de076be21d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/tsconfig.json
@@ -0,0 +1,10 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [{"path": "../workbox-core/"}]
+}
diff --git a/tools/ui/node_modules/workbox-range-requests/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-range-requests/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..44e0d57cafd1531fbf9ff5d5b5ff374ecea9ef39
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-core/_private/workboxerror.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/logger.d.ts","./src/_version.ts","./src/utils/calculateeffectiveboundaries.ts","./src/utils/parserangeheader.ts","./src/createpartialresponse.ts","./src/rangerequestsplugin.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5","7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},{"version":"077ff491a017793dc27efbdd4f3d1e005b89db20edb22a8298a5f6e0a734eeff","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"00c8999313050ea357c783263ccc11cdc5f2ae3297648bea518f9714b4b2b44b","signature":"2b6581fcbda4f8da9734dcbbe4a97d77ea1a03964a1806f711dcca28f2165dd4"},{"version":"4def0e16150751157aace9a7f4136c815f144250edd4cc64d2f6a5f5025544d9","signature":"1134e18a8944f5125bbaf2e38880715594613cefc1c9e4c655b9e7c9fa1af6a8"},{"version":"133b05bbd8a9349d04bfab60da15d01426af9962854848c38140daf528025ce7","signature":"9c4373a9c694f549945dbc651b0277ef5403317485f9a72f68053af868a53923"},{"version":"a654b295f0f5ca27750475527e3559e9d28aea04ee5d0074c02bd99f727bd184","signature":"f6b5df4cb6e04eb4c52f961dfd5b707aba729019116a24fa676f87d3b030df9c"},{"version":"c366ab4c98fa67922573845d1dc8f0950cb93fb50c05cf0a6f3010c3e1ca6fde","signature":"e89a89cf91ba8b70bf321156cbab5f324dd0431550591ab6716e40b81bd29d4d"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[72,114],[54,72,114],[54,55,56,57,58,72,114],[54,56,72,114],[63,65,72,114],[62,63,64,72,114],[72,114,127,163],[72,114,126,163,165],[72,114,188],[72,114,173],[72,114,177,178,179],[72,114,176],[72,114,178],[72,114,168,174,175,180,183,185,186,187],[72,114,175,181,182,188],[72,114,181,184],[72,114,175,176,181,188],[72,114,175,188],[72,114,169,170,171,172],[72,111,114],[72,113,114],[72,114,119,148],[72,114,115,120,126,127,134,145,156],[72,114,115,116,126,134],[67,68,69,72,114],[72,114,117,157],[72,114,118,119,127,135],[72,114,119,145,153],[72,114,120,122,126,134],[72,113,114,121],[72,114,122,123],[72,114,126],[72,114,124,126],[72,113,114,126],[72,114,126,127,128,145,156],[72,114,126,127,128,141,145,148],[72,109,114,161],[72,114,122,126,129,134,145,156],[72,114,126,127,129,130,134,145,153,156],[72,114,129,131,145,153,156],[72,114,126,132],[72,114,133,156,161],[72,114,122,126,134,145],[72,114,135],[72,114,136],[72,113,114,137],[72,111,112,113,114,115,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162],[72,114,139],[72,114,140],[72,114,126,141,142],[72,114,141,143,157,159],[72,114,126,145,146,148],[72,114,147,148],[72,114,145,146],[72,114,148],[72,114,149],[72,111,114,145],[72,114,126,151,152],[72,114,151,152],[72,114,119,134,145,153],[72,114,154],[114],[70,71,72,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162],[72,114,134,155],[72,114,129,140,156],[72,114,119,157],[72,114,145,158],[72,114,133,159],[72,114,160],[72,114,119,126,128,137,145,156,159,161],[72,114,145,162],[72,114,194,233],[72,114,194,218,233],[72,114,233],[72,114,194],[72,114,194,219,233],[72,114,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232],[72,114,219,233],[72,114,237],[72,114,163,240,241,242,243,244,245,246,247,248,249,250],[72,114,239,240,249],[72,114,240,249],[72,114,234,239,240,249],[72,114,239,240,241,242,243,244,245,246,247,248,250],[72,114,240],[72,114,119,239,249],[72,81,85,114,156],[72,81,114,145,156],[72,76,114],[72,78,81,114,153,156],[72,114,134,153],[72,114,163],[72,76,114,163],[72,78,81,114,134,156],[72,73,74,77,80,114,126,145,156],[72,81,88,114],[72,73,79,114],[72,81,102,103,114],[72,77,81,114,148,156,163],[72,102,114,163],[72,75,76,114,163],[72,81,114],[72,75,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,103,104,105,106,107,108,114],[72,81,96,114],[72,81,88,89,114],[72,79,81,89,90,114],[72,80,114],[72,73,76,81,114],[72,81,85,89,90,114],[72,85,114],[72,79,81,84,114,156],[72,73,78,81,88,114],[72,114,145],[72,76,81,102,114,161,163],[44,72,114],[45,46,47,49,50,72,114],[51,52,72,114],[44,51,72,114],[45,46,72,114],[51,52],[44]],"referencedMap":[[42,1],[56,2],[54,1],[59,3],[55,2],[60,1],[57,4],[58,2],[61,1],[66,5],[62,1],[65,6],[63,1],[164,7],[166,8],[167,1],[64,1],[168,1],[189,9],[174,10],[180,11],[178,1],[177,12],[179,13],[188,14],[183,15],[185,16],[186,17],[187,18],[181,1],[182,18],[184,18],[176,18],[175,1],[170,1],[169,1],[172,10],[173,19],[171,10],[165,1],[190,1],[111,20],[112,20],[113,21],[114,22],[115,23],[116,24],[67,1],[70,25],[68,1],[69,1],[117,26],[118,27],[119,28],[120,29],[121,30],[122,31],[123,31],[125,32],[124,33],[126,34],[127,35],[128,36],[110,37],[129,38],[130,39],[131,40],[132,41],[133,42],[134,43],[135,44],[136,45],[137,46],[138,47],[139,48],[140,49],[141,50],[142,50],[143,51],[144,1],[145,52],[147,53],[146,54],[148,55],[149,56],[150,57],[151,58],[152,59],[153,60],[154,61],[72,62],[71,1],[163,63],[155,64],[156,65],[157,66],[158,67],[159,68],[160,69],[161,70],[162,71],[191,1],[192,1],[193,1],[218,72],[219,73],[194,74],[197,74],[216,72],[217,72],[207,72],[206,75],[204,72],[199,72],[212,72],[210,72],[214,72],[198,72],[211,72],[215,72],[200,72],[201,72],[213,72],[195,72],[202,72],[203,72],[205,72],[209,72],[220,76],[208,72],[196,72],[233,77],[232,1],[227,76],[229,78],[228,76],[221,76],[222,76],[224,76],[226,76],[230,78],[231,78],[223,78],[225,78],[234,1],[235,1],[236,1],[238,79],[237,1],[251,80],[250,81],[241,82],[242,83],[249,84],[243,83],[244,82],[245,82],[246,82],[247,85],[240,86],[248,81],[239,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[88,87],[98,88],[87,87],[108,89],[79,90],[78,91],[107,92],[101,93],[106,94],[81,95],[95,96],[80,97],[104,98],[76,99],[75,92],[105,100],[77,101],[82,102],[83,1],[86,102],[73,1],[109,103],[99,104],[90,105],[91,106],[93,107],[89,108],[92,109],[102,92],[84,110],[85,111],[94,112],[74,113],[97,104],[96,102],[100,1],[103,114],[46,115],[47,1],[45,115],[43,1],[44,1],[48,1],[51,116],[53,117],[52,118],[49,119],[50,119]],"exportedModulesMap":[[42,1],[56,2],[54,1],[59,3],[55,2],[60,1],[57,4],[58,2],[61,1],[66,5],[62,1],[65,6],[63,1],[164,7],[166,8],[167,1],[64,1],[168,1],[189,9],[174,10],[180,11],[178,1],[177,12],[179,13],[188,14],[183,15],[185,16],[186,17],[187,18],[181,1],[182,18],[184,18],[176,18],[175,1],[170,1],[169,1],[172,10],[173,19],[171,10],[165,1],[190,1],[111,20],[112,20],[113,21],[114,22],[115,23],[116,24],[67,1],[70,25],[68,1],[69,1],[117,26],[118,27],[119,28],[120,29],[121,30],[122,31],[123,31],[125,32],[124,33],[126,34],[127,35],[128,36],[110,37],[129,38],[130,39],[131,40],[132,41],[133,42],[134,43],[135,44],[136,45],[137,46],[138,47],[139,48],[140,49],[141,50],[142,50],[143,51],[144,1],[145,52],[147,53],[146,54],[148,55],[149,56],[150,57],[151,58],[152,59],[153,60],[154,61],[72,62],[71,1],[163,63],[155,64],[156,65],[157,66],[158,67],[159,68],[160,69],[161,70],[162,71],[191,1],[192,1],[193,1],[218,72],[219,73],[194,74],[197,74],[216,72],[217,72],[207,72],[206,75],[204,72],[199,72],[212,72],[210,72],[214,72],[198,72],[211,72],[215,72],[200,72],[201,72],[213,72],[195,72],[202,72],[203,72],[205,72],[209,72],[220,76],[208,72],[196,72],[233,77],[232,1],[227,76],[229,78],[228,76],[221,76],[222,76],[224,76],[226,76],[230,78],[231,78],[223,78],[225,78],[234,1],[235,1],[236,1],[238,79],[237,1],[251,80],[250,81],[241,82],[242,83],[249,84],[243,83],[244,82],[245,82],[246,82],[247,85],[240,86],[248,81],[239,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[88,87],[98,88],[87,87],[108,89],[79,90],[78,91],[107,92],[101,93],[106,94],[81,95],[95,96],[80,97],[104,98],[76,99],[75,92],[105,100],[77,101],[82,102],[83,1],[86,102],[73,1],[109,103],[99,104],[90,105],[91,106],[93,107],[89,108],[92,109],[102,92],[84,110],[85,111],[94,112],[74,113],[97,104],[96,102],[100,1],[103,114],[46,115],[47,1],[45,115],[43,1],[44,1],[53,120],[52,121]],"semanticDiagnosticsPerFile":[42,56,54,59,55,60,57,58,61,66,62,65,63,164,166,167,64,168,189,174,180,178,177,179,188,183,185,186,187,181,182,184,176,175,170,169,172,173,171,165,190,111,112,113,114,115,116,67,70,68,69,117,118,119,120,121,122,123,125,124,126,127,128,110,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,72,71,163,155,156,157,158,159,160,161,162,191,192,193,218,219,194,197,216,217,207,206,204,199,212,210,214,198,211,215,200,201,213,195,202,203,205,209,220,208,196,233,232,227,229,228,221,222,224,226,230,231,223,225,234,235,236,238,237,251,250,241,242,249,243,244,245,246,247,240,248,239,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,88,98,87,108,79,78,107,101,106,81,95,80,104,76,75,105,77,82,83,86,73,109,99,90,91,93,89,92,102,84,85,94,74,97,96,100,103,46,47,45,43,44,48,51,53,52,49,50],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.d.ts b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0f16da43012fe1d31dfff3445c873aee2d6411f8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.d.ts
@@ -0,0 +1,16 @@
+import '../_version.js';
+/**
+ * @param {Blob} blob A source blob.
+ * @param {number} [start] The offset to use as the start of the
+ * slice.
+ * @param {number} [end] The offset to use as the end of the slice.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the effective boundaries to use given the size of the blob.
+ *
+ * @private
+ */
+declare function calculateEffectiveBoundaries(blob: Blob, start?: number, end?: number): {
+    start: number;
+    end: number;
+};
+export { calculateEffectiveBoundaries };
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.js b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.js
new file mode 100644
index 0000000000000000000000000000000000000000..14014b02759bab52b334c1bc9830ec88f550df99
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.js
@@ -0,0 +1,57 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { assert } from 'workbox-core/_private/assert.js';
+import '../_version.js';
+/**
+ * @param {Blob} blob A source blob.
+ * @param {number} [start] The offset to use as the start of the
+ * slice.
+ * @param {number} [end] The offset to use as the end of the slice.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the effective boundaries to use given the size of the blob.
+ *
+ * @private
+ */
+function calculateEffectiveBoundaries(blob, start, end) {
+    if (process.env.NODE_ENV !== 'production') {
+        assert.isInstance(blob, Blob, {
+            moduleName: 'workbox-range-requests',
+            funcName: 'calculateEffectiveBoundaries',
+            paramName: 'blob',
+        });
+    }
+    const blobSize = blob.size;
+    if ((end && end > blobSize) || (start && start < 0)) {
+        throw new WorkboxError('range-not-satisfiable', {
+            size: blobSize,
+            end,
+            start,
+        });
+    }
+    let effectiveStart;
+    let effectiveEnd;
+    if (start !== undefined && end !== undefined) {
+        effectiveStart = start;
+        // Range values are inclusive, so add 1 to the value.
+        effectiveEnd = end + 1;
+    }
+    else if (start !== undefined && end === undefined) {
+        effectiveStart = start;
+        effectiveEnd = blobSize;
+    }
+    else if (end !== undefined && start === undefined) {
+        effectiveStart = blobSize - end;
+        effectiveEnd = blobSize;
+    }
+    return {
+        start: effectiveStart,
+        end: effectiveEnd,
+    };
+}
+export { calculateEffectiveBoundaries };
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.mjs b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..2d136076e18928e50d64ec9ee1aba48e42b0ce8d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.mjs
@@ -0,0 +1 @@
+export * from './calculateEffectiveBoundaries.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.d.ts b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..549a67e99de34ad5c7c65ea07ad515192a5317c9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.d.ts
@@ -0,0 +1,14 @@
+import '../_version.js';
+/**
+ * @param {string} rangeHeader A Range: header value.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the parsed value of the Range: header. If either the `start` or `end` are
+ * omitted, then `null` will be returned.
+ *
+ * @private
+ */
+declare function parseRangeHeader(rangeHeader: string): {
+    start?: number;
+    end?: number;
+};
+export { parseRangeHeader };
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.js b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.js
new file mode 100644
index 0000000000000000000000000000000000000000..2909d27e17e9898b95d63b6eb4a15ce0690da47b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.js
@@ -0,0 +1,47 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { assert } from 'workbox-core/_private/assert.js';
+import '../_version.js';
+/**
+ * @param {string} rangeHeader A Range: header value.
+ * @return {Object} An object with `start` and `end` properties, reflecting
+ * the parsed value of the Range: header. If either the `start` or `end` are
+ * omitted, then `null` will be returned.
+ *
+ * @private
+ */
+function parseRangeHeader(rangeHeader) {
+    if (process.env.NODE_ENV !== 'production') {
+        assert.isType(rangeHeader, 'string', {
+            moduleName: 'workbox-range-requests',
+            funcName: 'parseRangeHeader',
+            paramName: 'rangeHeader',
+        });
+    }
+    const normalizedRangeHeader = rangeHeader.trim().toLowerCase();
+    if (!normalizedRangeHeader.startsWith('bytes=')) {
+        throw new WorkboxError('unit-must-be-bytes', { normalizedRangeHeader });
+    }
+    // Specifying multiple ranges separate by commas is valid syntax, but this
+    // library only attempts to handle a single, contiguous sequence of bytes.
+    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax
+    if (normalizedRangeHeader.includes(',')) {
+        throw new WorkboxError('single-range-only', { normalizedRangeHeader });
+    }
+    const rangeParts = /(\d*)-(\d*)/.exec(normalizedRangeHeader);
+    // We need either at least one of the start or end values.
+    if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {
+        throw new WorkboxError('invalid-range-values', { normalizedRangeHeader });
+    }
+    return {
+        start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),
+        end: rangeParts[2] === '' ? undefined : Number(rangeParts[2]),
+    };
+}
+export { parseRangeHeader };
diff --git a/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.mjs b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..cb298de106d69f68d4cee0f6c591628b1d169da2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-range-requests/utils/parseRangeHeader.mjs
@@ -0,0 +1 @@
+export * from './parseRangeHeader.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/LICENSE b/tools/ui/node_modules/workbox-recipes/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-recipes/README.md b/tools/ui/node_modules/workbox-recipes/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..7c1f2728b9c87ed9c15659313b1ec6f3f63f1886
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-recipes
diff --git a/tools/ui/node_modules/workbox-recipes/_version.d.ts b/tools/ui/node_modules/workbox-recipes/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-recipes/_version.js b/tools/ui/node_modules/workbox-recipes/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..d8450dec93690b6f2af0daff690ef051d9a92237
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:recipes:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-recipes/_version.mjs b/tools/ui/node_modules/workbox-recipes/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..716dee4ff7280d029e1369185af8dff81da8620f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:recipes:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..44d2cd25c85f34abaa98c4e57f65d60fc1dca42c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js
@@ -0,0 +1,268 @@
+this.workbox = this.workbox || {};
+this.workbox.recipes = (function (exports, registerRoute_js, StaleWhileRevalidate_js, CacheFirst_js, CacheableResponsePlugin_js, ExpirationPlugin_js, NetworkFirst_js, setCatchHandler_js, matchPrecache_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:recipes:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe
+     *
+     * @memberof workbox-recipes
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts
+     * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year
+     * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30
+     */
+    function googleFontsCache(options = {}) {
+      const sheetCacheName = `${options.cachePrefix || 'google-fonts'}-stylesheets`;
+      const fontCacheName = `${options.cachePrefix || 'google-fonts'}-webfonts`;
+      const maxAgeSeconds = options.maxAgeSeconds || 60 * 60 * 24 * 365;
+      const maxEntries = options.maxEntries || 30;
+      // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.
+      registerRoute_js.registerRoute(({
+        url
+      }) => url.origin === 'https://fonts.googleapis.com', new StaleWhileRevalidate_js.StaleWhileRevalidate({
+        cacheName: sheetCacheName
+      }));
+      // Cache the underlying font files with a cache-first strategy for 1 year.
+      registerRoute_js.registerRoute(({
+        url
+      }) => url.origin === 'https://fonts.gstatic.com', new CacheFirst_js.CacheFirst({
+        cacheName: fontCacheName,
+        plugins: [new CacheableResponsePlugin_js.CacheableResponsePlugin({
+          statuses: [0, 200]
+        }), new ExpirationPlugin_js.ExpirationPlugin({
+          maxAgeSeconds,
+          maxEntries
+        })]
+      }));
+    }
+
+    /**
+     * @memberof workbox-recipes
+     
+     * @param {Object} options
+     * @param {string[]} options.urls Paths to warm the strategy's cache with
+     * @param {Strategy} options.strategy Strategy to use
+     */
+    function warmStrategyCache(options) {
+      self.addEventListener('install', event => {
+        const done = options.urls.map(path => options.strategy.handleAll({
+          event,
+          request: new Request(path)
+        })[1]);
+        event.waitUntil(Promise.all(done));
+      });
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}
+     *
+     * @memberof workbox-recipes
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Name for cache. Defaults to images
+     * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';
+     * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days
+     * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60
+     * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+     * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+     */
+    function imageCache(options = {}) {
+      const defaultMatchCallback = ({
+        request
+      }) => request.destination === 'image';
+      const cacheName = options.cacheName || 'images';
+      const matchCallback = options.matchCallback || defaultMatchCallback;
+      const maxAgeSeconds = options.maxAgeSeconds || 30 * 24 * 60 * 60;
+      const maxEntries = options.maxEntries || 60;
+      const plugins = options.plugins || [];
+      plugins.push(new CacheableResponsePlugin_js.CacheableResponsePlugin({
+        statuses: [0, 200]
+      }));
+      plugins.push(new ExpirationPlugin_js.ExpirationPlugin({
+        maxEntries,
+        maxAgeSeconds
+      }));
+      const strategy = new CacheFirst_js.CacheFirst({
+        cacheName,
+        plugins
+      });
+      registerRoute_js.registerRoute(matchCallback, strategy);
+      // Warms the cache
+      if (options.warmCache) {
+        warmStrategyCache({
+          urls: options.warmCache,
+          strategy
+        });
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}
+     *
+     * @memberof workbox-recipes
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Name for cache. Defaults to static-resources
+     * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
+     * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+     * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+     */
+    function staticResourceCache(options = {}) {
+      const defaultMatchCallback = ({
+        request
+      }) => request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
+      const cacheName = options.cacheName || 'static-resources';
+      const matchCallback = options.matchCallback || defaultMatchCallback;
+      const plugins = options.plugins || [];
+      plugins.push(new CacheableResponsePlugin_js.CacheableResponsePlugin({
+        statuses: [0, 200]
+      }));
+      const strategy = new StaleWhileRevalidate_js.StaleWhileRevalidate({
+        cacheName,
+        plugins
+      });
+      registerRoute_js.registerRoute(matchCallback, strategy);
+      // Warms the cache
+      if (options.warmCache) {
+        warmStrategyCache({
+          urls: options.warmCache,
+          strategy
+        });
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a page caching recipe with a network timeout
+     *
+     * @memberof workbox-recipes
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Name for cache. Defaults to pages
+     * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';
+     * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3
+     * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+     * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+     */
+    function pageCache(options = {}) {
+      const defaultMatchCallback = ({
+        request
+      }) => request.mode === 'navigate';
+      const cacheName = options.cacheName || 'pages';
+      const matchCallback = options.matchCallback || defaultMatchCallback;
+      const networkTimeoutSeconds = options.networkTimeoutSeconds || 3;
+      const plugins = options.plugins || [];
+      plugins.push(new CacheableResponsePlugin_js.CacheableResponsePlugin({
+        statuses: [0, 200]
+      }));
+      const strategy = new NetworkFirst_js.NetworkFirst({
+        networkTimeoutSeconds,
+        cacheName,
+        plugins
+      });
+      // Registers the route
+      registerRoute_js.registerRoute(matchCallback, strategy);
+      // Warms the cache
+      if (options.warmCache) {
+        warmStrategyCache({
+          urls: options.warmCache,
+          strategy
+        });
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection
+     *
+     * @memberof workbox-recipes
+     *
+     * @param {Object} [options]
+     * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html
+     * @param {string} [options.imageFallback] Precache name to match for image fallbacks.
+     * @param {string} [options.fontFallback] Precache name to match for font fallbacks.
+     */
+    function offlineFallback(options = {}) {
+      const pageFallback = options.pageFallback || 'offline.html';
+      const imageFallback = options.imageFallback || false;
+      const fontFallback = options.fontFallback || false;
+      self.addEventListener('install', event => {
+        const files = [pageFallback];
+        if (imageFallback) {
+          files.push(imageFallback);
+        }
+        if (fontFallback) {
+          files.push(fontFallback);
+        }
+        event.waitUntil(self.caches.open('workbox-offline-fallbacks').then(cache => cache.addAll(files)));
+      });
+      const handler = async options => {
+        const dest = options.request.destination;
+        const cache = await self.caches.open('workbox-offline-fallbacks');
+        if (dest === 'document') {
+          const match = (await matchPrecache_js.matchPrecache(pageFallback)) || (await cache.match(pageFallback));
+          return match || Response.error();
+        }
+        if (dest === 'image' && imageFallback !== false) {
+          const match = (await matchPrecache_js.matchPrecache(imageFallback)) || (await cache.match(imageFallback));
+          return match || Response.error();
+        }
+        if (dest === 'font' && fontFallback !== false) {
+          const match = (await matchPrecache_js.matchPrecache(fontFallback)) || (await cache.match(fontFallback));
+          return match || Response.error();
+        }
+        return Response.error();
+      };
+      setCatchHandler_js.setCatchHandler(handler);
+    }
+
+    exports.googleFontsCache = googleFontsCache;
+    exports.imageCache = imageCache;
+    exports.offlineFallback = offlineFallback;
+    exports.pageCache = pageCache;
+    exports.staticResourceCache = staticResourceCache;
+    exports.warmStrategyCache = warmStrategyCache;
+
+    return exports;
+
+})({}, workbox.routing, workbox.strategies, workbox.strategies, workbox.cacheableResponse, workbox.expiration, workbox.strategies, workbox.routing, workbox.precaching);
+//# sourceMappingURL=workbox-recipes.dev.js.map
diff --git a/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js.map b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..2aeac245c518db44e45ee6ba48c26a2a1c1de084
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-recipes.dev.js","sources":["../_version.js","../googleFontsCache.js","../warmStrategyCache.js","../imageCache.js","../staticResourceCache.js","../pageCache.js","../offlineFallback.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:recipes:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';\nimport { CacheFirst } from 'workbox-strategies/CacheFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts\n * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year\n * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30\n */\nfunction googleFontsCache(options = {}) {\n    const sheetCacheName = `${options.cachePrefix || 'google-fonts'}-stylesheets`;\n    const fontCacheName = `${options.cachePrefix || 'google-fonts'}-webfonts`;\n    const maxAgeSeconds = options.maxAgeSeconds || 60 * 60 * 24 * 365;\n    const maxEntries = options.maxEntries || 30;\n    // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.\n    registerRoute(({ url }) => url.origin === 'https://fonts.googleapis.com', new StaleWhileRevalidate({\n        cacheName: sheetCacheName,\n    }));\n    // Cache the underlying font files with a cache-first strategy for 1 year.\n    registerRoute(({ url }) => url.origin === 'https://fonts.gstatic.com', new CacheFirst({\n        cacheName: fontCacheName,\n        plugins: [\n            new CacheableResponsePlugin({\n                statuses: [0, 200],\n            }),\n            new ExpirationPlugin({\n                maxAgeSeconds,\n                maxEntries,\n            }),\n        ],\n    }));\n}\nexport { googleFontsCache };\n","import './_version.js';\n/**\n * @memberof workbox-recipes\n \n * @param {Object} options\n * @param {string[]} options.urls Paths to warm the strategy's cache with\n * @param {Strategy} options.strategy Strategy to use\n */\nfunction warmStrategyCache(options) {\n    self.addEventListener('install', (event) => {\n        const done = options.urls.map((path) => options.strategy.handleAll({\n            event,\n            request: new Request(path),\n        })[1]);\n        event.waitUntil(Promise.all(done));\n    });\n}\nexport { warmStrategyCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { CacheFirst } from 'workbox-strategies/CacheFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to images\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';\n * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days\n * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction imageCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.destination === 'image';\n    const cacheName = options.cacheName || 'images';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const maxAgeSeconds = options.maxAgeSeconds || 30 * 24 * 60 * 60;\n    const maxEntries = options.maxEntries || 60;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    plugins.push(new ExpirationPlugin({\n        maxEntries,\n        maxAgeSeconds,\n    }));\n    const strategy = new CacheFirst({\n        cacheName,\n        plugins,\n    });\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { imageCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to static-resources\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction staticResourceCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.destination === 'style' ||\n        request.destination === 'script' ||\n        request.destination === 'worker';\n    const cacheName = options.cacheName || 'static-resources';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    const strategy = new StaleWhileRevalidate({\n        cacheName,\n        plugins,\n    });\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { staticResourceCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a page caching recipe with a network timeout\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to pages\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';\n * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction pageCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.mode === 'navigate';\n    const cacheName = options.cacheName || 'pages';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const networkTimeoutSeconds = options.networkTimeoutSeconds || 3;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    const strategy = new NetworkFirst({\n        networkTimeoutSeconds,\n        cacheName,\n        plugins,\n    });\n    // Registers the route\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { pageCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { setCatchHandler } from 'workbox-routing/setCatchHandler.js';\nimport { matchPrecache } from 'workbox-precaching/matchPrecache.js';\nimport './_version.js';\n/**\n * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html\n * @param {string} [options.imageFallback] Precache name to match for image fallbacks.\n * @param {string} [options.fontFallback] Precache name to match for font fallbacks.\n */\nfunction offlineFallback(options = {}) {\n    const pageFallback = options.pageFallback || 'offline.html';\n    const imageFallback = options.imageFallback || false;\n    const fontFallback = options.fontFallback || false;\n    self.addEventListener('install', (event) => {\n        const files = [pageFallback];\n        if (imageFallback) {\n            files.push(imageFallback);\n        }\n        if (fontFallback) {\n            files.push(fontFallback);\n        }\n        event.waitUntil(self.caches\n            .open('workbox-offline-fallbacks')\n            .then((cache) => cache.addAll(files)));\n    });\n    const handler = async (options) => {\n        const dest = options.request.destination;\n        const cache = await self.caches.open('workbox-offline-fallbacks');\n        if (dest === 'document') {\n            const match = (await matchPrecache(pageFallback)) ||\n                (await cache.match(pageFallback));\n            return match || Response.error();\n        }\n        if (dest === 'image' && imageFallback !== false) {\n            const match = (await matchPrecache(imageFallback)) ||\n                (await cache.match(imageFallback));\n            return match || Response.error();\n        }\n        if (dest === 'font' && fontFallback !== false) {\n            const match = (await matchPrecache(fontFallback)) ||\n                (await cache.match(fontFallback));\n            return match || Response.error();\n        }\n        return Response.error();\n    };\n    setCatchHandler(handler);\n}\nexport { offlineFallback };\n"],"names":["self","_","e","googleFontsCache","options","sheetCacheName","cachePrefix","fontCacheName","maxAgeSeconds","maxEntries","registerRoute","url","origin","StaleWhileRevalidate","cacheName","CacheFirst","plugins","CacheableResponsePlugin","statuses","ExpirationPlugin","warmStrategyCache","addEventListener","event","done","urls","map","path","strategy","handleAll","request","Request","waitUntil","Promise","all","imageCache","defaultMatchCallback","destination","matchCallback","push","warmCache","staticResourceCache","pageCache","mode","networkTimeoutSeconds","NetworkFirst","offlineFallback","pageFallback","imageFallback","fontFallback","files","caches","open","then","cache","addAll","handler","dest","match","matchPrecache","Response","error","setCatchHandler"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,uBAAuB,CAAC,IAAIC,CAAC,EAAE;IACxC,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAOA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASC,gBAAgBA,CAACC,OAAO,GAAG,EAAE,EAAE;MACpC,MAAMC,cAAc,GAAI,CAAA,EAAED,OAAO,CAACE,WAAW,IAAI,cAAe,CAAA,YAAA,CAAa;MAC7E,MAAMC,aAAa,GAAI,CAAA,EAAEH,OAAO,CAACE,WAAW,IAAI,cAAe,CAAA,SAAA,CAAU;IACzE,EAAA,MAAME,aAAa,GAAGJ,OAAO,CAACI,aAAa,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;IACjE,EAAA,MAAMC,UAAU,GAAGL,OAAO,CAACK,UAAU,IAAI,EAAE;IAC3C;IACAC,EAAAA,8BAAa,CAAC,CAAC;IAAEC,IAAAA;OAAK,KAAKA,GAAG,CAACC,MAAM,KAAK,8BAA8B,EAAE,IAAIC,4CAAoB,CAAC;IAC/FC,IAAAA,SAAS,EAAET;IACf,GAAC,CAAC,CAAC;IACH;IACAK,EAAAA,8BAAa,CAAC,CAAC;IAAEC,IAAAA;OAAK,KAAKA,GAAG,CAACC,MAAM,KAAK,2BAA2B,EAAE,IAAIG,wBAAU,CAAC;IAClFD,IAAAA,SAAS,EAAEP,aAAa;IACxBS,IAAAA,OAAO,EAAE,CACL,IAAIC,kDAAuB,CAAC;IACxBC,MAA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,8BAAa,CAACZ,YAAY,CAAC,MAC3C,MAAMO,KAAK,CAACI,KAAK,CAACX,YAAY,CAAC,CAAC;IACrC,MAAA,OAAOW,KAAK,IAAIE,QAAQ,CAACC,KAAK,EAAE;IACpC,IAAA;IACA,IAAA,IAAIJ,IAAI,KAAK,OAAO,IAAIT,aAAa,KAAK,KAAK,EAAE;IAC7C,MAAA,MAAMU,KAAK,GAAG,CAAC,MAAMC,8BAAa,CAACX,aAAa,CAAC,MAC5C,MAAMM,KAAK,CAACI,KAAK,CAACV,aAAa,CAAC,CAAC;IACtC,MAAA,OAAOU,KAAK,IAAIE,QAAQ,CAACC,KAAK,EAAE;IACpC,IAAA;IACA,IAAA,IAAIJ,IAAI,KAAK,MAAM,IAAIR,YAAY,KAAK,KAAK,EAAE;IAC3C,MAAA,MAAMS,KAAK,GAAG,CAAC,MAAMC,8BAAa,CAACV,YAAY,CAAC,MAC3C,MAAMK,KAAK,CAACI,KAAK,CAACT,YAAY,CAAC,CAAC;IACrC,MAAA,OAAOS,KAAK,IAAIE,QAAQ,CAACC,KAAK,EAAE;IACpC,IAAA;IACA,IAAA,OAAOD,QAAQ,CAACC,KAAK,EAAE;MAC3B,CAAC;MACDC,kCAAe,CAACN,OAAO,CAAC;IAC5B;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..e4cc163feaf156caa32ce736e46d1a9be085bebe
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.recipes=function(e,s,t,n,o,a,c,r,i){"use strict";try{self["workbox:recipes:7.4.0"]&&_()}catch(e){}function u(e){self.addEventListener("install",(s=>{const t=e.urls.map((t=>e.strategy.handleAll({event:s,request:new Request(t)})[1]));s.waitUntil(Promise.all(t))}))}return e.googleFontsCache=function(e={}){const c=`${e.cachePrefix||"google-fonts"}-stylesheets`,r=`${e.cachePrefix||"google-fonts"}-webfonts`,i=e.maxAgeSeconds||31536e3,u=e.maxEntries||30;s.registerRoute((({url:e})=>"https://fonts.googleapis.com"===e.origin),new t.StaleWhileRevalidate({cacheName:c})),s.registerRoute((({url:e})=>"https://fonts.gstatic.com"===e.origin),new n.CacheFirst({cacheName:r,plugins:[new o.CacheableResponsePlugin({statuses:[0,200]}),new a.ExpirationPlugin({maxAgeSeconds:i,maxEntries:u})]}))},e.imageCache=function(e={}){const t=e.cacheName||"images",c=e.matchCallback||(({request:e})=>"image"===e.destination),r=e.maxAgeSeconds||2592e3,i=e.maxEntries||60,w=e.plugins||[];w.push(new o.CacheableResponsePlugin({statuses:[0,200]})),w.push(new a.ExpirationPlugin({maxEntries:i,maxAgeSeconds:r}));const l=new n.CacheFirst({cacheName:t,plugins:w});s.registerRoute(c,l),e.warmCache&&u({urls:e.warmCache,strategy:l})},e.offlineFallback=function(e={}){const s=e.pageFallback||"offline.html",t=e.imageFallback||!1,n=e.fontFallback||!1;self.addEventListener("install",(e=>{const o=[s];t&&o.push(t),n&&o.push(n),e.waitUntil(self.caches.open("workbox-offline-fallbacks").then((e=>e.addAll(o))))})),r.setCatchHandler((async e=>{const o=e.request.destination,a=await self.caches.open("workbox-offline-fallbacks");if("document"===o){return await i.matchPrecache(s)||await a.match(s)||Response.error()}if("image"===o&&!1!==t){return await i.matchPrecache(t)||await a.match(t)||Response.error()}if("font"===o&&!1!==n){return await i.matchPrecache(n)||await a.match(n)||Response.error()}return Response.error()}))},e.pageCache=function(e={}){const t=e.cacheName||"pages",n=e.matchCallback||(({request:e})=>"navigate"===e.mode),a=e.networkTimeoutSeconds||3,r=e.plugins||[];r.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const i=new c.NetworkFirst({networkTimeoutSeconds:a,cacheName:t,plugins:r});s.registerRoute(n,i),e.warmCache&&u({urls:e.warmCache,strategy:i})},e.staticResourceCache=function(e={}){const n=e.cacheName||"static-resources",a=e.matchCallback||(({request:e})=>"style"===e.destination||"script"===e.destination||"worker"===e.destination),c=e.plugins||[];c.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const r=new t.StaleWhileRevalidate({cacheName:n,plugins:c});s.registerRoute(a,r),e.warmCache&&u({urls:e.warmCache,strategy:r})},e.warmStrategyCache=u,e}({},workbox.routing,workbox.strategies,workbox.strategies,workbox.cacheableResponse,workbox.expiration,workbox.strategies,workbox.routing,workbox.precaching);
+//# sourceMappingURL=workbox-recipes.prod.js.map
diff --git a/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js.map b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..41c8672aee5e34db3af41ba15a9fcb58b907df6b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/build/workbox-recipes.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-recipes.prod.js","sources":["../_version.js","../warmStrategyCache.js","../googleFontsCache.js","../imageCache.js","../offlineFallback.js","../pageCache.js","../staticResourceCache.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:recipes:7.4.0'] && _();\n}\ncatch (e) { }\n","import './_version.js';\n/**\n * @memberof workbox-recipes\n \n * @param {Object} options\n * @param {string[]} options.urls Paths to warm the strategy's cache with\n * @param {Strategy} options.strategy Strategy to use\n */\nfunction warmStrategyCache(options) {\n    self.addEventListener('install', (event) => {\n        const done = options.urls.map((path) => options.strategy.handleAll({\n            event,\n            request: new Request(path),\n        })[1]);\n        event.waitUntil(Promise.all(done));\n    });\n}\nexport { warmStrategyCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';\nimport { CacheFirst } from 'workbox-strategies/CacheFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts\n * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year\n * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30\n */\nfunction googleFontsCache(options = {}) {\n    const sheetCacheName = `${options.cachePrefix || 'google-fonts'}-stylesheets`;\n    const fontCacheName = `${options.cachePrefix || 'google-fonts'}-webfonts`;\n    const maxAgeSeconds = options.maxAgeSeconds || 60 * 60 * 24 * 365;\n    const maxEntries = options.maxEntries || 30;\n    // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.\n    registerRoute(({ url }) => url.origin === 'https://fonts.googleapis.com', new StaleWhileRevalidate({\n        cacheName: sheetCacheName,\n    }));\n    // Cache the underlying font files with a cache-first strategy for 1 year.\n    registerRoute(({ url }) => url.origin === 'https://fonts.gstatic.com', new CacheFirst({\n        cacheName: fontCacheName,\n        plugins: [\n            new CacheableResponsePlugin({\n                statuses: [0, 200],\n            }),\n            new ExpirationPlugin({\n                maxAgeSeconds,\n                maxEntries,\n            }),\n        ],\n    }));\n}\nexport { googleFontsCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { CacheFirst } from 'workbox-strategies/CacheFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to images\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';\n * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days\n * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction imageCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.destination === 'image';\n    const cacheName = options.cacheName || 'images';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const maxAgeSeconds = options.maxAgeSeconds || 30 * 24 * 60 * 60;\n    const maxEntries = options.maxEntries || 60;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    plugins.push(new ExpirationPlugin({\n        maxEntries,\n        maxAgeSeconds,\n    }));\n    const strategy = new CacheFirst({\n        cacheName,\n        plugins,\n    });\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { imageCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { setCatchHandler } from 'workbox-routing/setCatchHandler.js';\nimport { matchPrecache } from 'workbox-precaching/matchPrecache.js';\nimport './_version.js';\n/**\n * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html\n * @param {string} [options.imageFallback] Precache name to match for image fallbacks.\n * @param {string} [options.fontFallback] Precache name to match for font fallbacks.\n */\nfunction offlineFallback(options = {}) {\n    const pageFallback = options.pageFallback || 'offline.html';\n    const imageFallback = options.imageFallback || false;\n    const fontFallback = options.fontFallback || false;\n    self.addEventListener('install', (event) => {\n        const files = [pageFallback];\n        if (imageFallback) {\n            files.push(imageFallback);\n        }\n        if (fontFallback) {\n            files.push(fontFallback);\n        }\n        event.waitUntil(self.caches\n            .open('workbox-offline-fallbacks')\n            .then((cache) => cache.addAll(files)));\n    });\n    const handler = async (options) => {\n        const dest = options.request.destination;\n        const cache = await self.caches.open('workbox-offline-fallbacks');\n        if (dest === 'document') {\n            const match = (await matchPrecache(pageFallback)) ||\n                (await cache.match(pageFallback));\n            return match || Response.error();\n        }\n        if (dest === 'image' && imageFallback !== false) {\n            const match = (await matchPrecache(imageFallback)) ||\n                (await cache.match(imageFallback));\n            return match || Response.error();\n        }\n        if (dest === 'font' && fontFallback !== false) {\n            const match = (await matchPrecache(fontFallback)) ||\n                (await cache.match(fontFallback));\n            return match || Response.error();\n        }\n        return Response.error();\n    };\n    setCatchHandler(handler);\n}\nexport { offlineFallback };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a page caching recipe with a network timeout\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to pages\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';\n * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction pageCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.mode === 'navigate';\n    const cacheName = options.cacheName || 'pages';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const networkTimeoutSeconds = options.networkTimeoutSeconds || 3;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    const strategy = new NetworkFirst({\n        networkTimeoutSeconds,\n        cacheName,\n        plugins,\n    });\n    // Registers the route\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { pageCache };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { warmStrategyCache } from './warmStrategyCache';\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';\nimport './_version.js';\n/**\n * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}\n *\n * @memberof workbox-recipes\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Name for cache. Defaults to static-resources\n * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';\n * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe\n * @param {string[]} [options.warmCache] Paths to call to use to warm this cache\n */\nfunction staticResourceCache(options = {}) {\n    const defaultMatchCallback = ({ request }) => request.destination === 'style' ||\n        request.destination === 'script' ||\n        request.destination === 'worker';\n    const cacheName = options.cacheName || 'static-resources';\n    const matchCallback = options.matchCallback || defaultMatchCallback;\n    const plugins = options.plugins || [];\n    plugins.push(new CacheableResponsePlugin({\n        statuses: [0, 200],\n    }));\n    const strategy = new StaleWhileRevalidate({\n        cacheName,\n        plugins,\n    });\n    registerRoute(matchCallback, strategy);\n    // Warms the cache\n    if (options.warmCache) {\n        warmStrategyCache({ urls: options.warmCache, strategy });\n    }\n}\nexport { staticResourceCache };\n"],"names":["self","_","e","warmStrategyCache","options","addEventListener","event","done","urls","map","path","strategy","handleAll","request","Request","waitUntil","Promise","all","sheetCacheName","cachePrefix","fontCacheName","maxAgeSeconds","maxEntries","registerRoute","url","origin","StaleWhileRevalidate","cacheName","CacheFirst","plugins","CacheableResponsePlugin","statuses","ExpirationPlugin","matchCallback","defaultMatchCallback","destination","push","warmCache","pageFallback","imageFallback","fontFallback","files","caches","open","then","cache","addAll","setCatchHandler","async","dest","matchPrecache","match","Response","error","mode","networkTimeoutSeconds","NetworkFirst"],"mappings":"4FAEA,IACIA,KAAK,0BAA4BC,GACrC,CACA,MAAOC,GAAK,CCGZ,SAASC,EAAkBC,GACvBJ,KAAKK,iBAAiB,WAAYC,IAC9B,MAAMC,EAAOH,EAAQI,KAAKC,KAAKC,GAASN,EAAQO,SAASC,UAAU,CAC/DN,QACAO,QAAS,IAAIC,QAAQJ,KACtB,KACHJ,EAAMS,UAAUC,QAAQC,IAAIV,GAAM,GAE1C,2BCOA,SAA0BH,EAAU,IAChC,MAAMc,EAAkB,GAAEd,EAAQe,aAAe,6BAC3CC,EAAiB,GAAEhB,EAAQe,aAAe,0BAC1CE,EAAgBjB,EAAQiB,eAAiB,QACzCC,EAAalB,EAAQkB,YAAc,GAEzCC,EAAAA,eAAc,EAAGC,SAAyB,iCAAfA,EAAIC,QAA2C,IAAIC,EAAAA,qBAAqB,CAC/FC,UAAWT,KAGfK,EAAA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AG7C,aAFqBW,gBAAcX,UACxBM,EAAMM,MAAMZ,IACPa,SAASC,OAC7B,CACA,GAAa,SAATJ,IAAoC,IAAjBT,EAAwB,CAG3C,aAFqBU,gBAAcV,UACxBK,EAAMM,MAAMX,IACPY,SAASC,OAC7B,CACA,OAAOD,SAASC,OAAO,GAG/B,cCjCA,SAAmBjD,EAAU,IACzB,MACMuB,EAAYvB,EAAQuB,WAAa,QACjCM,EAAgB7B,EAAQ6B,eAFDC,GAAGrB,aAA+B,aAAjBA,EAAQyC,MAGhDC,EAAwBnD,EAAQmD,uBAAyB,EACzD1B,EAAUzB,EAAQyB,SAAW,GACnCA,EAAQO,KAAK,IAAIN,0BAAwB,CACrCC,SAAU,CAAC,EAAG,QAElB,MAAMpB,EAAW,IAAI6C,eAAa,CAC9BD,wBACA5B,YACAE,YAGJN,EAAAA,cAAcU,EAAetB,GAEzBP,EAAQiC,WACRlC,EAAkB,CAAEK,KAAMJ,EAAQiC,UAAW1B,YAErD,wBCrBA,SAA6BP,EAAU,IACnC,MAGMuB,EAAYvB,EAAQuB,WAAa,mBACjCM,EAAgB7B,EAAQ6B,eAJDC,GAAGrB,aAAsC,UAAxBA,EAAQsB,aAC1B,WAAxBtB,EAAQsB,aACgB,WAAxBtB,EAAQsB,aAGNN,EAAUzB,EAAQyB,SAAW,GACnCA,EAAQO,KAAK,IAAIN,0BAAwB,CACrCC,SAAU,CAAC,EAAG,QAElB,MAAMpB,EAAW,IAAIe,uBAAqB,CACtCC,YACAE,YAEJN,EAAAA,cAAcU,EAAetB,GAEzBP,EAAQiC,WACRlC,EAAkB,CAAEK,KAAMJ,EAAQiC,UAAW1B,YAErD"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/googleFontsCache.d.ts b/tools/ui/node_modules/workbox-recipes/googleFontsCache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c2a15ac757be35e5d83439e1b1285ecd1f399f45
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/googleFontsCache.d.ts
@@ -0,0 +1,18 @@
+import './_version.js';
+export interface GoogleFontCacheOptions {
+    cachePrefix?: string;
+    maxAgeSeconds?: number;
+    maxEntries?: number;
+}
+/**
+ * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year
+ * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30
+ */
+declare function googleFontsCache(options?: GoogleFontCacheOptions): void;
+export { googleFontsCache };
diff --git a/tools/ui/node_modules/workbox-recipes/googleFontsCache.js b/tools/ui/node_modules/workbox-recipes/googleFontsCache.js
new file mode 100644
index 0000000000000000000000000000000000000000..137745b2fc0c9b8c0b049f826234d7efc035ad58
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/googleFontsCache.js
@@ -0,0 +1,47 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { registerRoute } from 'workbox-routing/registerRoute.js';
+import { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';
+import { CacheFirst } from 'workbox-strategies/CacheFirst.js';
+import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';
+import './_version.js';
+/**
+ * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year
+ * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30
+ */
+function googleFontsCache(options = {}) {
+    const sheetCacheName = `${options.cachePrefix || 'google-fonts'}-stylesheets`;
+    const fontCacheName = `${options.cachePrefix || 'google-fonts'}-webfonts`;
+    const maxAgeSeconds = options.maxAgeSeconds || 60 * 60 * 24 * 365;
+    const maxEntries = options.maxEntries || 30;
+    // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.
+    registerRoute(({ url }) => url.origin === 'https://fonts.googleapis.com', new StaleWhileRevalidate({
+        cacheName: sheetCacheName,
+    }));
+    // Cache the underlying font files with a cache-first strategy for 1 year.
+    registerRoute(({ url }) => url.origin === 'https://fonts.gstatic.com', new CacheFirst({
+        cacheName: fontCacheName,
+        plugins: [
+            new CacheableResponsePlugin({
+                statuses: [0, 200],
+            }),
+            new ExpirationPlugin({
+                maxAgeSeconds,
+                maxEntries,
+            }),
+        ],
+    }));
+}
+export { googleFontsCache };
diff --git a/tools/ui/node_modules/workbox-recipes/googleFontsCache.mjs b/tools/ui/node_modules/workbox-recipes/googleFontsCache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..5d504b3422b2b3b1cf6bd9e7dbc876c02190d9be
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/googleFontsCache.mjs
@@ -0,0 +1 @@
+export * from './googleFontsCache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/imageCache.d.ts b/tools/ui/node_modules/workbox-recipes/imageCache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..15409253fe4c40f6ebc4685de975e70fcdb19a85
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/imageCache.d.ts
@@ -0,0 +1,25 @@
+import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+export interface ImageCacheOptions {
+    cacheName?: string;
+    matchCallback?: RouteMatchCallback;
+    maxAgeSeconds?: number;
+    maxEntries?: number;
+    plugins?: Array;
+    warmCache?: Array;
+}
+/**
+ * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to images
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days
+ * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+declare function imageCache(options?: ImageCacheOptions): void;
+export { imageCache };
diff --git a/tools/ui/node_modules/workbox-recipes/imageCache.js b/tools/ui/node_modules/workbox-recipes/imageCache.js
new file mode 100644
index 0000000000000000000000000000000000000000..009398e108095414f75d9eb6c7beb9dbf04a846c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/imageCache.js
@@ -0,0 +1,51 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { warmStrategyCache } from './warmStrategyCache';
+import { registerRoute } from 'workbox-routing/registerRoute.js';
+import { CacheFirst } from 'workbox-strategies/CacheFirst.js';
+import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin.js';
+import './_version.js';
+/**
+ * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to images
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days
+ * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function imageCache(options = {}) {
+    const defaultMatchCallback = ({ request }) => request.destination === 'image';
+    const cacheName = options.cacheName || 'images';
+    const matchCallback = options.matchCallback || defaultMatchCallback;
+    const maxAgeSeconds = options.maxAgeSeconds || 30 * 24 * 60 * 60;
+    const maxEntries = options.maxEntries || 60;
+    const plugins = options.plugins || [];
+    plugins.push(new CacheableResponsePlugin({
+        statuses: [0, 200],
+    }));
+    plugins.push(new ExpirationPlugin({
+        maxEntries,
+        maxAgeSeconds,
+    }));
+    const strategy = new CacheFirst({
+        cacheName,
+        plugins,
+    });
+    registerRoute(matchCallback, strategy);
+    // Warms the cache
+    if (options.warmCache) {
+        warmStrategyCache({ urls: options.warmCache, strategy });
+    }
+}
+export { imageCache };
diff --git a/tools/ui/node_modules/workbox-recipes/imageCache.mjs b/tools/ui/node_modules/workbox-recipes/imageCache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..b730b267e3caa41d693533229846be3a1ef207cc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/imageCache.mjs
@@ -0,0 +1 @@
+export * from './imageCache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/index.d.ts b/tools/ui/node_modules/workbox-recipes/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..dae01e0428201ddc15e988eda8193684964261d7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/index.d.ts
@@ -0,0 +1,11 @@
+import { googleFontsCache, GoogleFontCacheOptions } from './googleFontsCache';
+import { imageCache, ImageCacheOptions } from './imageCache';
+import { staticResourceCache, StaticResourceOptions } from './staticResourceCache';
+import { pageCache, PageCacheOptions } from './pageCache';
+import { offlineFallback, OfflineFallbackOptions } from './offlineFallback';
+import { warmStrategyCache, WarmStrategyCacheOptions } from './warmStrategyCache';
+import './_version.js';
+/**
+ * @module workbox-recipes
+ */
+export { GoogleFontCacheOptions, googleFontsCache, imageCache, ImageCacheOptions, offlineFallback, OfflineFallbackOptions, pageCache, PageCacheOptions, staticResourceCache, StaticResourceOptions, warmStrategyCache, WarmStrategyCacheOptions, };
diff --git a/tools/ui/node_modules/workbox-recipes/index.js b/tools/ui/node_modules/workbox-recipes/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..53031a9470d1613fc1a4bb78cc97fce9fc4eecf0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/index.js
@@ -0,0 +1,18 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { googleFontsCache } from './googleFontsCache';
+import { imageCache } from './imageCache';
+import { staticResourceCache, } from './staticResourceCache';
+import { pageCache } from './pageCache';
+import { offlineFallback } from './offlineFallback';
+import { warmStrategyCache } from './warmStrategyCache';
+import './_version.js';
+/**
+ * @module workbox-recipes
+ */
+export { googleFontsCache, imageCache, offlineFallback, pageCache, staticResourceCache, warmStrategyCache, };
diff --git a/tools/ui/node_modules/workbox-recipes/index.mjs b/tools/ui/node_modules/workbox-recipes/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/offlineFallback.d.ts b/tools/ui/node_modules/workbox-recipes/offlineFallback.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b540b2fa6a3624c9387a3232d3d1e8323e435918
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/offlineFallback.d.ts
@@ -0,0 +1,18 @@
+import './_version.js';
+export interface OfflineFallbackOptions {
+    pageFallback?: string;
+    imageFallback?: string;
+    fontFallback?: string;
+}
+/**
+ * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html
+ * @param {string} [options.imageFallback] Precache name to match for image fallbacks.
+ * @param {string} [options.fontFallback] Precache name to match for font fallbacks.
+ */
+declare function offlineFallback(options?: OfflineFallbackOptions): void;
+export { offlineFallback };
diff --git a/tools/ui/node_modules/workbox-recipes/offlineFallback.js b/tools/ui/node_modules/workbox-recipes/offlineFallback.js
new file mode 100644
index 0000000000000000000000000000000000000000..00f7ed86b151b3c98251444defaee08ec3498435
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/offlineFallback.js
@@ -0,0 +1,59 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { setCatchHandler } from 'workbox-routing/setCatchHandler.js';
+import { matchPrecache } from 'workbox-precaching/matchPrecache.js';
+import './_version.js';
+/**
+ * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html
+ * @param {string} [options.imageFallback] Precache name to match for image fallbacks.
+ * @param {string} [options.fontFallback] Precache name to match for font fallbacks.
+ */
+function offlineFallback(options = {}) {
+    const pageFallback = options.pageFallback || 'offline.html';
+    const imageFallback = options.imageFallback || false;
+    const fontFallback = options.fontFallback || false;
+    self.addEventListener('install', (event) => {
+        const files = [pageFallback];
+        if (imageFallback) {
+            files.push(imageFallback);
+        }
+        if (fontFallback) {
+            files.push(fontFallback);
+        }
+        event.waitUntil(self.caches
+            .open('workbox-offline-fallbacks')
+            .then((cache) => cache.addAll(files)));
+    });
+    const handler = async (options) => {
+        const dest = options.request.destination;
+        const cache = await self.caches.open('workbox-offline-fallbacks');
+        if (dest === 'document') {
+            const match = (await matchPrecache(pageFallback)) ||
+                (await cache.match(pageFallback));
+            return match || Response.error();
+        }
+        if (dest === 'image' && imageFallback !== false) {
+            const match = (await matchPrecache(imageFallback)) ||
+                (await cache.match(imageFallback));
+            return match || Response.error();
+        }
+        if (dest === 'font' && fontFallback !== false) {
+            const match = (await matchPrecache(fontFallback)) ||
+                (await cache.match(fontFallback));
+            return match || Response.error();
+        }
+        return Response.error();
+    };
+    setCatchHandler(handler);
+}
+export { offlineFallback };
diff --git a/tools/ui/node_modules/workbox-recipes/offlineFallback.mjs b/tools/ui/node_modules/workbox-recipes/offlineFallback.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..1a9c311a083ff1b7c86d8d27c13e59c23a3e219a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/offlineFallback.mjs
@@ -0,0 +1 @@
+export * from './offlineFallback.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/package.json b/tools/ui/node_modules/workbox-recipes/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..a64615f6040eb4b702cadffb34d74ee0b7e3d50c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/package.json
@@ -0,0 +1,37 @@
+{
+  "name": "workbox-recipes",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "A service worker helper library to manage common request and caching patterns",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "router",
+    "routing"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.recipes",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-cacheable-response": "7.4.1",
+    "workbox-core": "7.4.1",
+    "workbox-expiration": "7.4.1",
+    "workbox-precaching": "7.4.1",
+    "workbox-routing": "7.4.1",
+    "workbox-strategies": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-recipes/pageCache.d.ts b/tools/ui/node_modules/workbox-recipes/pageCache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5f38f78caed10837dafc0355df8a53beb5d748bc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/pageCache.d.ts
@@ -0,0 +1,23 @@
+import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+export interface PageCacheOptions {
+    cacheName?: string;
+    matchCallback?: RouteMatchCallback;
+    networkTimeoutSeconds?: number;
+    plugins?: Array;
+    warmCache?: Array;
+}
+/**
+ * An implementation of a page caching recipe with a network timeout
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to pages
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';
+ * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+declare function pageCache(options?: PageCacheOptions): void;
+export { pageCache };
diff --git a/tools/ui/node_modules/workbox-recipes/pageCache.js b/tools/ui/node_modules/workbox-recipes/pageCache.js
new file mode 100644
index 0000000000000000000000000000000000000000..3aa4f9c84b4129ba3be923f1cda00be072bc66db
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/pageCache.js
@@ -0,0 +1,46 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { warmStrategyCache } from './warmStrategyCache';
+import { registerRoute } from 'workbox-routing/registerRoute.js';
+import { NetworkFirst } from 'workbox-strategies/NetworkFirst.js';
+import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import './_version.js';
+/**
+ * An implementation of a page caching recipe with a network timeout
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to pages
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';
+ * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function pageCache(options = {}) {
+    const defaultMatchCallback = ({ request }) => request.mode === 'navigate';
+    const cacheName = options.cacheName || 'pages';
+    const matchCallback = options.matchCallback || defaultMatchCallback;
+    const networkTimeoutSeconds = options.networkTimeoutSeconds || 3;
+    const plugins = options.plugins || [];
+    plugins.push(new CacheableResponsePlugin({
+        statuses: [0, 200],
+    }));
+    const strategy = new NetworkFirst({
+        networkTimeoutSeconds,
+        cacheName,
+        plugins,
+    });
+    // Registers the route
+    registerRoute(matchCallback, strategy);
+    // Warms the cache
+    if (options.warmCache) {
+        warmStrategyCache({ urls: options.warmCache, strategy });
+    }
+}
+export { pageCache };
diff --git a/tools/ui/node_modules/workbox-recipes/pageCache.mjs b/tools/ui/node_modules/workbox-recipes/pageCache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..875aab883267ec46528fa2dffe27b8f23db4e4a7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/pageCache.mjs
@@ -0,0 +1 @@
+export * from './pageCache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/src/_version.ts b/tools/ui/node_modules/workbox-recipes/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1580d828ad2617bdc32369aed9e358eeb46f17ca
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:recipes:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/src/googleFontsCache.ts b/tools/ui/node_modules/workbox-recipes/src/googleFontsCache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6fd48665bb1886cc968fad4a3ca2a6fc2551bae9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/googleFontsCache.ts
@@ -0,0 +1,64 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import {registerRoute} from 'workbox-routing/registerRoute.js';
+import {StaleWhileRevalidate} from 'workbox-strategies/StaleWhileRevalidate.js';
+import {CacheFirst} from 'workbox-strategies/CacheFirst.js';
+import {CacheableResponsePlugin} from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import {ExpirationPlugin} from 'workbox-expiration/ExpirationPlugin.js';
+
+import './_version.js';
+
+export interface GoogleFontCacheOptions {
+  cachePrefix?: string;
+  maxAgeSeconds?: number;
+  maxEntries?: number;
+}
+
+/**
+ * An implementation of the [Google fonts]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts} caching recipe
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cachePrefix] Cache prefix for caching stylesheets and webfonts. Defaults to google-fonts
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 1 year
+ * @param {number} [options.maxEntries] Maximum number of fonts that will be cached. Defaults to 30
+ */
+function googleFontsCache(options: GoogleFontCacheOptions = {}): void {
+  const sheetCacheName = `${options.cachePrefix || 'google-fonts'}-stylesheets`;
+  const fontCacheName = `${options.cachePrefix || 'google-fonts'}-webfonts`;
+  const maxAgeSeconds = options.maxAgeSeconds || 60 * 60 * 24 * 365;
+  const maxEntries = options.maxEntries || 30;
+
+  // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.
+  registerRoute(
+    ({url}) => url.origin === 'https://fonts.googleapis.com',
+    new StaleWhileRevalidate({
+      cacheName: sheetCacheName,
+    }),
+  );
+
+  // Cache the underlying font files with a cache-first strategy for 1 year.
+  registerRoute(
+    ({url}) => url.origin === 'https://fonts.gstatic.com',
+    new CacheFirst({
+      cacheName: fontCacheName,
+      plugins: [
+        new CacheableResponsePlugin({
+          statuses: [0, 200],
+        }),
+        new ExpirationPlugin({
+          maxAgeSeconds,
+          maxEntries,
+        }),
+      ],
+    }),
+  );
+}
+
+export {googleFontsCache};
diff --git a/tools/ui/node_modules/workbox-recipes/src/imageCache.ts b/tools/ui/node_modules/workbox-recipes/src/imageCache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..42be8ccef34e458534ec14c10e68212760823108
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/imageCache.ts
@@ -0,0 +1,77 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import {warmStrategyCache} from './warmStrategyCache';
+import {registerRoute} from 'workbox-routing/registerRoute.js';
+import {CacheFirst} from 'workbox-strategies/CacheFirst.js';
+import {CacheableResponsePlugin} from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import {ExpirationPlugin} from 'workbox-expiration/ExpirationPlugin.js';
+import {
+  RouteMatchCallback,
+  RouteMatchCallbackOptions,
+  WorkboxPlugin,
+} from 'workbox-core/types.js';
+
+import './_version.js';
+
+export interface ImageCacheOptions {
+  cacheName?: string;
+  matchCallback?: RouteMatchCallback;
+  maxAgeSeconds?: number;
+  maxEntries?: number;
+  plugins?: Array;
+  warmCache?: Array;
+}
+
+/**
+ * An implementation of the [image caching recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#caching_images}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to images
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'image';
+ * @param {number} [options.maxAgeSeconds] Maximum age, in seconds, that font entries will be cached for. Defaults to 30 days
+ * @param {number} [options.maxEntries] Maximum number of images that will be cached. Defaults to 60
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function imageCache(options: ImageCacheOptions = {}): void {
+  const defaultMatchCallback = ({request}: RouteMatchCallbackOptions) =>
+    request.destination === 'image';
+
+  const cacheName = options.cacheName || 'images';
+  const matchCallback = options.matchCallback || defaultMatchCallback;
+  const maxAgeSeconds = options.maxAgeSeconds || 30 * 24 * 60 * 60;
+  const maxEntries = options.maxEntries || 60;
+  const plugins = options.plugins || [];
+  plugins.push(
+    new CacheableResponsePlugin({
+      statuses: [0, 200],
+    }),
+  );
+  plugins.push(
+    new ExpirationPlugin({
+      maxEntries,
+      maxAgeSeconds,
+    }),
+  );
+
+  const strategy = new CacheFirst({
+    cacheName,
+    plugins,
+  });
+
+  registerRoute(matchCallback, strategy);
+
+  // Warms the cache
+  if (options.warmCache) {
+    warmStrategyCache({urls: options.warmCache, strategy});
+  }
+}
+
+export {imageCache};
diff --git a/tools/ui/node_modules/workbox-recipes/src/index.ts b/tools/ui/node_modules/workbox-recipes/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..702e50e7a7b63842a365924a5569a35077ed78ca
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/index.ts
@@ -0,0 +1,38 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {googleFontsCache, GoogleFontCacheOptions} from './googleFontsCache';
+import {imageCache, ImageCacheOptions} from './imageCache';
+import {
+  staticResourceCache,
+  StaticResourceOptions,
+} from './staticResourceCache';
+import {pageCache, PageCacheOptions} from './pageCache';
+import {offlineFallback, OfflineFallbackOptions} from './offlineFallback';
+import {warmStrategyCache, WarmStrategyCacheOptions} from './warmStrategyCache';
+
+import './_version.js';
+
+/**
+ * @module workbox-recipes
+ */
+
+export {
+  GoogleFontCacheOptions,
+  googleFontsCache,
+  imageCache,
+  ImageCacheOptions,
+  offlineFallback,
+  OfflineFallbackOptions,
+  pageCache,
+  PageCacheOptions,
+  staticResourceCache,
+  StaticResourceOptions,
+  warmStrategyCache,
+  WarmStrategyCacheOptions,
+};
diff --git a/tools/ui/node_modules/workbox-recipes/src/offlineFallback.ts b/tools/ui/node_modules/workbox-recipes/src/offlineFallback.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0b6572f62ce59b81ab8ca1e089f935422cae1170
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/offlineFallback.ts
@@ -0,0 +1,87 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import {setCatchHandler} from 'workbox-routing/setCatchHandler.js';
+import {matchPrecache} from 'workbox-precaching/matchPrecache.js';
+import {RouteHandler, RouteHandlerCallbackOptions} from 'workbox-core/types.js';
+
+import './_version.js';
+
+export interface OfflineFallbackOptions {
+  pageFallback?: string;
+  imageFallback?: string;
+  fontFallback?: string;
+}
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * An implementation of the [comprehensive fallbacks recipe]{@link https://developers.google.com/web/tools/workbox/guides/advanced-recipes#comprehensive_fallbacks}. Be sure to include the fallbacks in your precache injection
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.pageFallback] Precache name to match for pag fallbacks. Defaults to offline.html
+ * @param {string} [options.imageFallback] Precache name to match for image fallbacks.
+ * @param {string} [options.fontFallback] Precache name to match for font fallbacks.
+ */
+function offlineFallback(options: OfflineFallbackOptions = {}): void {
+  const pageFallback = options.pageFallback || 'offline.html';
+  const imageFallback = options.imageFallback || false;
+  const fontFallback = options.fontFallback || false;
+
+  self.addEventListener('install', (event) => {
+    const files = [pageFallback];
+    if (imageFallback) {
+      files.push(imageFallback);
+    }
+    if (fontFallback) {
+      files.push(fontFallback);
+    }
+
+    event.waitUntil(
+      self.caches
+        .open('workbox-offline-fallbacks')
+        .then((cache) => cache.addAll(files)),
+    );
+  });
+
+  const handler: RouteHandler = async (
+    options: RouteHandlerCallbackOptions,
+  ) => {
+    const dest = options.request.destination;
+    const cache = await self.caches.open('workbox-offline-fallbacks');
+
+    if (dest === 'document') {
+      const match =
+        (await matchPrecache(pageFallback)) ||
+        (await cache.match(pageFallback));
+      return match || Response.error();
+    }
+
+    if (dest === 'image' && imageFallback !== false) {
+      const match =
+        (await matchPrecache(imageFallback)) ||
+        (await cache.match(imageFallback));
+      return match || Response.error();
+    }
+
+    if (dest === 'font' && fontFallback !== false) {
+      const match =
+        (await matchPrecache(fontFallback)) ||
+        (await cache.match(fontFallback));
+      return match || Response.error();
+    }
+
+    return Response.error();
+  };
+
+  setCatchHandler(handler);
+}
+
+export {offlineFallback};
diff --git a/tools/ui/node_modules/workbox-recipes/src/pageCache.ts b/tools/ui/node_modules/workbox-recipes/src/pageCache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6c6782c058ddf26d8820c4e2d6a455d0ed87e97a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/pageCache.ts
@@ -0,0 +1,69 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import {warmStrategyCache} from './warmStrategyCache';
+import {registerRoute} from 'workbox-routing/registerRoute.js';
+import {NetworkFirst} from 'workbox-strategies/NetworkFirst.js';
+import {CacheableResponsePlugin} from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import {
+  RouteMatchCallback,
+  RouteMatchCallbackOptions,
+  WorkboxPlugin,
+} from 'workbox-core/types.js';
+
+import './_version.js';
+
+export interface PageCacheOptions {
+  cacheName?: string;
+  matchCallback?: RouteMatchCallback;
+  networkTimeoutSeconds?: number;
+  plugins?: Array;
+  warmCache?: Array;
+}
+
+/**
+ * An implementation of a page caching recipe with a network timeout
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to pages
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';
+ * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function pageCache(options: PageCacheOptions = {}): void {
+  const defaultMatchCallback = ({request}: RouteMatchCallbackOptions) =>
+    request.mode === 'navigate';
+
+  const cacheName = options.cacheName || 'pages';
+  const matchCallback = options.matchCallback || defaultMatchCallback;
+  const networkTimeoutSeconds = options.networkTimeoutSeconds || 3;
+  const plugins = options.plugins || [];
+  plugins.push(
+    new CacheableResponsePlugin({
+      statuses: [0, 200],
+    }),
+  );
+
+  const strategy = new NetworkFirst({
+    networkTimeoutSeconds,
+    cacheName,
+    plugins,
+  });
+
+  // Registers the route
+  registerRoute(matchCallback, strategy);
+
+  // Warms the cache
+  if (options.warmCache) {
+    warmStrategyCache({urls: options.warmCache, strategy});
+  }
+}
+
+export {pageCache};
diff --git a/tools/ui/node_modules/workbox-recipes/src/staticResourceCache.ts b/tools/ui/node_modules/workbox-recipes/src/staticResourceCache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..915866baf562254a02ad6f81ba843885196f5f54
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/staticResourceCache.ts
@@ -0,0 +1,66 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import {warmStrategyCache} from './warmStrategyCache';
+import {registerRoute} from 'workbox-routing/registerRoute.js';
+import {StaleWhileRevalidate} from 'workbox-strategies/StaleWhileRevalidate.js';
+import {CacheableResponsePlugin} from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import {
+  RouteMatchCallback,
+  RouteMatchCallbackOptions,
+  WorkboxPlugin,
+} from 'workbox-core/types.js';
+
+import './_version.js';
+
+export interface StaticResourceOptions {
+  cacheName?: string;
+  matchCallback?: RouteMatchCallback;
+  plugins?: Array;
+  warmCache?: Array;
+}
+
+/**
+ * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to static-resources
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function staticResourceCache(options: StaticResourceOptions = {}): void {
+  const defaultMatchCallback = ({request}: RouteMatchCallbackOptions) =>
+    request.destination === 'style' ||
+    request.destination === 'script' ||
+    request.destination === 'worker';
+
+  const cacheName = options.cacheName || 'static-resources';
+  const matchCallback = options.matchCallback || defaultMatchCallback;
+  const plugins = options.plugins || [];
+  plugins.push(
+    new CacheableResponsePlugin({
+      statuses: [0, 200],
+    }),
+  );
+
+  const strategy = new StaleWhileRevalidate({
+    cacheName,
+    plugins,
+  });
+
+  registerRoute(matchCallback, strategy);
+
+  // Warms the cache
+  if (options.warmCache) {
+    warmStrategyCache({urls: options.warmCache, strategy});
+  }
+}
+
+export {staticResourceCache};
diff --git a/tools/ui/node_modules/workbox-recipes/src/warmStrategyCache.ts b/tools/ui/node_modules/workbox-recipes/src/warmStrategyCache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1847a237840e1255775514e62220c3d50f9febbb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/src/warmStrategyCache.ts
@@ -0,0 +1,34 @@
+import {Strategy} from 'workbox-strategies/Strategy.js';
+
+import './_version.js';
+
+export interface WarmStrategyCacheOptions {
+  urls: Array;
+  strategy: Strategy;
+}
+
+// Give TypeScript the correct global.
+declare let self: ServiceWorkerGlobalScope;
+
+/**
+ * @memberof workbox-recipes
+ 
+ * @param {Object} options 
+ * @param {string[]} options.urls Paths to warm the strategy's cache with
+ * @param {Strategy} options.strategy Strategy to use
+ */
+function warmStrategyCache(options: WarmStrategyCacheOptions): void {
+  self.addEventListener('install', (event) => {
+    const done = options.urls.map(
+      (path) =>
+        options.strategy.handleAll({
+          event,
+          request: new Request(path),
+        })[1],
+    );
+
+    event.waitUntil(Promise.all(done));
+  });
+}
+
+export {warmStrategyCache};
diff --git a/tools/ui/node_modules/workbox-recipes/staticResourceCache.d.ts b/tools/ui/node_modules/workbox-recipes/staticResourceCache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64cf27db43fb4e324d90e70e84a81c16e8b05505
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/staticResourceCache.d.ts
@@ -0,0 +1,21 @@
+import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js';
+import './_version.js';
+export interface StaticResourceOptions {
+    cacheName?: string;
+    matchCallback?: RouteMatchCallback;
+    plugins?: Array;
+    warmCache?: Array;
+}
+/**
+ * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to static-resources
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+declare function staticResourceCache(options?: StaticResourceOptions): void;
+export { staticResourceCache };
diff --git a/tools/ui/node_modules/workbox-recipes/staticResourceCache.js b/tools/ui/node_modules/workbox-recipes/staticResourceCache.js
new file mode 100644
index 0000000000000000000000000000000000000000..1338ce0da4ee0c2b3d9fb3dad07c708b2b5529aa
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/staticResourceCache.js
@@ -0,0 +1,44 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { warmStrategyCache } from './warmStrategyCache';
+import { registerRoute } from 'workbox-routing/registerRoute.js';
+import { StaleWhileRevalidate } from 'workbox-strategies/StaleWhileRevalidate.js';
+import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin.js';
+import './_version.js';
+/**
+ * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}
+ *
+ * @memberof workbox-recipes
+ *
+ * @param {Object} [options]
+ * @param {string} [options.cacheName] Name for cache. Defaults to static-resources
+ * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
+ * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
+ * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
+ */
+function staticResourceCache(options = {}) {
+    const defaultMatchCallback = ({ request }) => request.destination === 'style' ||
+        request.destination === 'script' ||
+        request.destination === 'worker';
+    const cacheName = options.cacheName || 'static-resources';
+    const matchCallback = options.matchCallback || defaultMatchCallback;
+    const plugins = options.plugins || [];
+    plugins.push(new CacheableResponsePlugin({
+        statuses: [0, 200],
+    }));
+    const strategy = new StaleWhileRevalidate({
+        cacheName,
+        plugins,
+    });
+    registerRoute(matchCallback, strategy);
+    // Warms the cache
+    if (options.warmCache) {
+        warmStrategyCache({ urls: options.warmCache, strategy });
+    }
+}
+export { staticResourceCache };
diff --git a/tools/ui/node_modules/workbox-recipes/staticResourceCache.mjs b/tools/ui/node_modules/workbox-recipes/staticResourceCache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..89f66e79ba8045ce42bf7bfb20b7f3ccebc6e0a5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/staticResourceCache.mjs
@@ -0,0 +1 @@
+export * from './staticResourceCache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/tsconfig.json b/tools/ui/node_modules/workbox-recipes/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..22f8f82b305d99fc1d6e85ed02a34654ac82ab8f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/tsconfig.json
@@ -0,0 +1,17 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [
+    {"path": "../workbox-core/"},
+    {"path": "../workbox-routing/"},
+    {"path": "../workbox-strategies/"},
+    {"path": "../workbox-cacheable-response/"},
+    {"path": "../workbox-expiration/"},
+    {"path": "../workbox-precaching/"}
+  ]
+}
diff --git a/tools/ui/node_modules/workbox-recipes/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-recipes/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..ebbb375f03c372bd44e9751b183f59f16e26a97f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","./src/_version.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-routing/_version.d.ts","../workbox-routing/utils/constants.d.ts","../workbox-routing/route.d.ts","../workbox-routing/registerroute.d.ts","../workbox-strategies/_version.d.ts","../workbox-strategies/strategyhandler.d.ts","../workbox-strategies/strategy.d.ts","../workbox-strategies/stalewhilerevalidate.d.ts","../workbox-strategies/cachefirst.d.ts","../workbox-cacheable-response/_version.d.ts","../workbox-cacheable-response/cacheableresponse.d.ts","../workbox-cacheable-response/cacheableresponseplugin.d.ts","../workbox-expiration/_version.d.ts","../workbox-expiration/expirationplugin.d.ts","./src/googlefontscache.ts","./src/warmstrategycache.ts","./src/imagecache.ts","./src/staticresourcecache.ts","../workbox-strategies/networkfirst.d.ts","./src/pagecache.ts","../workbox-routing/setcatchhandler.d.ts","../workbox-precaching/_version.d.ts","../workbox-precaching/matchprecache.d.ts","./src/offlinefallback.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},{"version":"0f063fffb364e9179b0cabca4041412c71573ed72d25b1a9fe132c90e56ebec9","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","8d0f0aa989374cc6c7bc141649a9ca7d76b221a39375c8b98b844c3ad8c9b090","03e238c606e3567428238c11720093a64d3ef151ba465b7bf0ae8cca27540853","3c7281c1b6ec0997a6d02f43a1946fbf32eabf25c3404e79d28c5d20c13fd6c6","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","c0f693310aa76645335728d3636021e61130aff7651ae44c512662a194ac3b63","98962a67c31e31dbb0f7eb27082465ca9bfd4b59c9f36537a70c27b1a3982e65","f47f28fe817c1c06e48ba005a96d4166e0e66b32d1dacd020a0fc8b7af91f20d","b7a945ae3d451d0150046845f80e668e0dcbeeee2c8b7616b85623c5619b8ecb","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","be3d53a4a6cc2e67e4b4b09c46bffce6282585fe504f77839863c53cb378a47f","2effc15909dae21ab67f487a0d6b43193596626cdffb9103eb71078bde44f00a","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","3199d552cbbbac5a3c6e1499c09acf672ae8c8c8687cf2a3dbfa7c8902cc7054",{"version":"32ccdf0491e1d3e3ec8a121122f664b7fba17c9c791940837349bc8666e3da9a","signature":"392b571558b63ff5f1e39a4f0b5ce2ff39ff6fdcfe47c9270796589d3e5d5292"},{"version":"c036f84cc2fb6c4b62c5d58476ab3e9dca3f36b15e93083a64789697b46a6858","signature":"8d60e3924fd59ddcc9bd2b55eee76fc12600dd81f6dccd9c55680ac71b69cba7"},{"version":"481db288011e6490f90df39f5654ebabf8dfd4c3aba9f442b293a27ac926411e","signature":"8b430573cde013dcd5dbf0fd4bafd7ea516460ca41ef3f0e08cf587b00605b34"},{"version":"7aaece355bab181591db5f031fd3b4b76bef164f43723b233b91a42e019c89e9","signature":"20ef4999fc46c6656981ec0f6cfc5b9610651b62070018ab991cebda5ce0a67d"},"504186e6db5cd2c600ce2f134732e4d6ff94beddac01357e597d720735a3100e",{"version":"e443877562fe13f45e70a636888f3446f892ee8f7384e18a6104d1b6a645cf84","signature":"f369e7a9c69de5ca85fd8f4681b038e4ff8baedafbd49fdbfe655e4749070243"},"9725c19646f56a5afd09daa1e45c540b5c889b7eb23ddb8a26afcfb236c0816a","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","4b2df5d613f0277020ba60d7f59a794e9993b97e2be3dc98719bcae1b754e699",{"version":"ba2d77a5c3a163e09a467c3504274508673979a7b28491841e2f657372bffab7","signature":"2ca1531cef422bff82f2a8db7538aef39521f31a3fbdf5c3ccfedd666296cf87"},{"version":"a5d96b2acff203d82a80f6a3ec12c612c0dac72aad501831b26e2f4e0d44fdbd","signature":"825cd850ce3cdf3c76d93a86cfcde59d1cf8715f300ee9263607a4b1954927fb"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[89,131],[71,89,131],[71,72,73,74,75,89,131],[71,73,89,131],[80,82,89,131],[79,80,81,89,131],[89,131,144,180],[89,131,143,180,182],[89,131,205],[89,131,190],[89,131,194,195,196],[89,131,193],[89,131,195],[89,131,185,191,192,197,200,202,203,204],[89,131,192,198,199,205],[89,131,198,201],[89,131,192,193,198,205],[89,131,192,205],[89,131,186,187,188,189],[89,128,131],[89,130,131],[89,131,136,165],[89,131,132,137,143,144,151,162,173],[89,131,132,133,143,151],[84,85,86,89,131],[89,131,134,174],[89,131,135,136,144,152],[89,131,136,162,170],[89,131,137,139,143,151],[89,130,131,138],[89,131,139,140],[89,131,143],[89,131,141,143],[89,130,131,143],[89,131,143,144,145,162,173],[89,131,143,144,145,158,162,165],[89,126,131,178],[89,131,139,143,146,151,162,173],[89,131,143,144,146,147,151,162,170,173],[89,131,146,148,162,170,173],[89,131,143,149],[89,131,150,173,178],[89,131,139,143,151,162],[89,131,152],[89,131,153],[89,130,131,154],[89,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179],[89,131,156],[89,131,157],[89,131,143,158,159],[89,131,158,160,174,176],[89,131,143,162,163,165],[89,131,164,165],[89,131,162,163],[89,131,165],[89,131,166],[89,128,131,162],[89,131,143,168,169],[89,131,168,169],[89,131,136,151,162,170],[89,131,171],[131],[87,88,89,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179],[89,131,151,172],[89,131,146,157,173],[89,131,136,174],[89,131,162,175],[89,131,150,176],[89,131,177],[89,131,136,143,145,154,162,173,176,178],[89,131,162,179],[89,131,211,250],[89,131,211,235,250],[89,131,250],[89,131,211],[89,131,211,236,250],[89,131,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249],[89,131,236,250],[89,131,254],[89,131,180,257,258,259,260,261,262,263,264,265,266,267],[89,131,256,257,266],[89,131,257,266],[89,131,251,256,257,266],[89,131,256,257,258,259,260,261,262,263,264,265,267],[89,131,257],[89,131,136,256,266],[89,98,102,131,173],[89,98,131,162,173],[89,93,131],[89,95,98,131,170,173],[89,131,151,170],[89,131,180],[89,93,131,180],[89,95,98,131,151,173],[89,90,91,94,97,131,143,162,173],[89,98,105,131],[89,90,96,131],[89,98,119,120,131],[89,94,98,131,165,173,180],[89,119,131,180],[89,92,93,131,180],[89,98,131],[89,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,125,131],[89,98,113,131],[89,98,105,106,131],[89,96,98,106,107,131],[89,97,131],[89,90,93,98,131],[89,98,102,106,107,131],[89,102,131],[89,96,98,101,131,173],[89,90,95,98,105,131],[89,131,162],[89,93,98,119,131,178,180],[45,56,89,131],[45,89,131],[49,53,54,57,59,89,131],[45,49,54,57,59,61,89,131],[60,61,62,63,65,69,89,131],[45,66,68,89,131],[45,49,57,61,64,89,131],[45,49,53,57,61,89,131],[52,89,131],[45,47,48,89,131],[45,47,89,131],[51,52,89,131],[45,51,89,131],[45,52,89,131],[45],[60,61,62,63,65,69],[52]],"referencedMap":[[42,1],[73,2],[71,1],[76,3],[72,2],[77,1],[74,4],[75,2],[78,1],[83,5],[79,1],[82,6],[80,1],[181,7],[183,8],[184,1],[81,1],[185,1],[206,9],[191,10],[197,11],[195,1],[194,12],[196,13],[205,14],[200,15],[202,16],[203,17],[204,18],[198,1],[199,18],[201,18],[193,18],[192,1],[187,1],[186,1],[189,10],[190,19],[188,10],[182,1],[207,1],[128,20],[129,20],[130,21],[131,22],[132,23],[133,24],[84,1],[87,25],[85,1],[86,1],[134,26],[135,27],[136,28],[137,29],[138,30],[139,31],[140,31],[142,32],[141,33],[143,34],[144,35],[145,36],[127,37],[146,38],[147,39],[148,40],[149,41],[150,42],[151,43],[152,44],[153,45],[154,46],[155,47],[156,48],[157,49],[158,50],[159,50],[160,51],[161,1],[162,52],[164,53],[163,54],[165,55],[166,56],[167,57],[168,58],[169,59],[170,60],[171,61],[89,62],[88,1],[180,63],[172,64],[173,65],[174,66],[175,67],[176,68],[177,69],[178,70],[179,71],[208,1],[209,1],[210,1],[235,72],[236,73],[211,74],[214,74],[233,72],[234,72],[224,72],[223,75],[221,72],[216,72],[229,72],[227,72],[231,72],[215,72],[228,72],[232,72],[217,72],[218,72],[230,72],[212,72],[219,72],[220,72],[222,72],[226,72],[237,76],[225,72],[213,72],[250,77],[249,1],[244,76],[246,78],[245,76],[238,76],[239,76],[241,76],[243,76],[247,78],[248,78],[240,78],[242,78],[251,1],[252,1],[253,1],[255,79],[254,1],[268,80],[267,81],[258,82],[259,83],[266,84],[260,83],[261,82],[262,82],[263,82],[264,85],[257,86],[265,81],[256,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[105,87],[115,88],[104,87],[125,89],[96,90],[95,91],[124,92],[118,93],[123,94],[98,95],[112,96],[97,97],[121,98],[93,99],[92,92],[122,100],[94,101],[99,102],[100,1],[103,102],[90,1],[126,103],[116,104],[107,105],[108,106],[110,107],[106,108],[109,109],[119,92],[101,110],[102,111],[111,112],[91,113],[114,104],[113,102],[117,1],[120,114],[55,1],[56,1],[57,115],[44,1],[45,1],[58,1],[59,116],[67,1],[68,1],[43,1],[60,117],[62,118],[70,119],[69,120],[65,121],[63,122],[61,123],[46,1],[49,124],[48,125],[66,116],[47,1],[50,1],[54,126],[64,126],[53,126],[52,127],[51,128]],"exportedModulesMap":[[42,1],[73,2],[71,1],[76,3],[72,2],[77,1],[74,4],[75,2],[78,1],[83,5],[79,1],[82,6],[80,1],[181,7],[183,8],[184,1],[81,1],[185,1],[206,9],[191,10],[197,11],[195,1],[194,12],[196,13],[205,14],[200,15],[202,16],[203,17],[204,18],[198,1],[199,18],[201,18],[193,18],[192,1],[187,1],[186,1],[189,10],[190,19],[188,10],[182,1],[207,1],[128,20],[129,20],[130,21],[131,22],[132,23],[133,24],[84,1],[87,25],[85,1],[86,1],[134,26],[135,27],[136,28],[137,29],[138,30],[139,31],[140,31],[142,32],[141,33],[143,34],[144,35],[145,36],[127,37],[146,38],[147,39],[148,40],[149,41],[150,42],[151,43],[152,44],[153,45],[154,46],[155,47],[156,48],[157,49],[158,50],[159,50],[160,51],[161,1],[162,52],[164,53],[163,54],[165,55],[166,56],[167,57],[168,58],[169,59],[170,60],[171,61],[89,62],[88,1],[180,63],[172,64],[173,65],[174,66],[175,67],[176,68],[177,69],[178,70],[179,71],[208,1],[209,1],[210,1],[235,72],[236,73],[211,74],[214,74],[233,72],[234,72],[224,72],[223,75],[221,72],[216,72],[229,72],[227,72],[231,72],[215,72],[228,72],[232,72],[217,72],[218,72],[230,72],[212,72],[219,72],[220,72],[222,72],[226,72],[237,76],[225,72],[213,72],[250,77],[249,1],[244,76],[246,78],[245,76],[238,76],[239,76],[241,76],[243,76],[247,78],[248,78],[240,78],[242,78],[251,1],[252,1],[253,1],[255,79],[254,1],[268,80],[267,81],[258,82],[259,83],[266,84],[260,83],[261,82],[262,82],[263,82],[264,85],[257,86],[265,81],[256,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[105,87],[115,88],[104,87],[125,89],[96,90],[95,91],[124,92],[118,93],[123,94],[98,95],[112,96],[97,97],[121,98],[93,99],[92,92],[122,100],[94,101],[99,102],[100,1],[103,102],[90,1],[126,103],[116,104],[107,105],[108,106],[110,107],[106,108],[109,109],[119,92],[101,110],[102,111],[111,112],[91,113],[114,104],[113,102],[117,1],[120,114],[55,1],[56,1],[57,115],[44,1],[45,1],[58,1],[59,116],[67,1],[68,1],[62,129],[70,130],[65,129],[63,129],[61,131],[46,1],[49,124],[48,125],[66,116],[47,1],[50,1],[54,126],[64,126],[53,126],[52,127],[51,128]],"semanticDiagnosticsPerFile":[42,73,71,76,72,77,74,75,78,83,79,82,80,181,183,184,81,185,206,191,197,195,194,196,205,200,202,203,204,198,199,201,193,192,187,186,189,190,188,182,207,128,129,130,131,132,133,84,87,85,86,134,135,136,137,138,139,140,142,141,143,144,145,127,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,163,165,166,167,168,169,170,171,89,88,180,172,173,174,175,176,177,178,179,208,209,210,235,236,211,214,233,234,224,223,221,216,229,227,231,215,228,232,217,218,230,212,219,220,222,226,237,225,213,250,249,244,246,245,238,239,241,243,247,248,240,242,251,252,253,255,254,268,267,258,259,266,260,261,262,263,264,257,265,256,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,105,115,104,125,96,95,124,118,123,98,112,97,121,93,92,122,94,99,100,103,90,126,116,107,108,110,106,109,119,101,102,111,91,114,113,117,120,55,56,57,44,45,58,59,67,68,43,60,62,70,69,65,63,61,46,49,48,66,47,50,54,64,53,52,51],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-recipes/warmStrategyCache.d.ts b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2ab9b62975aaecd9d4f7b594d37dbf68b5d449d7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.d.ts
@@ -0,0 +1,15 @@
+import { Strategy } from 'workbox-strategies/Strategy.js';
+import './_version.js';
+export interface WarmStrategyCacheOptions {
+    urls: Array;
+    strategy: Strategy;
+}
+/**
+ * @memberof workbox-recipes
+ 
+ * @param {Object} options
+ * @param {string[]} options.urls Paths to warm the strategy's cache with
+ * @param {Strategy} options.strategy Strategy to use
+ */
+declare function warmStrategyCache(options: WarmStrategyCacheOptions): void;
+export { warmStrategyCache };
diff --git a/tools/ui/node_modules/workbox-recipes/warmStrategyCache.js b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.js
new file mode 100644
index 0000000000000000000000000000000000000000..b34884827a1947e22a76fdf9da0cc976bc4c3a1c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.js
@@ -0,0 +1,18 @@
+import './_version.js';
+/**
+ * @memberof workbox-recipes
+ 
+ * @param {Object} options
+ * @param {string[]} options.urls Paths to warm the strategy's cache with
+ * @param {Strategy} options.strategy Strategy to use
+ */
+function warmStrategyCache(options) {
+    self.addEventListener('install', (event) => {
+        const done = options.urls.map((path) => options.strategy.handleAll({
+            event,
+            request: new Request(path),
+        })[1]);
+        event.waitUntil(Promise.all(done));
+    });
+}
+export { warmStrategyCache };
diff --git a/tools/ui/node_modules/workbox-recipes/warmStrategyCache.mjs b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..ded7db71b4feaa2ac73aa0e88257661fd835a284
--- /dev/null
+++ b/tools/ui/node_modules/workbox-recipes/warmStrategyCache.mjs
@@ -0,0 +1 @@
+export * from './warmStrategyCache.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/LICENSE b/tools/ui/node_modules/workbox-routing/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-routing/NavigationRoute.d.ts b/tools/ui/node_modules/workbox-routing/NavigationRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5add7e5803ab8c9c48b1741f30656b076015e0a0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/NavigationRoute.d.ts
@@ -0,0 +1,63 @@
+import { RouteHandler } from 'workbox-core/types.js';
+import { Route } from './Route.js';
+import './_version.js';
+export interface NavigationRouteMatchOptions {
+    allowlist?: RegExp[];
+    denylist?: RegExp[];
+}
+/**
+ * NavigationRoute makes it easy to create a
+ * {@link workbox-routing.Route} that matches for browser
+ * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
+ *
+ * It will only match incoming Requests whose
+ * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}
+ * is set to `navigate`.
+ *
+ * You can optionally only apply this route to a subset of navigation requests
+ * by using one or both of the `denylist` and `allowlist` parameters.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+declare class NavigationRoute extends Route {
+    private readonly _allowlist;
+    private readonly _denylist;
+    /**
+     * If both `denylist` and `allowlist` are provided, the `denylist` will
+     * take precedence and the request will not match this route.
+     *
+     * The regular expressions in `allowlist` and `denylist`
+     * are matched against the concatenated
+     * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
+     * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
+     * portions of the requested URL.
+     *
+     * *Note*: These RegExps may be evaluated against every destination URL during
+     * a navigation. Avoid using
+     * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+     * or else your users may see delays when navigating your site.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {Object} options
+     * @param {Array} [options.denylist] If any of these patterns match,
+     * the route will not handle the request (even if a allowlist RegExp matches).
+     * @param {Array} [options.allowlist=[/./]] If any of these patterns
+     * match the URL's pathname and search parameter, the route will handle the
+     * request (assuming the denylist doesn't match).
+     */
+    constructor(handler: RouteHandler, { allowlist, denylist }?: NavigationRouteMatchOptions);
+    /**
+     * Routes match handler.
+     *
+     * @param {Object} options
+     * @param {URL} options.url
+     * @param {Request} options.request
+     * @return {boolean}
+     *
+     * @private
+     */
+    private _match;
+}
+export { NavigationRoute };
diff --git a/tools/ui/node_modules/workbox-routing/NavigationRoute.js b/tools/ui/node_modules/workbox-routing/NavigationRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..692ac3a5d43e10f188285f823d9532f4db92f1e7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/NavigationRoute.js
@@ -0,0 +1,110 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { Route } from './Route.js';
+import './_version.js';
+/**
+ * NavigationRoute makes it easy to create a
+ * {@link workbox-routing.Route} that matches for browser
+ * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
+ *
+ * It will only match incoming Requests whose
+ * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}
+ * is set to `navigate`.
+ *
+ * You can optionally only apply this route to a subset of navigation requests
+ * by using one or both of the `denylist` and `allowlist` parameters.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+class NavigationRoute extends Route {
+    /**
+     * If both `denylist` and `allowlist` are provided, the `denylist` will
+     * take precedence and the request will not match this route.
+     *
+     * The regular expressions in `allowlist` and `denylist`
+     * are matched against the concatenated
+     * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
+     * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
+     * portions of the requested URL.
+     *
+     * *Note*: These RegExps may be evaluated against every destination URL during
+     * a navigation. Avoid using
+     * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+     * or else your users may see delays when navigating your site.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {Object} options
+     * @param {Array} [options.denylist] If any of these patterns match,
+     * the route will not handle the request (even if a allowlist RegExp matches).
+     * @param {Array} [options.allowlist=[/./]] If any of these patterns
+     * match the URL's pathname and search parameter, the route will handle the
+     * request (assuming the denylist doesn't match).
+     */
+    constructor(handler, { allowlist = [/./], denylist = [] } = {}) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isArrayOfClass(allowlist, RegExp, {
+                moduleName: 'workbox-routing',
+                className: 'NavigationRoute',
+                funcName: 'constructor',
+                paramName: 'options.allowlist',
+            });
+            assert.isArrayOfClass(denylist, RegExp, {
+                moduleName: 'workbox-routing',
+                className: 'NavigationRoute',
+                funcName: 'constructor',
+                paramName: 'options.denylist',
+            });
+        }
+        super((options) => this._match(options), handler);
+        this._allowlist = allowlist;
+        this._denylist = denylist;
+    }
+    /**
+     * Routes match handler.
+     *
+     * @param {Object} options
+     * @param {URL} options.url
+     * @param {Request} options.request
+     * @return {boolean}
+     *
+     * @private
+     */
+    _match({ url, request }) {
+        if (request && request.mode !== 'navigate') {
+            return false;
+        }
+        const pathnameAndSearch = url.pathname + url.search;
+        for (const regExp of this._denylist) {
+            if (regExp.test(pathnameAndSearch)) {
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`The navigation route ${pathnameAndSearch} is not ` +
+                        `being used, since the URL matches this denylist pattern: ` +
+                        `${regExp.toString()}`);
+                }
+                return false;
+            }
+        }
+        if (this._allowlist.some((regExp) => regExp.test(pathnameAndSearch))) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.debug(`The navigation route ${pathnameAndSearch} ` + `is being used.`);
+            }
+            return true;
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            logger.log(`The navigation route ${pathnameAndSearch} is not ` +
+                `being used, since the URL being navigated to doesn't ` +
+                `match the allowlist.`);
+        }
+        return false;
+    }
+}
+export { NavigationRoute };
diff --git a/tools/ui/node_modules/workbox-routing/NavigationRoute.mjs b/tools/ui/node_modules/workbox-routing/NavigationRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..23432c2be12d740ebb620fbbab9f3d05c452277d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/NavigationRoute.mjs
@@ -0,0 +1 @@
+export * from './NavigationRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/README.md b/tools/ui/node_modules/workbox-routing/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..0c19ecc1f9712bd42ce264233062a0873053c202
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-routing
diff --git a/tools/ui/node_modules/workbox-routing/RegExpRoute.d.ts b/tools/ui/node_modules/workbox-routing/RegExpRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..77a1d4f356953405e57640d7186cd924bb3143b4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/RegExpRoute.d.ts
@@ -0,0 +1,32 @@
+import { RouteHandler } from 'workbox-core/types.js';
+import { HTTPMethod } from './utils/constants.js';
+import { Route } from './Route.js';
+import './_version.js';
+/**
+ * RegExpRoute makes it easy to create a regular expression based
+ * {@link workbox-routing.Route}.
+ *
+ * For same-origin requests the RegExp only needs to match part of the URL. For
+ * requests against third-party servers, you must define a RegExp that matches
+ * the start of the URL.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+declare class RegExpRoute extends Route {
+    /**
+     * If the regular expression contains
+     * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},
+     * the captured values will be passed to the
+     * {@link workbox-routing~handlerCallback} `params`
+     * argument.
+     *
+     * @param {RegExp} regExp The regular expression to match against URLs.
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {string} [method='GET'] The HTTP method to match the Route
+     * against.
+     */
+    constructor(regExp: RegExp, handler: RouteHandler, method?: HTTPMethod);
+}
+export { RegExpRoute };
diff --git a/tools/ui/node_modules/workbox-routing/RegExpRoute.js b/tools/ui/node_modules/workbox-routing/RegExpRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..9bf0365b6a7e498aed7bcaf16157c544de0a71d7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/RegExpRoute.js
@@ -0,0 +1,73 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { Route } from './Route.js';
+import './_version.js';
+/**
+ * RegExpRoute makes it easy to create a regular expression based
+ * {@link workbox-routing.Route}.
+ *
+ * For same-origin requests the RegExp only needs to match part of the URL. For
+ * requests against third-party servers, you must define a RegExp that matches
+ * the start of the URL.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+class RegExpRoute extends Route {
+    /**
+     * If the regular expression contains
+     * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},
+     * the captured values will be passed to the
+     * {@link workbox-routing~handlerCallback} `params`
+     * argument.
+     *
+     * @param {RegExp} regExp The regular expression to match against URLs.
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {string} [method='GET'] The HTTP method to match the Route
+     * against.
+     */
+    constructor(regExp, handler, method) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(regExp, RegExp, {
+                moduleName: 'workbox-routing',
+                className: 'RegExpRoute',
+                funcName: 'constructor',
+                paramName: 'pattern',
+            });
+        }
+        const match = ({ url }) => {
+            const result = regExp.exec(url.href);
+            // Return immediately if there's no match.
+            if (!result) {
+                return;
+            }
+            // Require that the match start at the first character in the URL string
+            // if it's a cross-origin request.
+            // See https://github.com/GoogleChrome/workbox/issues/281 for the context
+            // behind this behavior.
+            if (url.origin !== location.origin && result.index !== 0) {
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +
+                        `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +
+                        `handle cross-origin requests if they match the entire URL.`);
+                }
+                return;
+            }
+            // If the route matches, but there aren't any capture groups defined, then
+            // this will return [], which is truthy and therefore sufficient to
+            // indicate a match.
+            // If there are capture groups, then it will return their values.
+            return result.slice(1);
+        };
+        super(match, handler, method);
+    }
+}
+export { RegExpRoute };
diff --git a/tools/ui/node_modules/workbox-routing/RegExpRoute.mjs b/tools/ui/node_modules/workbox-routing/RegExpRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..d17e49239bdbcc13e53fefc8b485ef3a4defef47
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/RegExpRoute.mjs
@@ -0,0 +1 @@
+export * from './RegExpRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/Route.d.ts b/tools/ui/node_modules/workbox-routing/Route.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..39b1ec4d2b5c8169e344a98e9abf8ca9a307f8fd
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Route.d.ts
@@ -0,0 +1,37 @@
+import { HTTPMethod } from './utils/constants.js';
+import { RouteHandler, RouteHandlerObject, RouteMatchCallback } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * A `Route` consists of a pair of callback functions, "match" and "handler".
+ * The "match" callback determine if a route should be used to "handle" a
+ * request by returning a non-falsy value if it can. The "handler" callback
+ * is called when there is a match and should return a Promise that resolves
+ * to a `Response`.
+ *
+ * @memberof workbox-routing
+ */
+declare class Route {
+    handler: RouteHandlerObject;
+    match: RouteMatchCallback;
+    method: HTTPMethod;
+    catchHandler?: RouteHandlerObject;
+    /**
+     * Constructor for Route class.
+     *
+     * @param {workbox-routing~matchCallback} match
+     * A callback function that determines whether the route matches a given
+     * `fetch` event by returning a non-falsy value.
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resolving to a Response.
+     * @param {string} [method='GET'] The HTTP method to match the Route
+     * against.
+     */
+    constructor(match: RouteMatchCallback, handler: RouteHandler, method?: HTTPMethod);
+    /**
+     *
+     * @param {workbox-routing-handlerCallback} handler A callback
+     * function that returns a Promise resolving to a Response
+     */
+    setCatchHandler(handler: RouteHandler): void;
+}
+export { Route };
diff --git a/tools/ui/node_modules/workbox-routing/Route.js b/tools/ui/node_modules/workbox-routing/Route.js
new file mode 100644
index 0000000000000000000000000000000000000000..c269922b0a0715300e35884a9262292e2bc51a35
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Route.js
@@ -0,0 +1,60 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { defaultMethod, validMethods } from './utils/constants.js';
+import { normalizeHandler } from './utils/normalizeHandler.js';
+import './_version.js';
+/**
+ * A `Route` consists of a pair of callback functions, "match" and "handler".
+ * The "match" callback determine if a route should be used to "handle" a
+ * request by returning a non-falsy value if it can. The "handler" callback
+ * is called when there is a match and should return a Promise that resolves
+ * to a `Response`.
+ *
+ * @memberof workbox-routing
+ */
+class Route {
+    /**
+     * Constructor for Route class.
+     *
+     * @param {workbox-routing~matchCallback} match
+     * A callback function that determines whether the route matches a given
+     * `fetch` event by returning a non-falsy value.
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resolving to a Response.
+     * @param {string} [method='GET'] The HTTP method to match the Route
+     * against.
+     */
+    constructor(match, handler, method = defaultMethod) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isType(match, 'function', {
+                moduleName: 'workbox-routing',
+                className: 'Route',
+                funcName: 'constructor',
+                paramName: 'match',
+            });
+            if (method) {
+                assert.isOneOf(method, validMethods, { paramName: 'method' });
+            }
+        }
+        // These values are referenced directly by Router so cannot be
+        // altered by minificaton.
+        this.handler = normalizeHandler(handler);
+        this.match = match;
+        this.method = method;
+    }
+    /**
+     *
+     * @param {workbox-routing-handlerCallback} handler A callback
+     * function that returns a Promise resolving to a Response
+     */
+    setCatchHandler(handler) {
+        this.catchHandler = normalizeHandler(handler);
+    }
+}
+export { Route };
diff --git a/tools/ui/node_modules/workbox-routing/Route.mjs b/tools/ui/node_modules/workbox-routing/Route.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..4c008d63ac7b2912fe5462b8887d582e775bf42c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Route.mjs
@@ -0,0 +1 @@
+export * from './Route.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/Router.d.ts b/tools/ui/node_modules/workbox-routing/Router.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a5c21d09dd1cf3a4dc0d4de54f25f26d9ece4845
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Router.d.ts
@@ -0,0 +1,135 @@
+import { RouteHandler, RouteHandlerCallbackOptions, RouteMatchCallbackOptions } from 'workbox-core/types.js';
+import { HTTPMethod } from './utils/constants.js';
+import { Route } from './Route.js';
+import './_version.js';
+/**
+ * The Router can be used to process a `FetchEvent` using one or more
+ * {@link workbox-routing.Route}, responding with a `Response` if
+ * a matching route exists.
+ *
+ * If no route matches a given a request, the Router will use a "default"
+ * handler if one is defined.
+ *
+ * Should the matching Route throw an error, the Router will use a "catch"
+ * handler if one is defined to gracefully deal with issues and respond with a
+ * Request.
+ *
+ * If a request matches multiple routes, the **earliest** registered route will
+ * be used to respond to the request.
+ *
+ * @memberof workbox-routing
+ */
+declare class Router {
+    private readonly _routes;
+    private readonly _defaultHandlerMap;
+    private _catchHandler?;
+    /**
+     * Initializes a new Router.
+     */
+    constructor();
+    /**
+     * @return {Map>} routes A `Map` of HTTP
+     * method name ('GET', etc.) to an array of all the corresponding `Route`
+     * instances that are registered.
+     */
+    get routes(): Map;
+    /**
+     * Adds a fetch event listener to respond to events when a route matches
+     * the event's request.
+     */
+    addFetchListener(): void;
+    /**
+     * Adds a message event listener for URLs to cache from the window.
+     * This is useful to cache resources loaded on the page prior to when the
+     * service worker started controlling it.
+     *
+     * The format of the message data sent from the window should be as follows.
+     * Where the `urlsToCache` array may consist of URL strings or an array of
+     * URL string + `requestInit` object (the same as you'd pass to `fetch()`).
+     *
+     * ```
+     * {
+     *   type: 'CACHE_URLS',
+     *   payload: {
+     *     urlsToCache: [
+     *       './script1.js',
+     *       './script2.js',
+     *       ['./script3.js', {mode: 'no-cors'}],
+     *     ],
+     *   },
+     * }
+     * ```
+     */
+    addCacheListener(): void;
+    /**
+     * Apply the routing rules to a FetchEvent object to get a Response from an
+     * appropriate Route's handler.
+     *
+     * @param {Object} options
+     * @param {Request} options.request The request to handle.
+     * @param {ExtendableEvent} options.event The event that triggered the
+     *     request.
+     * @return {Promise|undefined} A promise is returned if a
+     *     registered route can handle the request. If there is no matching
+     *     route and there's no `defaultHandler`, `undefined` is returned.
+     */
+    handleRequest({ request, event, }: {
+        request: Request;
+        event: ExtendableEvent;
+    }): Promise | undefined;
+    /**
+     * Checks a request and URL (and optionally an event) against the list of
+     * registered routes, and if there's a match, returns the corresponding
+     * route along with any params generated by the match.
+     *
+     * @param {Object} options
+     * @param {URL} options.url
+     * @param {boolean} options.sameOrigin The result of comparing `url.origin`
+     *     against the current origin.
+     * @param {Request} options.request The request to match.
+     * @param {Event} options.event The corresponding event.
+     * @return {Object} An object with `route` and `params` properties.
+     *     They are populated if a matching route was found or `undefined`
+     *     otherwise.
+     */
+    findMatchingRoute({ url, sameOrigin, request, event, }: RouteMatchCallbackOptions): {
+        route?: Route;
+        params?: RouteHandlerCallbackOptions['params'];
+    };
+    /**
+     * Define a default `handler` that's called when no routes explicitly
+     * match the incoming request.
+     *
+     * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.
+     *
+     * Without a default handler, unmatched requests will go against the
+     * network as if there were no service worker present.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {string} [method='GET'] The HTTP method to associate with this
+     * default handler. Each method has its own default.
+     */
+    setDefaultHandler(handler: RouteHandler, method?: HTTPMethod): void;
+    /**
+     * If a Route throws an error while handling a request, this `handler`
+     * will be called and given a chance to provide a response.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     */
+    setCatchHandler(handler: RouteHandler): void;
+    /**
+     * Registers a route with the router.
+     *
+     * @param {workbox-routing.Route} route The route to register.
+     */
+    registerRoute(route: Route): void;
+    /**
+     * Unregisters a route with the router.
+     *
+     * @param {workbox-routing.Route} route The route to unregister.
+     */
+    unregisterRoute(route: Route): void;
+}
+export { Router };
diff --git a/tools/ui/node_modules/workbox-routing/Router.js b/tools/ui/node_modules/workbox-routing/Router.js
new file mode 100644
index 0000000000000000000000000000000000000000..3e94f088a0f7f6e86a14889633446bf090f3d0ae
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Router.js
@@ -0,0 +1,393 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { defaultMethod } from './utils/constants.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { normalizeHandler } from './utils/normalizeHandler.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import './_version.js';
+/**
+ * The Router can be used to process a `FetchEvent` using one or more
+ * {@link workbox-routing.Route}, responding with a `Response` if
+ * a matching route exists.
+ *
+ * If no route matches a given a request, the Router will use a "default"
+ * handler if one is defined.
+ *
+ * Should the matching Route throw an error, the Router will use a "catch"
+ * handler if one is defined to gracefully deal with issues and respond with a
+ * Request.
+ *
+ * If a request matches multiple routes, the **earliest** registered route will
+ * be used to respond to the request.
+ *
+ * @memberof workbox-routing
+ */
+class Router {
+    /**
+     * Initializes a new Router.
+     */
+    constructor() {
+        this._routes = new Map();
+        this._defaultHandlerMap = new Map();
+    }
+    /**
+     * @return {Map>} routes A `Map` of HTTP
+     * method name ('GET', etc.) to an array of all the corresponding `Route`
+     * instances that are registered.
+     */
+    get routes() {
+        return this._routes;
+    }
+    /**
+     * Adds a fetch event listener to respond to events when a route matches
+     * the event's request.
+     */
+    addFetchListener() {
+        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+        self.addEventListener('fetch', ((event) => {
+            const { request } = event;
+            const responsePromise = this.handleRequest({ request, event });
+            if (responsePromise) {
+                event.respondWith(responsePromise);
+            }
+        }));
+    }
+    /**
+     * Adds a message event listener for URLs to cache from the window.
+     * This is useful to cache resources loaded on the page prior to when the
+     * service worker started controlling it.
+     *
+     * The format of the message data sent from the window should be as follows.
+     * Where the `urlsToCache` array may consist of URL strings or an array of
+     * URL string + `requestInit` object (the same as you'd pass to `fetch()`).
+     *
+     * ```
+     * {
+     *   type: 'CACHE_URLS',
+     *   payload: {
+     *     urlsToCache: [
+     *       './script1.js',
+     *       './script2.js',
+     *       ['./script3.js', {mode: 'no-cors'}],
+     *     ],
+     *   },
+     * }
+     * ```
+     */
+    addCacheListener() {
+        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+        self.addEventListener('message', ((event) => {
+            // event.data is type 'any'
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+            if (event.data && event.data.type === 'CACHE_URLS') {
+                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+                const { payload } = event.data;
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.debug(`Caching URLs from the window`, payload.urlsToCache);
+                }
+                const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {
+                    if (typeof entry === 'string') {
+                        entry = [entry];
+                    }
+                    const request = new Request(...entry);
+                    return this.handleRequest({ request, event });
+                    // TODO(philipwalton): TypeScript errors without this typecast for
+                    // some reason (probably a bug). The real type here should work but
+                    // doesn't: `Array | undefined>`.
+                })); // TypeScript
+                event.waitUntil(requestPromises);
+                // If a MessageChannel was used, reply to the message on success.
+                if (event.ports && event.ports[0]) {
+                    void requestPromises.then(() => event.ports[0].postMessage(true));
+                }
+            }
+        }));
+    }
+    /**
+     * Apply the routing rules to a FetchEvent object to get a Response from an
+     * appropriate Route's handler.
+     *
+     * @param {Object} options
+     * @param {Request} options.request The request to handle.
+     * @param {ExtendableEvent} options.event The event that triggered the
+     *     request.
+     * @return {Promise|undefined} A promise is returned if a
+     *     registered route can handle the request. If there is no matching
+     *     route and there's no `defaultHandler`, `undefined` is returned.
+     */
+    handleRequest({ request, event, }) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'handleRequest',
+                paramName: 'options.request',
+            });
+        }
+        const url = new URL(request.url, location.href);
+        if (!url.protocol.startsWith('http')) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.debug(`Workbox Router only supports URLs that start with 'http'.`);
+            }
+            return;
+        }
+        const sameOrigin = url.origin === location.origin;
+        const { params, route } = this.findMatchingRoute({
+            event,
+            request,
+            sameOrigin,
+            url,
+        });
+        let handler = route && route.handler;
+        const debugMessages = [];
+        if (process.env.NODE_ENV !== 'production') {
+            if (handler) {
+                debugMessages.push([`Found a route to handle this request:`, route]);
+                if (params) {
+                    debugMessages.push([
+                        `Passing the following params to the route's handler:`,
+                        params,
+                    ]);
+                }
+            }
+        }
+        // If we don't have a handler because there was no matching route, then
+        // fall back to defaultHandler if that's defined.
+        const method = request.method;
+        if (!handler && this._defaultHandlerMap.has(method)) {
+            if (process.env.NODE_ENV !== 'production') {
+                debugMessages.push(`Failed to find a matching route. Falling ` +
+                    `back to the default handler for ${method}.`);
+            }
+            handler = this._defaultHandlerMap.get(method);
+        }
+        if (!handler) {
+            if (process.env.NODE_ENV !== 'production') {
+                // No handler so Workbox will do nothing. If logs is set of debug
+                // i.e. verbose, we should print out this information.
+                logger.debug(`No route found for: ${getFriendlyURL(url)}`);
+            }
+            return;
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            // We have a handler, meaning Workbox is going to handle the route.
+            // print the routing details to the console.
+            logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);
+            debugMessages.forEach((msg) => {
+                if (Array.isArray(msg)) {
+                    logger.log(...msg);
+                }
+                else {
+                    logger.log(msg);
+                }
+            });
+            logger.groupEnd();
+        }
+        // Wrap in try and catch in case the handle method throws a synchronous
+        // error. It should still callback to the catch handler.
+        let responsePromise;
+        try {
+            responsePromise = handler.handle({ url, request, event, params });
+        }
+        catch (err) {
+            responsePromise = Promise.reject(err);
+        }
+        // Get route's catch handler, if it exists
+        const catchHandler = route && route.catchHandler;
+        if (responsePromise instanceof Promise &&
+            (this._catchHandler || catchHandler)) {
+            responsePromise = responsePromise.catch(async (err) => {
+                // If there's a route catch handler, process that first
+                if (catchHandler) {
+                    if (process.env.NODE_ENV !== 'production') {
+                        // Still include URL here as it will be async from the console group
+                        // and may not make sense without the URL
+                        logger.groupCollapsed(`Error thrown when responding to: ` +
+                            ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);
+                        logger.error(`Error thrown by:`, route);
+                        logger.error(err);
+                        logger.groupEnd();
+                    }
+                    try {
+                        return await catchHandler.handle({ url, request, event, params });
+                    }
+                    catch (catchErr) {
+                        if (catchErr instanceof Error) {
+                            err = catchErr;
+                        }
+                    }
+                }
+                if (this._catchHandler) {
+                    if (process.env.NODE_ENV !== 'production') {
+                        // Still include URL here as it will be async from the console group
+                        // and may not make sense without the URL
+                        logger.groupCollapsed(`Error thrown when responding to: ` +
+                            ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);
+                        logger.error(`Error thrown by:`, route);
+                        logger.error(err);
+                        logger.groupEnd();
+                    }
+                    return this._catchHandler.handle({ url, request, event });
+                }
+                throw err;
+            });
+        }
+        return responsePromise;
+    }
+    /**
+     * Checks a request and URL (and optionally an event) against the list of
+     * registered routes, and if there's a match, returns the corresponding
+     * route along with any params generated by the match.
+     *
+     * @param {Object} options
+     * @param {URL} options.url
+     * @param {boolean} options.sameOrigin The result of comparing `url.origin`
+     *     against the current origin.
+     * @param {Request} options.request The request to match.
+     * @param {Event} options.event The corresponding event.
+     * @return {Object} An object with `route` and `params` properties.
+     *     They are populated if a matching route was found or `undefined`
+     *     otherwise.
+     */
+    findMatchingRoute({ url, sameOrigin, request, event, }) {
+        const routes = this._routes.get(request.method) || [];
+        for (const route of routes) {
+            let params;
+            // route.match returns type any, not possible to change right now.
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+            const matchResult = route.match({ url, sameOrigin, request, event });
+            if (matchResult) {
+                if (process.env.NODE_ENV !== 'production') {
+                    // Warn developers that using an async matchCallback is almost always
+                    // not the right thing to do.
+                    if (matchResult instanceof Promise) {
+                        logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +
+                            `matchCallback function was used. Please convert the ` +
+                            `following route to use a synchronous matchCallback function:`, route);
+                    }
+                }
+                // See https://github.com/GoogleChrome/workbox/issues/2079
+                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+                params = matchResult;
+                if (Array.isArray(params) && params.length === 0) {
+                    // Instead of passing an empty array in as params, use undefined.
+                    params = undefined;
+                }
+                else if (matchResult.constructor === Object && // eslint-disable-line
+                    Object.keys(matchResult).length === 0) {
+                    // Instead of passing an empty object in as params, use undefined.
+                    params = undefined;
+                }
+                else if (typeof matchResult === 'boolean') {
+                    // For the boolean value true (rather than just something truth-y),
+                    // don't set params.
+                    // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353
+                    params = undefined;
+                }
+                // Return early if have a match.
+                return { route, params };
+            }
+        }
+        // If no match was found above, return and empty object.
+        return {};
+    }
+    /**
+     * Define a default `handler` that's called when no routes explicitly
+     * match the incoming request.
+     *
+     * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.
+     *
+     * Without a default handler, unmatched requests will go against the
+     * network as if there were no service worker present.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     * @param {string} [method='GET'] The HTTP method to associate with this
+     * default handler. Each method has its own default.
+     */
+    setDefaultHandler(handler, method = defaultMethod) {
+        this._defaultHandlerMap.set(method, normalizeHandler(handler));
+    }
+    /**
+     * If a Route throws an error while handling a request, this `handler`
+     * will be called and given a chance to provide a response.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     */
+    setCatchHandler(handler) {
+        this._catchHandler = normalizeHandler(handler);
+    }
+    /**
+     * Registers a route with the router.
+     *
+     * @param {workbox-routing.Route} route The route to register.
+     */
+    registerRoute(route) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isType(route, 'object', {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'registerRoute',
+                paramName: 'route',
+            });
+            assert.hasMethod(route, 'match', {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'registerRoute',
+                paramName: 'route',
+            });
+            assert.isType(route.handler, 'object', {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'registerRoute',
+                paramName: 'route',
+            });
+            assert.hasMethod(route.handler, 'handle', {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'registerRoute',
+                paramName: 'route.handler',
+            });
+            assert.isType(route.method, 'string', {
+                moduleName: 'workbox-routing',
+                className: 'Router',
+                funcName: 'registerRoute',
+                paramName: 'route.method',
+            });
+        }
+        if (!this._routes.has(route.method)) {
+            this._routes.set(route.method, []);
+        }
+        // Give precedence to all of the earlier routes by adding this additional
+        // route to the end of the array.
+        this._routes.get(route.method).push(route);
+    }
+    /**
+     * Unregisters a route with the router.
+     *
+     * @param {workbox-routing.Route} route The route to unregister.
+     */
+    unregisterRoute(route) {
+        if (!this._routes.has(route.method)) {
+            throw new WorkboxError('unregister-route-but-not-found-with-method', {
+                method: route.method,
+            });
+        }
+        const routeIndex = this._routes.get(route.method).indexOf(route);
+        if (routeIndex > -1) {
+            this._routes.get(route.method).splice(routeIndex, 1);
+        }
+        else {
+            throw new WorkboxError('unregister-route-route-not-registered');
+        }
+    }
+}
+export { Router };
diff --git a/tools/ui/node_modules/workbox-routing/Router.mjs b/tools/ui/node_modules/workbox-routing/Router.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..dce65f82864555fd38c5396970d7cbda147d5b9d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/Router.mjs
@@ -0,0 +1 @@
+export * from './Router.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/_types.d.ts b/tools/ui/node_modules/workbox-routing/_types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cec08a5dcfae4b44e424805edc0368209013e6d3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/_types.d.ts
@@ -0,0 +1,49 @@
+import './_version.js';
+/**
+ * The "match" callback is used to determine if a `Route` should apply for a
+ * particular URL. When matching occurs in response to a fetch event from the
+ * client, the `event` object is supplied in addition to the `url`, `request`,
+ * and `sameOrigin` value. However, since the match callback can be invoked
+ * outside of a fetch event, matching logic should not assume the `event`
+ * object will always be available.
+ *
+ * If the match callback returns a truthy value, the matching route's
+ * {@link workbox-routing~handlerCallback} will be
+ * invoked immediately. If the value returned is a non-empty array or object,
+ * that value will be set on the handler's `context.params` argument.
+ *
+ * @callback ~matchCallback
+ * @param {Object} context
+ * @param {Request} context.request The corresponding request.
+ * @param {URL} context.url The request's URL.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {boolean} context.sameOrigin The result of comparing `url.origin`
+ *     against the current origin.
+ * @return {*} To signify a match, return a truthy value.
+ *
+ * @memberof workbox-routing
+ */
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL to a
+ * `Route` via its {@link workbox-routing~matchCallback}
+ * callback. This callback should return a Promise that resolves with a
+ * `Response`.
+ *
+ * If a non-empty array or object is returned by the
+ * {@link workbox-routing~matchCallback} it
+ * will be passed in as the handler's `context.params` argument.
+ *
+ * @callback ~handlerCallback
+ * @param {Object} context
+ * @param {Request|string} context.request The corresponding request.
+ * @param {URL} context.url The URL that matched, if available.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {Object} [context.params] Array or Object parameters returned by the
+ *     Route's {@link workbox-routing~matchCallback}.
+ *     This will be undefined if an empty array or object were returned.
+ * @return {Promise} The response that will fulfill the request.
+ *
+ * @memberof workbox-routing
+ */
diff --git a/tools/ui/node_modules/workbox-routing/_types.js b/tools/ui/node_modules/workbox-routing/_types.js
new file mode 100644
index 0000000000000000000000000000000000000000..0c6448d7fbe538ce8fd01a47a57642c8e69526c0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/_types.js
@@ -0,0 +1,62 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import './_version.js';
+// * * * IMPORTANT! * * *
+// ------------------------------------------------------------------------- //
+// jdsoc type definitions cannot be declared above TypeScript definitions or
+// they'll be stripped from the built `.js` files, and they'll only be in the
+// `d.ts` files, which aren't read by the jsdoc generator. As a result we
+// have to put declare them below.
+/**
+ * The "match" callback is used to determine if a `Route` should apply for a
+ * particular URL. When matching occurs in response to a fetch event from the
+ * client, the `event` object is supplied in addition to the `url`, `request`,
+ * and `sameOrigin` value. However, since the match callback can be invoked
+ * outside of a fetch event, matching logic should not assume the `event`
+ * object will always be available.
+ *
+ * If the match callback returns a truthy value, the matching route's
+ * {@link workbox-routing~handlerCallback} will be
+ * invoked immediately. If the value returned is a non-empty array or object,
+ * that value will be set on the handler's `context.params` argument.
+ *
+ * @callback ~matchCallback
+ * @param {Object} context
+ * @param {Request} context.request The corresponding request.
+ * @param {URL} context.url The request's URL.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {boolean} context.sameOrigin The result of comparing `url.origin`
+ *     against the current origin.
+ * @return {*} To signify a match, return a truthy value.
+ *
+ * @memberof workbox-routing
+ */
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL to a
+ * `Route` via its {@link workbox-routing~matchCallback}
+ * callback. This callback should return a Promise that resolves with a
+ * `Response`.
+ *
+ * If a non-empty array or object is returned by the
+ * {@link workbox-routing~matchCallback} it
+ * will be passed in as the handler's `context.params` argument.
+ *
+ * @callback ~handlerCallback
+ * @param {Object} context
+ * @param {Request|string} context.request The corresponding request.
+ * @param {URL} context.url The URL that matched, if available.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {Object} [context.params] Array or Object parameters returned by the
+ *     Route's {@link workbox-routing~matchCallback}.
+ *     This will be undefined if an empty array or object were returned.
+ * @return {Promise} The response that will fulfill the request.
+ *
+ * @memberof workbox-routing
+ */
diff --git a/tools/ui/node_modules/workbox-routing/_types.mjs b/tools/ui/node_modules/workbox-routing/_types.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..fb0ccdd9e49605f634b19eb6c43bd521a13a66ab
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/_types.mjs
@@ -0,0 +1 @@
+export * from './_types.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/_version.d.ts b/tools/ui/node_modules/workbox-routing/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-routing/_version.js b/tools/ui/node_modules/workbox-routing/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad2f0bed03521e5fe51b58f18a441b8ab95b3ae9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:routing:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-routing/_version.mjs b/tools/ui/node_modules/workbox-routing/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..e44777514faaa97c9a3ebb0c39bc9a3a3fa12f05
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:routing:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js b/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..62c5b2b924ad39445de3744fd010bddad175ab34
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js
@@ -0,0 +1,884 @@
+this.workbox = this.workbox || {};
+this.workbox.routing = (function (exports, assert_js, logger_js, WorkboxError_js, getFriendlyURL_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:routing:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * The default HTTP method, 'GET', used when there's no specific method
+     * configured for a route.
+     *
+     * @type {string}
+     *
+     * @private
+     */
+    const defaultMethod = 'GET';
+    /**
+     * The list of valid HTTP methods associated with requests that could be routed.
+     *
+     * @type {Array}
+     *
+     * @private
+     */
+    const validMethods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'];
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * @param {function()|Object} handler Either a function, or an object with a
+     * 'handle' method.
+     * @return {Object} An object with a handle method.
+     *
+     * @private
+     */
+    const normalizeHandler = handler => {
+      if (handler && typeof handler === 'object') {
+        {
+          assert_js.assert.hasMethod(handler, 'handle', {
+            moduleName: 'workbox-routing',
+            className: 'Route',
+            funcName: 'constructor',
+            paramName: 'handler'
+          });
+        }
+        return handler;
+      } else {
+        {
+          assert_js.assert.isType(handler, 'function', {
+            moduleName: 'workbox-routing',
+            className: 'Route',
+            funcName: 'constructor',
+            paramName: 'handler'
+          });
+        }
+        return {
+          handle: handler
+        };
+      }
+    };
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * A `Route` consists of a pair of callback functions, "match" and "handler".
+     * The "match" callback determine if a route should be used to "handle" a
+     * request by returning a non-falsy value if it can. The "handler" callback
+     * is called when there is a match and should return a Promise that resolves
+     * to a `Response`.
+     *
+     * @memberof workbox-routing
+     */
+    class Route {
+      /**
+       * Constructor for Route class.
+       *
+       * @param {workbox-routing~matchCallback} match
+       * A callback function that determines whether the route matches a given
+       * `fetch` event by returning a non-falsy value.
+       * @param {workbox-routing~handlerCallback} handler A callback
+       * function that returns a Promise resolving to a Response.
+       * @param {string} [method='GET'] The HTTP method to match the Route
+       * against.
+       */
+      constructor(match, handler, method = defaultMethod) {
+        {
+          assert_js.assert.isType(match, 'function', {
+            moduleName: 'workbox-routing',
+            className: 'Route',
+            funcName: 'constructor',
+            paramName: 'match'
+          });
+          if (method) {
+            assert_js.assert.isOneOf(method, validMethods, {
+              paramName: 'method'
+            });
+          }
+        }
+        // These values are referenced directly by Router so cannot be
+        // altered by minificaton.
+        this.handler = normalizeHandler(handler);
+        this.match = match;
+        this.method = method;
+      }
+      /**
+       *
+       * @param {workbox-routing-handlerCallback} handler A callback
+       * function that returns a Promise resolving to a Response
+       */
+      setCatchHandler(handler) {
+        this.catchHandler = normalizeHandler(handler);
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * NavigationRoute makes it easy to create a
+     * {@link workbox-routing.Route} that matches for browser
+     * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
+     *
+     * It will only match incoming Requests whose
+     * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}
+     * is set to `navigate`.
+     *
+     * You can optionally only apply this route to a subset of navigation requests
+     * by using one or both of the `denylist` and `allowlist` parameters.
+     *
+     * @memberof workbox-routing
+     * @extends workbox-routing.Route
+     */
+    class NavigationRoute extends Route {
+      /**
+       * If both `denylist` and `allowlist` are provided, the `denylist` will
+       * take precedence and the request will not match this route.
+       *
+       * The regular expressions in `allowlist` and `denylist`
+       * are matched against the concatenated
+       * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
+       * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
+       * portions of the requested URL.
+       *
+       * *Note*: These RegExps may be evaluated against every destination URL during
+       * a navigation. Avoid using
+       * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+       * or else your users may see delays when navigating your site.
+       *
+       * @param {workbox-routing~handlerCallback} handler A callback
+       * function that returns a Promise resulting in a Response.
+       * @param {Object} options
+       * @param {Array} [options.denylist] If any of these patterns match,
+       * the route will not handle the request (even if a allowlist RegExp matches).
+       * @param {Array} [options.allowlist=[/./]] If any of these patterns
+       * match the URL's pathname and search parameter, the route will handle the
+       * request (assuming the denylist doesn't match).
+       */
+      constructor(handler, {
+        allowlist = [/./],
+        denylist = []
+      } = {}) {
+        {
+          assert_js.assert.isArrayOfClass(allowlist, RegExp, {
+            moduleName: 'workbox-routing',
+            className: 'NavigationRoute',
+            funcName: 'constructor',
+            paramName: 'options.allowlist'
+          });
+          assert_js.assert.isArrayOfClass(denylist, RegExp, {
+            moduleName: 'workbox-routing',
+            className: 'NavigationRoute',
+            funcName: 'constructor',
+            paramName: 'options.denylist'
+          });
+        }
+        super(options => this._match(options), handler);
+        this._allowlist = allowlist;
+        this._denylist = denylist;
+      }
+      /**
+       * Routes match handler.
+       *
+       * @param {Object} options
+       * @param {URL} options.url
+       * @param {Request} options.request
+       * @return {boolean}
+       *
+       * @private
+       */
+      _match({
+        url,
+        request
+      }) {
+        if (request && request.mode !== 'navigate') {
+          return false;
+        }
+        const pathnameAndSearch = url.pathname + url.search;
+        for (const regExp of this._denylist) {
+          if (regExp.test(pathnameAndSearch)) {
+            {
+              logger_js.logger.log(`The navigation route ${pathnameAndSearch} is not ` + `being used, since the URL matches this denylist pattern: ` + `${regExp.toString()}`);
+            }
+            return false;
+          }
+        }
+        if (this._allowlist.some(regExp => regExp.test(pathnameAndSearch))) {
+          {
+            logger_js.logger.debug(`The navigation route ${pathnameAndSearch} ` + `is being used.`);
+          }
+          return true;
+        }
+        {
+          logger_js.logger.log(`The navigation route ${pathnameAndSearch} is not ` + `being used, since the URL being navigated to doesn't ` + `match the allowlist.`);
+        }
+        return false;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * RegExpRoute makes it easy to create a regular expression based
+     * {@link workbox-routing.Route}.
+     *
+     * For same-origin requests the RegExp only needs to match part of the URL. For
+     * requests against third-party servers, you must define a RegExp that matches
+     * the start of the URL.
+     *
+     * @memberof workbox-routing
+     * @extends workbox-routing.Route
+     */
+    class RegExpRoute extends Route {
+      /**
+       * If the regular expression contains
+       * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},
+       * the captured values will be passed to the
+       * {@link workbox-routing~handlerCallback} `params`
+       * argument.
+       *
+       * @param {RegExp} regExp The regular expression to match against URLs.
+       * @param {workbox-routing~handlerCallback} handler A callback
+       * function that returns a Promise resulting in a Response.
+       * @param {string} [method='GET'] The HTTP method to match the Route
+       * against.
+       */
+      constructor(regExp, handler, method) {
+        {
+          assert_js.assert.isInstance(regExp, RegExp, {
+            moduleName: 'workbox-routing',
+            className: 'RegExpRoute',
+            funcName: 'constructor',
+            paramName: 'pattern'
+          });
+        }
+        const match = ({
+          url
+        }) => {
+          const result = regExp.exec(url.href);
+          // Return immediately if there's no match.
+          if (!result) {
+            return;
+          }
+          // Require that the match start at the first character in the URL string
+          // if it's a cross-origin request.
+          // See https://github.com/GoogleChrome/workbox/issues/281 for the context
+          // behind this behavior.
+          if (url.origin !== location.origin && result.index !== 0) {
+            {
+              logger_js.logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` + `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` + `handle cross-origin requests if they match the entire URL.`);
+            }
+            return;
+          }
+          // If the route matches, but there aren't any capture groups defined, then
+          // this will return [], which is truthy and therefore sufficient to
+          // indicate a match.
+          // If there are capture groups, then it will return their values.
+          return result.slice(1);
+        };
+        super(match, handler, method);
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * The Router can be used to process a `FetchEvent` using one or more
+     * {@link workbox-routing.Route}, responding with a `Response` if
+     * a matching route exists.
+     *
+     * If no route matches a given a request, the Router will use a "default"
+     * handler if one is defined.
+     *
+     * Should the matching Route throw an error, the Router will use a "catch"
+     * handler if one is defined to gracefully deal with issues and respond with a
+     * Request.
+     *
+     * If a request matches multiple routes, the **earliest** registered route will
+     * be used to respond to the request.
+     *
+     * @memberof workbox-routing
+     */
+    class Router {
+      /**
+       * Initializes a new Router.
+       */
+      constructor() {
+        this._routes = new Map();
+        this._defaultHandlerMap = new Map();
+      }
+      /**
+       * @return {Map>} routes A `Map` of HTTP
+       * method name ('GET', etc.) to an array of all the corresponding `Route`
+       * instances that are registered.
+       */
+      get routes() {
+        return this._routes;
+      }
+      /**
+       * Adds a fetch event listener to respond to events when a route matches
+       * the event's request.
+       */
+      addFetchListener() {
+        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+        self.addEventListener('fetch', event => {
+          const {
+            request
+          } = event;
+          const responsePromise = this.handleRequest({
+            request,
+            event
+          });
+          if (responsePromise) {
+            event.respondWith(responsePromise);
+          }
+        });
+      }
+      /**
+       * Adds a message event listener for URLs to cache from the window.
+       * This is useful to cache resources loaded on the page prior to when the
+       * service worker started controlling it.
+       *
+       * The format of the message data sent from the window should be as follows.
+       * Where the `urlsToCache` array may consist of URL strings or an array of
+       * URL string + `requestInit` object (the same as you'd pass to `fetch()`).
+       *
+       * ```
+       * {
+       *   type: 'CACHE_URLS',
+       *   payload: {
+       *     urlsToCache: [
+       *       './script1.js',
+       *       './script2.js',
+       *       ['./script3.js', {mode: 'no-cors'}],
+       *     ],
+       *   },
+       * }
+       * ```
+       */
+      addCacheListener() {
+        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+        self.addEventListener('message', event => {
+          // event.data is type 'any'
+          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+          if (event.data && event.data.type === 'CACHE_URLS') {
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+            const {
+              payload
+            } = event.data;
+            {
+              logger_js.logger.debug(`Caching URLs from the window`, payload.urlsToCache);
+            }
+            const requestPromises = Promise.all(payload.urlsToCache.map(entry => {
+              if (typeof entry === 'string') {
+                entry = [entry];
+              }
+              const request = new Request(...entry);
+              return this.handleRequest({
+                request,
+                event
+              });
+              // TODO(philipwalton): TypeScript errors without this typecast for
+              // some reason (probably a bug). The real type here should work but
+              // doesn't: `Array | undefined>`.
+            })); // TypeScript
+            event.waitUntil(requestPromises);
+            // If a MessageChannel was used, reply to the message on success.
+            if (event.ports && event.ports[0]) {
+              void requestPromises.then(() => event.ports[0].postMessage(true));
+            }
+          }
+        });
+      }
+      /**
+       * Apply the routing rules to a FetchEvent object to get a Response from an
+       * appropriate Route's handler.
+       *
+       * @param {Object} options
+       * @param {Request} options.request The request to handle.
+       * @param {ExtendableEvent} options.event The event that triggered the
+       *     request.
+       * @return {Promise|undefined} A promise is returned if a
+       *     registered route can handle the request. If there is no matching
+       *     route and there's no `defaultHandler`, `undefined` is returned.
+       */
+      handleRequest({
+        request,
+        event
+      }) {
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'handleRequest',
+            paramName: 'options.request'
+          });
+        }
+        const url = new URL(request.url, location.href);
+        if (!url.protocol.startsWith('http')) {
+          {
+            logger_js.logger.debug(`Workbox Router only supports URLs that start with 'http'.`);
+          }
+          return;
+        }
+        const sameOrigin = url.origin === location.origin;
+        const {
+          params,
+          route
+        } = this.findMatchingRoute({
+          event,
+          request,
+          sameOrigin,
+          url
+        });
+        let handler = route && route.handler;
+        const debugMessages = [];
+        {
+          if (handler) {
+            debugMessages.push([`Found a route to handle this request:`, route]);
+            if (params) {
+              debugMessages.push([`Passing the following params to the route's handler:`, params]);
+            }
+          }
+        }
+        // If we don't have a handler because there was no matching route, then
+        // fall back to defaultHandler if that's defined.
+        const method = request.method;
+        if (!handler && this._defaultHandlerMap.has(method)) {
+          {
+            debugMessages.push(`Failed to find a matching route. Falling ` + `back to the default handler for ${method}.`);
+          }
+          handler = this._defaultHandlerMap.get(method);
+        }
+        if (!handler) {
+          {
+            // No handler so Workbox will do nothing. If logs is set of debug
+            // i.e. verbose, we should print out this information.
+            logger_js.logger.debug(`No route found for: ${getFriendlyURL_js.getFriendlyURL(url)}`);
+          }
+          return;
+        }
+        {
+          // We have a handler, meaning Workbox is going to handle the route.
+          // print the routing details to the console.
+          logger_js.logger.groupCollapsed(`Router is responding to: ${getFriendlyURL_js.getFriendlyURL(url)}`);
+          debugMessages.forEach(msg => {
+            if (Array.isArray(msg)) {
+              logger_js.logger.log(...msg);
+            } else {
+              logger_js.logger.log(msg);
+            }
+          });
+          logger_js.logger.groupEnd();
+        }
+        // Wrap in try and catch in case the handle method throws a synchronous
+        // error. It should still callback to the catch handler.
+        let responsePromise;
+        try {
+          responsePromise = handler.handle({
+            url,
+            request,
+            event,
+            params
+          });
+        } catch (err) {
+          responsePromise = Promise.reject(err);
+        }
+        // Get route's catch handler, if it exists
+        const catchHandler = route && route.catchHandler;
+        if (responsePromise instanceof Promise && (this._catchHandler || catchHandler)) {
+          responsePromise = responsePromise.catch(async err => {
+            // If there's a route catch handler, process that first
+            if (catchHandler) {
+              {
+                // Still include URL here as it will be async from the console group
+                // and may not make sense without the URL
+                logger_js.logger.groupCollapsed(`Error thrown when responding to: ` + ` ${getFriendlyURL_js.getFriendlyURL(url)}. Falling back to route's Catch Handler.`);
+                logger_js.logger.error(`Error thrown by:`, route);
+                logger_js.logger.error(err);
+                logger_js.logger.groupEnd();
+              }
+              try {
+                return await catchHandler.handle({
+                  url,
+                  request,
+                  event,
+                  params
+                });
+              } catch (catchErr) {
+                if (catchErr instanceof Error) {
+                  err = catchErr;
+                }
+              }
+            }
+            if (this._catchHandler) {
+              {
+                // Still include URL here as it will be async from the console group
+                // and may not make sense without the URL
+                logger_js.logger.groupCollapsed(`Error thrown when responding to: ` + ` ${getFriendlyURL_js.getFriendlyURL(url)}. Falling back to global Catch Handler.`);
+                logger_js.logger.error(`Error thrown by:`, route);
+                logger_js.logger.error(err);
+                logger_js.logger.groupEnd();
+              }
+              return this._catchHandler.handle({
+                url,
+                request,
+                event
+              });
+            }
+            throw err;
+          });
+        }
+        return responsePromise;
+      }
+      /**
+       * Checks a request and URL (and optionally an event) against the list of
+       * registered routes, and if there's a match, returns the corresponding
+       * route along with any params generated by the match.
+       *
+       * @param {Object} options
+       * @param {URL} options.url
+       * @param {boolean} options.sameOrigin The result of comparing `url.origin`
+       *     against the current origin.
+       * @param {Request} options.request The request to match.
+       * @param {Event} options.event The corresponding event.
+       * @return {Object} An object with `route` and `params` properties.
+       *     They are populated if a matching route was found or `undefined`
+       *     otherwise.
+       */
+      findMatchingRoute({
+        url,
+        sameOrigin,
+        request,
+        event
+      }) {
+        const routes = this._routes.get(request.method) || [];
+        for (const route of routes) {
+          let params;
+          // route.match returns type any, not possible to change right now.
+          // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+          const matchResult = route.match({
+            url,
+            sameOrigin,
+            request,
+            event
+          });
+          if (matchResult) {
+            {
+              // Warn developers that using an async matchCallback is almost always
+              // not the right thing to do.
+              if (matchResult instanceof Promise) {
+                logger_js.logger.warn(`While routing ${getFriendlyURL_js.getFriendlyURL(url)}, an async ` + `matchCallback function was used. Please convert the ` + `following route to use a synchronous matchCallback function:`, route);
+              }
+            }
+            // See https://github.com/GoogleChrome/workbox/issues/2079
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+            params = matchResult;
+            if (Array.isArray(params) && params.length === 0) {
+              // Instead of passing an empty array in as params, use undefined.
+              params = undefined;
+            } else if (matchResult.constructor === Object &&
+            // eslint-disable-line
+            Object.keys(matchResult).length === 0) {
+              // Instead of passing an empty object in as params, use undefined.
+              params = undefined;
+            } else if (typeof matchResult === 'boolean') {
+              // For the boolean value true (rather than just something truth-y),
+              // don't set params.
+              // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353
+              params = undefined;
+            }
+            // Return early if have a match.
+            return {
+              route,
+              params
+            };
+          }
+        }
+        // If no match was found above, return and empty object.
+        return {};
+      }
+      /**
+       * Define a default `handler` that's called when no routes explicitly
+       * match the incoming request.
+       *
+       * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.
+       *
+       * Without a default handler, unmatched requests will go against the
+       * network as if there were no service worker present.
+       *
+       * @param {workbox-routing~handlerCallback} handler A callback
+       * function that returns a Promise resulting in a Response.
+       * @param {string} [method='GET'] The HTTP method to associate with this
+       * default handler. Each method has its own default.
+       */
+      setDefaultHandler(handler, method = defaultMethod) {
+        this._defaultHandlerMap.set(method, normalizeHandler(handler));
+      }
+      /**
+       * If a Route throws an error while handling a request, this `handler`
+       * will be called and given a chance to provide a response.
+       *
+       * @param {workbox-routing~handlerCallback} handler A callback
+       * function that returns a Promise resulting in a Response.
+       */
+      setCatchHandler(handler) {
+        this._catchHandler = normalizeHandler(handler);
+      }
+      /**
+       * Registers a route with the router.
+       *
+       * @param {workbox-routing.Route} route The route to register.
+       */
+      registerRoute(route) {
+        {
+          assert_js.assert.isType(route, 'object', {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'registerRoute',
+            paramName: 'route'
+          });
+          assert_js.assert.hasMethod(route, 'match', {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'registerRoute',
+            paramName: 'route'
+          });
+          assert_js.assert.isType(route.handler, 'object', {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'registerRoute',
+            paramName: 'route'
+          });
+          assert_js.assert.hasMethod(route.handler, 'handle', {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'registerRoute',
+            paramName: 'route.handler'
+          });
+          assert_js.assert.isType(route.method, 'string', {
+            moduleName: 'workbox-routing',
+            className: 'Router',
+            funcName: 'registerRoute',
+            paramName: 'route.method'
+          });
+        }
+        if (!this._routes.has(route.method)) {
+          this._routes.set(route.method, []);
+        }
+        // Give precedence to all of the earlier routes by adding this additional
+        // route to the end of the array.
+        this._routes.get(route.method).push(route);
+      }
+      /**
+       * Unregisters a route with the router.
+       *
+       * @param {workbox-routing.Route} route The route to unregister.
+       */
+      unregisterRoute(route) {
+        if (!this._routes.has(route.method)) {
+          throw new WorkboxError_js.WorkboxError('unregister-route-but-not-found-with-method', {
+            method: route.method
+          });
+        }
+        const routeIndex = this._routes.get(route.method).indexOf(route);
+        if (routeIndex > -1) {
+          this._routes.get(route.method).splice(routeIndex, 1);
+        } else {
+          throw new WorkboxError_js.WorkboxError('unregister-route-route-not-registered');
+        }
+      }
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    let defaultRouter;
+    /**
+     * Creates a new, singleton Router instance if one does not exist. If one
+     * does already exist, that instance is returned.
+     *
+     * @private
+     * @return {Router}
+     */
+    const getOrCreateDefaultRouter = () => {
+      if (!defaultRouter) {
+        defaultRouter = new Router();
+        // The helpers that use the default Router assume these listeners exist.
+        defaultRouter.addFetchListener();
+        defaultRouter.addCacheListener();
+      }
+      return defaultRouter;
+    };
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Easily register a RegExp, string, or function with a caching
+     * strategy to a singleton Router instance.
+     *
+     * This method will generate a Route for you if needed and
+     * call {@link workbox-routing.Router#registerRoute}.
+     *
+     * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture
+     * If the capture param is a `Route`, all other arguments will be ignored.
+     * @param {workbox-routing~handlerCallback} [handler] A callback
+     * function that returns a Promise resulting in a Response. This parameter
+     * is required if `capture` is not a `Route` object.
+     * @param {string} [method='GET'] The HTTP method to match the Route
+     * against.
+     * @return {workbox-routing.Route} The generated `Route`.
+     *
+     * @memberof workbox-routing
+     */
+    function registerRoute(capture, handler, method) {
+      let route;
+      if (typeof capture === 'string') {
+        const captureUrl = new URL(capture, location.href);
+        {
+          if (!(capture.startsWith('/') || capture.startsWith('http'))) {
+            throw new WorkboxError_js.WorkboxError('invalid-string', {
+              moduleName: 'workbox-routing',
+              funcName: 'registerRoute',
+              paramName: 'capture'
+            });
+          }
+          // We want to check if Express-style wildcards are in the pathname only.
+          // TODO: Remove this log message in v4.
+          const valueToCheck = capture.startsWith('http') ? captureUrl.pathname : capture;
+          // See https://github.com/pillarjs/path-to-regexp#parameters
+          const wildcards = '[*:?+]';
+          if (new RegExp(`${wildcards}`).exec(valueToCheck)) {
+            logger_js.logger.debug(`The '$capture' parameter contains an Express-style wildcard ` + `character (${wildcards}). Strings are now always interpreted as ` + `exact matches; use a RegExp for partial or wildcard matches.`);
+          }
+        }
+        const matchCallback = ({
+          url
+        }) => {
+          {
+            if (url.pathname === captureUrl.pathname && url.origin !== captureUrl.origin) {
+              logger_js.logger.debug(`${capture} only partially matches the cross-origin URL ` + `${url.toString()}. This route will only handle cross-origin requests ` + `if they match the entire URL.`);
+            }
+          }
+          return url.href === captureUrl.href;
+        };
+        // If `capture` is a string then `handler` and `method` must be present.
+        route = new Route(matchCallback, handler, method);
+      } else if (capture instanceof RegExp) {
+        // If `capture` is a `RegExp` then `handler` and `method` must be present.
+        route = new RegExpRoute(capture, handler, method);
+      } else if (typeof capture === 'function') {
+        // If `capture` is a function then `handler` and `method` must be present.
+        route = new Route(capture, handler, method);
+      } else if (capture instanceof Route) {
+        route = capture;
+      } else {
+        throw new WorkboxError_js.WorkboxError('unsupported-route-type', {
+          moduleName: 'workbox-routing',
+          funcName: 'registerRoute',
+          paramName: 'capture'
+        });
+      }
+      const defaultRouter = getOrCreateDefaultRouter();
+      defaultRouter.registerRoute(route);
+      return route;
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * If a Route throws an error while handling a request, this `handler`
+     * will be called and given a chance to provide a response.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     *
+     * @memberof workbox-routing
+     */
+    function setCatchHandler(handler) {
+      const defaultRouter = getOrCreateDefaultRouter();
+      defaultRouter.setCatchHandler(handler);
+    }
+
+    /*
+      Copyright 2019 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * Define a default `handler` that's called when no routes explicitly
+     * match the incoming request.
+     *
+     * Without a default handler, unmatched requests will go against the
+     * network as if there were no service worker present.
+     *
+     * @param {workbox-routing~handlerCallback} handler A callback
+     * function that returns a Promise resulting in a Response.
+     *
+     * @memberof workbox-routing
+     */
+    function setDefaultHandler(handler) {
+      const defaultRouter = getOrCreateDefaultRouter();
+      defaultRouter.setDefaultHandler(handler);
+    }
+
+    exports.NavigationRoute = NavigationRoute;
+    exports.RegExpRoute = RegExpRoute;
+    exports.Route = Route;
+    exports.Router = Router;
+    exports.registerRoute = registerRoute;
+    exports.setCatchHandler = setCatchHandler;
+    exports.setDefaultHandler = setDefaultHandler;
+
+    return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private);
+//# sourceMappingURL=workbox-routing.dev.js.map
diff --git a/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js.map b/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..7e0bfbce0094c935ea2cdba0ab7d0c6e88b0df80
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/build/workbox-routing.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-routing.dev.js","sources":["../_version.js","../utils/constants.js","../utils/normalizeHandler.js","../Route.js","../NavigationRoute.js","../RegExpRoute.js","../Router.js","../utils/getOrCreateDefaultRouter.js","../registerRoute.js","../setCatchHandler.js","../setDefaultHandler.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:routing:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n    'DELETE',\n    'GET',\n    'HEAD',\n    'PATCH',\n    'POST',\n    'PUT',\n];\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n    if (handler && typeof handler === 'object') {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.hasMethod(handler, 'handle', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'handler',\n            });\n        }\n        return handler;\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(handler, 'function', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'handler',\n            });\n        }\n        return { handle: handler };\n    }\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n    /**\n     * Constructor for Route class.\n     *\n     * @param {workbox-routing~matchCallback} match\n     * A callback function that determines whether the route matches a given\n     * `fetch` event by returning a non-falsy value.\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resolving to a Response.\n     * @param {string} [method='GET'] The HTTP method to match the Route\n     * against.\n     */\n    constructor(match, handler, method = defaultMethod) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(match, 'function', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'match',\n            });\n            if (method) {\n                assert.isOneOf(method, validMethods, { paramName: 'method' });\n            }\n        }\n        // These values are referenced directly by Router so cannot be\n        // altered by minificaton.\n        this.handler = normalizeHandler(handler);\n        this.match = match;\n        this.method = method;\n    }\n    /**\n     *\n     * @param {workbox-routing-handlerCallback} handler A callback\n     * function that returns a Promise resolving to a Response\n     */\n    setCatchHandler(handler) {\n        this.catchHandler = normalizeHandler(handler);\n    }\n}\nexport { Route };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * NavigationRoute makes it easy to create a\n * {@link workbox-routing.Route} that matches for browser\n * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.\n *\n * It will only match incoming Requests whose\n * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}\n * is set to `navigate`.\n *\n * You can optionally only apply this route to a subset of navigation requests\n * by using one or both of the `denylist` and `allowlist` parameters.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass NavigationRoute extends Route {\n    /**\n     * If both `denylist` and `allowlist` are provided, the `denylist` will\n     * take precedence and the request will not match this route.\n     *\n     * The regular expressions in `allowlist` and `denylist`\n     * are matched against the concatenated\n     * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}\n     * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}\n     * portions of the requested URL.\n     *\n     * *Note*: These RegExps may be evaluated against every destination URL during\n     * a navigation. Avoid using\n     * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\n     * or else your users may see delays when navigating your site.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {Object} options\n     * @param {Array} [options.denylist] If any of these patterns match,\n     * the route will not handle the request (even if a allowlist RegExp matches).\n     * @param {Array} [options.allowlist=[/./]] If any of these patterns\n     * match the URL's pathname and search parameter, the route will handle the\n     * request (assuming the denylist doesn't match).\n     */\n    constructor(handler, { allowlist = [/./], denylist = [] } = {}) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isArrayOfClass(allowlist, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'NavigationRoute',\n                funcName: 'constructor',\n                paramName: 'options.allowlist',\n            });\n            assert.isArrayOfClass(denylist, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'NavigationRoute',\n                funcName: 'constructor',\n                paramName: 'options.denylist',\n            });\n        }\n        super((options) => this._match(options), handler);\n        this._allowlist = allowlist;\n        this._denylist = denylist;\n    }\n    /**\n     * Routes match handler.\n     *\n     * @param {Object} options\n     * @param {URL} options.url\n     * @param {Request} options.request\n     * @return {boolean}\n     *\n     * @private\n     */\n    _match({ url, request }) {\n        if (request && request.mode !== 'navigate') {\n            return false;\n        }\n        const pathnameAndSearch = url.pathname + url.search;\n        for (const regExp of this._denylist) {\n            if (regExp.test(pathnameAndSearch)) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`The navigation route ${pathnameAndSearch} is not ` +\n                        `being used, since the URL matches this denylist pattern: ` +\n                        `${regExp.toString()}`);\n                }\n                return false;\n            }\n        }\n        if (this._allowlist.some((regExp) => regExp.test(pathnameAndSearch))) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`The navigation route ${pathnameAndSearch} ` + `is being used.`);\n            }\n            return true;\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`The navigation route ${pathnameAndSearch} is not ` +\n                `being used, since the URL being navigated to doesn't ` +\n                `match the allowlist.`);\n        }\n        return false;\n    }\n}\nexport { NavigationRoute };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n    /**\n     * If the regular expression contains\n     * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n     * the captured values will be passed to the\n     * {@link workbox-routing~handlerCallback} `params`\n     * argument.\n     *\n     * @param {RegExp} regExp The regular expression to match against URLs.\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {string} [method='GET'] The HTTP method to match the Route\n     * against.\n     */\n    constructor(regExp, handler, method) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(regExp, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'RegExpRoute',\n                funcName: 'constructor',\n                paramName: 'pattern',\n            });\n        }\n        const match = ({ url }) => {\n            const result = regExp.exec(url.href);\n            // Return immediately if there's no match.\n            if (!result) {\n                return;\n            }\n            // Require that the match start at the first character in the URL string\n            // if it's a cross-origin request.\n            // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n            // behind this behavior.\n            if (url.origin !== location.origin && result.index !== 0) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n                        `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n                        `handle cross-origin requests if they match the entire URL.`);\n                }\n                return;\n            }\n            // If the route matches, but there aren't any capture groups defined, then\n            // this will return [], which is truthy and therefore sufficient to\n            // indicate a match.\n            // If there are capture groups, then it will return their values.\n            return result.slice(1);\n        };\n        super(match, handler, method);\n    }\n}\nexport { RegExpRoute };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n    /**\n     * Initializes a new Router.\n     */\n    constructor() {\n        this._routes = new Map();\n        this._defaultHandlerMap = new Map();\n    }\n    /**\n     * @return {Map>} routes A `Map` of HTTP\n     * method name ('GET', etc.) to an array of all the corresponding `Route`\n     * instances that are registered.\n     */\n    get routes() {\n        return this._routes;\n    }\n    /**\n     * Adds a fetch event listener to respond to events when a route matches\n     * the event's request.\n     */\n    addFetchListener() {\n        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n        self.addEventListener('fetch', ((event) => {\n            const { request } = event;\n            const responsePromise = this.handleRequest({ request, event });\n            if (responsePromise) {\n                event.respondWith(responsePromise);\n            }\n        }));\n    }\n    /**\n     * Adds a message event listener for URLs to cache from the window.\n     * This is useful to cache resources loaded on the page prior to when the\n     * service worker started controlling it.\n     *\n     * The format of the message data sent from the window should be as follows.\n     * Where the `urlsToCache` array may consist of URL strings or an array of\n     * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n     *\n     * ```\n     * {\n     *   type: 'CACHE_URLS',\n     *   payload: {\n     *     urlsToCache: [\n     *       './script1.js',\n     *       './script2.js',\n     *       ['./script3.js', {mode: 'no-cors'}],\n     *     ],\n     *   },\n     * }\n     * ```\n     */\n    addCacheListener() {\n        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n        self.addEventListener('message', ((event) => {\n            // event.data is type 'any'\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n            if (event.data && event.data.type === 'CACHE_URLS') {\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n                const { payload } = event.data;\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n                }\n                const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n                    if (typeof entry === 'string') {\n                        entry = [entry];\n                    }\n                    const request = new Request(...entry);\n                    return this.handleRequest({ request, event });\n                    // TODO(philipwalton): TypeScript errors without this typecast for\n                    // some reason (probably a bug). The real type here should work but\n                    // doesn't: `Array | undefined>`.\n                })); // TypeScript\n                event.waitUntil(requestPromises);\n                // If a MessageChannel was used, reply to the message on success.\n                if (event.ports && event.ports[0]) {\n                    void requestPromises.then(() => event.ports[0].postMessage(true));\n                }\n            }\n        }));\n    }\n    /**\n     * Apply the routing rules to a FetchEvent object to get a Response from an\n     * appropriate Route's handler.\n     *\n     * @param {Object} options\n     * @param {Request} options.request The request to handle.\n     * @param {ExtendableEvent} options.event The event that triggered the\n     *     request.\n     * @return {Promise|undefined} A promise is returned if a\n     *     registered route can handle the request. If there is no matching\n     *     route and there's no `defaultHandler`, `undefined` is returned.\n     */\n    handleRequest({ request, event, }) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'handleRequest',\n                paramName: 'options.request',\n            });\n        }\n        const url = new URL(request.url, location.href);\n        if (!url.protocol.startsWith('http')) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n            }\n            return;\n        }\n        const sameOrigin = url.origin === location.origin;\n        const { params, route } = this.findMatchingRoute({\n            event,\n            request,\n            sameOrigin,\n            url,\n        });\n        let handler = route && route.handler;\n        const debugMessages = [];\n        if (process.env.NODE_ENV !== 'production') {\n            if (handler) {\n                debugMessages.push([`Found a route to handle this request:`, route]);\n                if (params) {\n                    debugMessages.push([\n                        `Passing the following params to the route's handler:`,\n                        params,\n                    ]);\n                }\n            }\n        }\n        // If we don't have a handler because there was no matching route, then\n        // fall back to defaultHandler if that's defined.\n        const method = request.method;\n        if (!handler && this._defaultHandlerMap.has(method)) {\n            if (process.env.NODE_ENV !== 'production') {\n                debugMessages.push(`Failed to find a matching route. Falling ` +\n                    `back to the default handler for ${method}.`);\n            }\n            handler = this._defaultHandlerMap.get(method);\n        }\n        if (!handler) {\n            if (process.env.NODE_ENV !== 'production') {\n                // No handler so Workbox will do nothing. If logs is set of debug\n                // i.e. verbose, we should print out this information.\n                logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n            }\n            return;\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            // We have a handler, meaning Workbox is going to handle the route.\n            // print the routing details to the console.\n            logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n            debugMessages.forEach((msg) => {\n                if (Array.isArray(msg)) {\n                    logger.log(...msg);\n                }\n                else {\n                    logger.log(msg);\n                }\n            });\n            logger.groupEnd();\n        }\n        // Wrap in try and catch in case the handle method throws a synchronous\n        // error. It should still callback to the catch handler.\n        let responsePromise;\n        try {\n            responsePromise = handler.handle({ url, request, event, params });\n        }\n        catch (err) {\n            responsePromise = Promise.reject(err);\n        }\n        // Get route's catch handler, if it exists\n        const catchHandler = route && route.catchHandler;\n        if (responsePromise instanceof Promise &&\n            (this._catchHandler || catchHandler)) {\n            responsePromise = responsePromise.catch(async (err) => {\n                // If there's a route catch handler, process that first\n                if (catchHandler) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // Still include URL here as it will be async from the console group\n                        // and may not make sense without the URL\n                        logger.groupCollapsed(`Error thrown when responding to: ` +\n                            ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n                        logger.error(`Error thrown by:`, route);\n                        logger.error(err);\n                        logger.groupEnd();\n                    }\n                    try {\n                        return await catchHandler.handle({ url, request, event, params });\n                    }\n                    catch (catchErr) {\n                        if (catchErr instanceof Error) {\n                            err = catchErr;\n                        }\n                    }\n                }\n                if (this._catchHandler) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // Still include URL here as it will be async from the console group\n                        // and may not make sense without the URL\n                        logger.groupCollapsed(`Error thrown when responding to: ` +\n                            ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n                        logger.error(`Error thrown by:`, route);\n                        logger.error(err);\n                        logger.groupEnd();\n                    }\n                    return this._catchHandler.handle({ url, request, event });\n                }\n                throw err;\n            });\n        }\n        return responsePromise;\n    }\n    /**\n     * Checks a request and URL (and optionally an event) against the list of\n     * registered routes, and if there's a match, returns the corresponding\n     * route along with any params generated by the match.\n     *\n     * @param {Object} options\n     * @param {URL} options.url\n     * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n     *     against the current origin.\n     * @param {Request} options.request The request to match.\n     * @param {Event} options.event The corresponding event.\n     * @return {Object} An object with `route` and `params` properties.\n     *     They are populated if a matching route was found or `undefined`\n     *     otherwise.\n     */\n    findMatchingRoute({ url, sameOrigin, request, event, }) {\n        const routes = this._routes.get(request.method) || [];\n        for (const route of routes) {\n            let params;\n            // route.match returns type any, not possible to change right now.\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n            const matchResult = route.match({ url, sameOrigin, request, event });\n            if (matchResult) {\n                if (process.env.NODE_ENV !== 'production') {\n                    // Warn developers that using an async matchCallback is almost always\n                    // not the right thing to do.\n                    if (matchResult instanceof Promise) {\n                        logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n                            `matchCallback function was used. Please convert the ` +\n                            `following route to use a synchronous matchCallback function:`, route);\n                    }\n                }\n                // See https://github.com/GoogleChrome/workbox/issues/2079\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n                params = matchResult;\n                if (Array.isArray(params) && params.length === 0) {\n                    // Instead of passing an empty array in as params, use undefined.\n                    params = undefined;\n                }\n                else if (matchResult.constructor === Object && // eslint-disable-line\n                    Object.keys(matchResult).length === 0) {\n                    // Instead of passing an empty object in as params, use undefined.\n                    params = undefined;\n                }\n                else if (typeof matchResult === 'boolean') {\n                    // For the boolean value true (rather than just something truth-y),\n                    // don't set params.\n                    // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n                    params = undefined;\n                }\n                // Return early if have a match.\n                return { route, params };\n            }\n        }\n        // If no match was found above, return and empty object.\n        return {};\n    }\n    /**\n     * Define a default `handler` that's called when no routes explicitly\n     * match the incoming request.\n     *\n     * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n     *\n     * Without a default handler, unmatched requests will go against the\n     * network as if there were no service worker present.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {string} [method='GET'] The HTTP method to associate with this\n     * default handler. Each method has its own default.\n     */\n    setDefaultHandler(handler, method = defaultMethod) {\n        this._defaultHandlerMap.set(method, normalizeHandler(handler));\n    }\n    /**\n     * If a Route throws an error while handling a request, this `handler`\n     * will be called and given a chance to provide a response.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     */\n    setCatchHandler(handler) {\n        this._catchHandler = normalizeHandler(handler);\n    }\n    /**\n     * Registers a route with the router.\n     *\n     * @param {workbox-routing.Route} route The route to register.\n     */\n    registerRoute(route) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(route, 'object', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.hasMethod(route, 'match', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.isType(route.handler, 'object', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.hasMethod(route.handler, 'handle', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route.handler',\n            });\n            assert.isType(route.method, 'string', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route.method',\n            });\n        }\n        if (!this._routes.has(route.method)) {\n            this._routes.set(route.method, []);\n        }\n        // Give precedence to all of the earlier routes by adding this additional\n        // route to the end of the array.\n        this._routes.get(route.method).push(route);\n    }\n    /**\n     * Unregisters a route with the router.\n     *\n     * @param {workbox-routing.Route} route The route to unregister.\n     */\n    unregisterRoute(route) {\n        if (!this._routes.has(route.method)) {\n            throw new WorkboxError('unregister-route-but-not-found-with-method', {\n                method: route.method,\n            });\n        }\n        const routeIndex = this._routes.get(route.method).indexOf(route);\n        if (routeIndex > -1) {\n            this._routes.get(route.method).splice(routeIndex, 1);\n        }\n        else {\n            throw new WorkboxError('unregister-route-route-not-registered');\n        }\n    }\n}\nexport { Router };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n    if (!defaultRouter) {\n        defaultRouter = new Router();\n        // The helpers that use the default Router assume these listeners exist.\n        defaultRouter.addFetchListener();\n        defaultRouter.addCacheListener();\n    }\n    return defaultRouter;\n};\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n    let route;\n    if (typeof capture === 'string') {\n        const captureUrl = new URL(capture, location.href);\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n                throw new WorkboxError('invalid-string', {\n                    moduleName: 'workbox-routing',\n                    funcName: 'registerRoute',\n                    paramName: 'capture',\n                });\n            }\n            // We want to check if Express-style wildcards are in the pathname only.\n            // TODO: Remove this log message in v4.\n            const valueToCheck = capture.startsWith('http')\n                ? captureUrl.pathname\n                : capture;\n            // See https://github.com/pillarjs/path-to-regexp#parameters\n            const wildcards = '[*:?+]';\n            if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n                logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n                    `character (${wildcards}). Strings are now always interpreted as ` +\n                    `exact matches; use a RegExp for partial or wildcard matches.`);\n            }\n        }\n        const matchCallback = ({ url }) => {\n            if (process.env.NODE_ENV !== 'production') {\n                if (url.pathname === captureUrl.pathname &&\n                    url.origin !== captureUrl.origin) {\n                    logger.debug(`${capture} only partially matches the cross-origin URL ` +\n                        `${url.toString()}. This route will only handle cross-origin requests ` +\n                        `if they match the entire URL.`);\n                }\n            }\n            return url.href === captureUrl.href;\n        };\n        // If `capture` is a string then `handler` and `method` must be present.\n        route = new Route(matchCallback, handler, method);\n    }\n    else if (capture instanceof RegExp) {\n        // If `capture` is a `RegExp` then `handler` and `method` must be present.\n        route = new RegExpRoute(capture, handler, method);\n    }\n    else if (typeof capture === 'function') {\n        // If `capture` is a function then `handler` and `method` must be present.\n        route = new Route(capture, handler, method);\n    }\n    else if (capture instanceof Route) {\n        route = capture;\n    }\n    else {\n        throw new WorkboxError('unsupported-route-type', {\n            moduleName: 'workbox-routing',\n            funcName: 'registerRoute',\n            paramName: 'capture',\n        });\n    }\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.registerRoute(route);\n    return route;\n}\nexport { registerRoute };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof workbox-routing\n */\nfunction setCatchHandler(handler) {\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof workbox-routing\n */\nfunction setDefaultHandler(handler) {\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.setDefaultHandler(handler);\n}\nexport { setDefaultHandler };\n"],"names":["self","_","e","defaultMethod","validMethods","normalizeHandler","handler","assert","hasMethod","moduleName","className","funcName","paramName","isType","handle","Route","constructor","match","method","isOneOf","setCatchHandler","catchHandler","NavigationRoute","allowlist","denylist","isArrayOfClass","RegExp","options","_match","_allowlist","_denylist","url","request","mode","pathnameAndSearch","pathname","search","regExp","test","logger","log","toString","some","debug","RegExpRoute","isInstance","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","urlsToCache","requestPromises","Promise","all","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","debugMessages","push","has","get","getFriendlyURL","groupCollapsed","forEach","msg","Array","isArray","groupEnd","err","reject","_catchHandler","catch","error","catchErr","Error","matchResult","warn","length","undefined","Object","keys","setDefaultHandler","set","registerRoute","unregisterRoute","WorkboxError","routeIndex","indexOf","splice","defaultRouter","getOrCreateDefaultRouter","capture","captureUrl","valueToCheck","wildcards","matchCallback"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,uBAAuB,CAAC,IAAIC,CAAC,EAAE;IACxC,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAMC,aAAa,GAAG,KAAK;IAClC;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAMC,YAAY,GAAG,CACxB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,CACR;;IC/BD;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAMC,gBAAgB,GAAIC,OAAO,IAAK;IACzC,EAAA,IAAIA,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IACxC,IAA2C;IACvCC,MAAAA,gBAAM,CAACC,SAAS,CAACF,OAAO,EAAE,QAAQ,EAAE;IAChCG,QAAAA,UAAU,EAAE,iBAAiB;IAC7BC,QAAAA,SAAS,EAAE,OAAO;IAClBC,QAAAA,QAAQ,EAAE,aAAa;IACvBC,QAAAA,SAAS,EAAE;IACf,OAAC,CAAC;IACN,IAAA;IACA,IAAA,OAAON,OAAO;IAClB,EAAA,CAAC,MACI;IACD,IAA2C;IACvCC,MAAAA,gBAAM,CAACM,MAAM,CAACP,OAAO,EAAE,UAAU,EAAE;IAC/BG,QAAAA,UAAU,EAAE,iBAAiB;IAC7BC,QAAAA,SAAS,EAAE,OAAO;IAClBC,QAAAA,QAAQ,EAAE,aAAa;IACvBC,QAAAA,SAAS,EAAE;IACf,OAAC,CAAC;IACN,IAAA;Q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O,EAAE;IAC9B,EAAA,MAAMgH,aAAa,GAAGC,wBAAwB,EAAE;IAChDD,EAAAA,aAAa,CAAClG,eAAe,CAACd,OAAO,CAAC;IAC1C;;ICrBA;IACA;;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASwG,iBAAiBA,CAACxG,OAAO,EAAE;IAChC,EAAA,MAAMgH,aAAa,GAAGC,wBAAwB,EAAE;IAChDD,EAAAA,aAAa,CAACR,iBAAiB,CAACxG,OAAO,CAAC;IAC5C;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js b/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..06a91ddced3fa48d4d19b64da7edc8ec6c2d77bb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.routing=function(t,e){"use strict";try{self["workbox:routing:7.4.0"]&&_()}catch(t){}const s=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,r="GET"){this.handler=s(e),this.match=t,this.method=r}setCatchHandler(t){this.catchHandler=s(t)}}class n extends r{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class i{constructor(){this.C=new Map,this.L=new Map}get routes(){return this.C}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const r=s.origin===location.origin,{params:n,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:r,url:s});let o=i&&i.handler;const u=t.method;if(!o&&this.L.has(u)&&(o=this.L.get(u)),!o)return;let c;try{c=o.handle({url:s,request:t,event:e,params:n})}catch(t){c=Promise.reject(t)}const a=i&&i.catchHandler;return c instanceof Promise&&(this.H||a)&&(c=c.catch((async r=>{if(a)try{return await a.handle({url:s,request:t,event:e,params:n})}catch(t){t instanceof Error&&(r=t)}if(this.H)return this.H.handle({url:s,request:t,event:e});throw r}))),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:r}){const n=this.C.get(s.method)||[];for(const i of n){let n;const o=i.match({url:t,sameOrigin:e,request:s,event:r});if(o)return n=o,(Array.isArray(n)&&0===n.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(n=void 0),{route:i,params:n}}return{}}setDefaultHandler(t,e="GET"){this.L.set(e,s(t))}setCatchHandler(t){this.H=s(t)}registerRoute(t){this.C.has(t.method)||this.C.set(t.method,[]),this.C.get(t.method).push(t)}unregisterRoute(t){if(!this.C.has(t.method))throw new e.WorkboxError("unregister-route-but-not-found-with-method",{method:t.method});const s=this.C.get(t.method).indexOf(t);if(!(s>-1))throw new e.WorkboxError("unregister-route-route-not-registered");this.C.get(t.method).splice(s,1)}}let o;const u=()=>(o||(o=new i,o.addFetchListener(),o.addCacheListener()),o);return t.NavigationRoute=class extends r{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super((t=>this.j(t)),t),this.M=e,this.N=s}j({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.N)if(t.test(s))return!1;return!!this.M.some((t=>t.test(s)))}},t.RegExpRoute=n,t.Route=r,t.Router=i,t.registerRoute=function(t,s,i){let o;if("string"==typeof t){const e=new URL(t,location.href);o=new r((({url:t})=>t.href===e.href),s,i)}else if(t instanceof RegExp)o=new n(t,s,i);else if("function"==typeof t)o=new r(t,s,i);else{if(!(t instanceof r))throw new e.WorkboxError("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return u().registerRoute(o),o},t.setCatchHandler=function(t){u().setCatchHandler(t)},t.setDefaultHandler=function(t){u().setDefaultHandler(t)},t}({},workbox.core._private);
+//# sourceMappingURL=workbox-routing.prod.js.map
diff --git a/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js.map b/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..04123ca0dce70539e0f99e57d4b53fb686d052af
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/build/workbox-routing.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-routing.prod.js","sources":["../_version.js","../utils/constants.js","../utils/normalizeHandler.js","../Route.js","../RegExpRoute.js","../Router.js","../utils/getOrCreateDefaultRouter.js","../NavigationRoute.js","../registerRoute.js","../setCatchHandler.js","../setDefaultHandler.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:routing:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n    'DELETE',\n    'GET',\n    'HEAD',\n    'PATCH',\n    'POST',\n    'PUT',\n];\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n    if (handler && typeof handler === 'object') {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.hasMethod(handler, 'handle', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'handler',\n            });\n        }\n        return handler;\n    }\n    else {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(handler, 'function', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'handler',\n            });\n        }\n        return { handle: handler };\n    }\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n    /**\n     * Constructor for Route class.\n     *\n     * @param {workbox-routing~matchCallback} match\n     * A callback function that determines whether the route matches a given\n     * `fetch` event by returning a non-falsy value.\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resolving to a Response.\n     * @param {string} [method='GET'] The HTTP method to match the Route\n     * against.\n     */\n    constructor(match, handler, method = defaultMethod) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(match, 'function', {\n                moduleName: 'workbox-routing',\n                className: 'Route',\n                funcName: 'constructor',\n                paramName: 'match',\n            });\n            if (method) {\n                assert.isOneOf(method, validMethods, { paramName: 'method' });\n            }\n        }\n        // These values are referenced directly by Router so cannot be\n        // altered by minificaton.\n        this.handler = normalizeHandler(handler);\n        this.match = match;\n        this.method = method;\n    }\n    /**\n     *\n     * @param {workbox-routing-handlerCallback} handler A callback\n     * function that returns a Promise resolving to a Response\n     */\n    setCatchHandler(handler) {\n        this.catchHandler = normalizeHandler(handler);\n    }\n}\nexport { Route };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n    /**\n     * If the regular expression contains\n     * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n     * the captured values will be passed to the\n     * {@link workbox-routing~handlerCallback} `params`\n     * argument.\n     *\n     * @param {RegExp} regExp The regular expression to match against URLs.\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {string} [method='GET'] The HTTP method to match the Route\n     * against.\n     */\n    constructor(regExp, handler, method) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(regExp, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'RegExpRoute',\n                funcName: 'constructor',\n                paramName: 'pattern',\n            });\n        }\n        const match = ({ url }) => {\n            const result = regExp.exec(url.href);\n            // Return immediately if there's no match.\n            if (!result) {\n                return;\n            }\n            // Require that the match start at the first character in the URL string\n            // if it's a cross-origin request.\n            // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n            // behind this behavior.\n            if (url.origin !== location.origin && result.index !== 0) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n                        `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n                        `handle cross-origin requests if they match the entire URL.`);\n                }\n                return;\n            }\n            // If the route matches, but there aren't any capture groups defined, then\n            // this will return [], which is truthy and therefore sufficient to\n            // indicate a match.\n            // If there are capture groups, then it will return their values.\n            return result.slice(1);\n        };\n        super(match, handler, method);\n    }\n}\nexport { RegExpRoute };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n    /**\n     * Initializes a new Router.\n     */\n    constructor() {\n        this._routes = new Map();\n        this._defaultHandlerMap = new Map();\n    }\n    /**\n     * @return {Map>} routes A `Map` of HTTP\n     * method name ('GET', etc.) to an array of all the corresponding `Route`\n     * instances that are registered.\n     */\n    get routes() {\n        return this._routes;\n    }\n    /**\n     * Adds a fetch event listener to respond to events when a route matches\n     * the event's request.\n     */\n    addFetchListener() {\n        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n        self.addEventListener('fetch', ((event) => {\n            const { request } = event;\n            const responsePromise = this.handleRequest({ request, event });\n            if (responsePromise) {\n                event.respondWith(responsePromise);\n            }\n        }));\n    }\n    /**\n     * Adds a message event listener for URLs to cache from the window.\n     * This is useful to cache resources loaded on the page prior to when the\n     * service worker started controlling it.\n     *\n     * The format of the message data sent from the window should be as follows.\n     * Where the `urlsToCache` array may consist of URL strings or an array of\n     * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n     *\n     * ```\n     * {\n     *   type: 'CACHE_URLS',\n     *   payload: {\n     *     urlsToCache: [\n     *       './script1.js',\n     *       './script2.js',\n     *       ['./script3.js', {mode: 'no-cors'}],\n     *     ],\n     *   },\n     * }\n     * ```\n     */\n    addCacheListener() {\n        // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n        self.addEventListener('message', ((event) => {\n            // event.data is type 'any'\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n            if (event.data && event.data.type === 'CACHE_URLS') {\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n                const { payload } = event.data;\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n                }\n                const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n                    if (typeof entry === 'string') {\n                        entry = [entry];\n                    }\n                    const request = new Request(...entry);\n                    return this.handleRequest({ request, event });\n                    // TODO(philipwalton): TypeScript errors without this typecast for\n                    // some reason (probably a bug). The real type here should work but\n                    // doesn't: `Array | undefined>`.\n                })); // TypeScript\n                event.waitUntil(requestPromises);\n                // If a MessageChannel was used, reply to the message on success.\n                if (event.ports && event.ports[0]) {\n                    void requestPromises.then(() => event.ports[0].postMessage(true));\n                }\n            }\n        }));\n    }\n    /**\n     * Apply the routing rules to a FetchEvent object to get a Response from an\n     * appropriate Route's handler.\n     *\n     * @param {Object} options\n     * @param {Request} options.request The request to handle.\n     * @param {ExtendableEvent} options.event The event that triggered the\n     *     request.\n     * @return {Promise|undefined} A promise is returned if a\n     *     registered route can handle the request. If there is no matching\n     *     route and there's no `defaultHandler`, `undefined` is returned.\n     */\n    handleRequest({ request, event, }) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'handleRequest',\n                paramName: 'options.request',\n            });\n        }\n        const url = new URL(request.url, location.href);\n        if (!url.protocol.startsWith('http')) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n            }\n            return;\n        }\n        const sameOrigin = url.origin === location.origin;\n        const { params, route } = this.findMatchingRoute({\n            event,\n            request,\n            sameOrigin,\n            url,\n        });\n        let handler = route && route.handler;\n        const debugMessages = [];\n        if (process.env.NODE_ENV !== 'production') {\n            if (handler) {\n                debugMessages.push([`Found a route to handle this request:`, route]);\n                if (params) {\n                    debugMessages.push([\n                        `Passing the following params to the route's handler:`,\n                        params,\n                    ]);\n                }\n            }\n        }\n        // If we don't have a handler because there was no matching route, then\n        // fall back to defaultHandler if that's defined.\n        const method = request.method;\n        if (!handler && this._defaultHandlerMap.has(method)) {\n            if (process.env.NODE_ENV !== 'production') {\n                debugMessages.push(`Failed to find a matching route. Falling ` +\n                    `back to the default handler for ${method}.`);\n            }\n            handler = this._defaultHandlerMap.get(method);\n        }\n        if (!handler) {\n            if (process.env.NODE_ENV !== 'production') {\n                // No handler so Workbox will do nothing. If logs is set of debug\n                // i.e. verbose, we should print out this information.\n                logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n            }\n            return;\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            // We have a handler, meaning Workbox is going to handle the route.\n            // print the routing details to the console.\n            logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n            debugMessages.forEach((msg) => {\n                if (Array.isArray(msg)) {\n                    logger.log(...msg);\n                }\n                else {\n                    logger.log(msg);\n                }\n            });\n            logger.groupEnd();\n        }\n        // Wrap in try and catch in case the handle method throws a synchronous\n        // error. It should still callback to the catch handler.\n        let responsePromise;\n        try {\n            responsePromise = handler.handle({ url, request, event, params });\n        }\n        catch (err) {\n            responsePromise = Promise.reject(err);\n        }\n        // Get route's catch handler, if it exists\n        const catchHandler = route && route.catchHandler;\n        if (responsePromise instanceof Promise &&\n            (this._catchHandler || catchHandler)) {\n            responsePromise = responsePromise.catch(async (err) => {\n                // If there's a route catch handler, process that first\n                if (catchHandler) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // Still include URL here as it will be async from the console group\n                        // and may not make sense without the URL\n                        logger.groupCollapsed(`Error thrown when responding to: ` +\n                            ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n                        logger.error(`Error thrown by:`, route);\n                        logger.error(err);\n                        logger.groupEnd();\n                    }\n                    try {\n                        return await catchHandler.handle({ url, request, event, params });\n                    }\n                    catch (catchErr) {\n                        if (catchErr instanceof Error) {\n                            err = catchErr;\n                        }\n                    }\n                }\n                if (this._catchHandler) {\n                    if (process.env.NODE_ENV !== 'production') {\n                        // Still include URL here as it will be async from the console group\n                        // and may not make sense without the URL\n                        logger.groupCollapsed(`Error thrown when responding to: ` +\n                            ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n                        logger.error(`Error thrown by:`, route);\n                        logger.error(err);\n                        logger.groupEnd();\n                    }\n                    return this._catchHandler.handle({ url, request, event });\n                }\n                throw err;\n            });\n        }\n        return responsePromise;\n    }\n    /**\n     * Checks a request and URL (and optionally an event) against the list of\n     * registered routes, and if there's a match, returns the corresponding\n     * route along with any params generated by the match.\n     *\n     * @param {Object} options\n     * @param {URL} options.url\n     * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n     *     against the current origin.\n     * @param {Request} options.request The request to match.\n     * @param {Event} options.event The corresponding event.\n     * @return {Object} An object with `route` and `params` properties.\n     *     They are populated if a matching route was found or `undefined`\n     *     otherwise.\n     */\n    findMatchingRoute({ url, sameOrigin, request, event, }) {\n        const routes = this._routes.get(request.method) || [];\n        for (const route of routes) {\n            let params;\n            // route.match returns type any, not possible to change right now.\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n            const matchResult = route.match({ url, sameOrigin, request, event });\n            if (matchResult) {\n                if (process.env.NODE_ENV !== 'production') {\n                    // Warn developers that using an async matchCallback is almost always\n                    // not the right thing to do.\n                    if (matchResult instanceof Promise) {\n                        logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n                            `matchCallback function was used. Please convert the ` +\n                            `following route to use a synchronous matchCallback function:`, route);\n                    }\n                }\n                // See https://github.com/GoogleChrome/workbox/issues/2079\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n                params = matchResult;\n                if (Array.isArray(params) && params.length === 0) {\n                    // Instead of passing an empty array in as params, use undefined.\n                    params = undefined;\n                }\n                else if (matchResult.constructor === Object && // eslint-disable-line\n                    Object.keys(matchResult).length === 0) {\n                    // Instead of passing an empty object in as params, use undefined.\n                    params = undefined;\n                }\n                else if (typeof matchResult === 'boolean') {\n                    // For the boolean value true (rather than just something truth-y),\n                    // don't set params.\n                    // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n                    params = undefined;\n                }\n                // Return early if have a match.\n                return { route, params };\n            }\n        }\n        // If no match was found above, return and empty object.\n        return {};\n    }\n    /**\n     * Define a default `handler` that's called when no routes explicitly\n     * match the incoming request.\n     *\n     * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n     *\n     * Without a default handler, unmatched requests will go against the\n     * network as if there were no service worker present.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {string} [method='GET'] The HTTP method to associate with this\n     * default handler. Each method has its own default.\n     */\n    setDefaultHandler(handler, method = defaultMethod) {\n        this._defaultHandlerMap.set(method, normalizeHandler(handler));\n    }\n    /**\n     * If a Route throws an error while handling a request, this `handler`\n     * will be called and given a chance to provide a response.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     */\n    setCatchHandler(handler) {\n        this._catchHandler = normalizeHandler(handler);\n    }\n    /**\n     * Registers a route with the router.\n     *\n     * @param {workbox-routing.Route} route The route to register.\n     */\n    registerRoute(route) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isType(route, 'object', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.hasMethod(route, 'match', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.isType(route.handler, 'object', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route',\n            });\n            assert.hasMethod(route.handler, 'handle', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route.handler',\n            });\n            assert.isType(route.method, 'string', {\n                moduleName: 'workbox-routing',\n                className: 'Router',\n                funcName: 'registerRoute',\n                paramName: 'route.method',\n            });\n        }\n        if (!this._routes.has(route.method)) {\n            this._routes.set(route.method, []);\n        }\n        // Give precedence to all of the earlier routes by adding this additional\n        // route to the end of the array.\n        this._routes.get(route.method).push(route);\n    }\n    /**\n     * Unregisters a route with the router.\n     *\n     * @param {workbox-routing.Route} route The route to unregister.\n     */\n    unregisterRoute(route) {\n        if (!this._routes.has(route.method)) {\n            throw new WorkboxError('unregister-route-but-not-found-with-method', {\n                method: route.method,\n            });\n        }\n        const routeIndex = this._routes.get(route.method).indexOf(route);\n        if (routeIndex > -1) {\n            this._routes.get(route.method).splice(routeIndex, 1);\n        }\n        else {\n            throw new WorkboxError('unregister-route-route-not-registered');\n        }\n    }\n}\nexport { Router };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n    if (!defaultRouter) {\n        defaultRouter = new Router();\n        // The helpers that use the default Router assume these listeners exist.\n        defaultRouter.addFetchListener();\n        defaultRouter.addCacheListener();\n    }\n    return defaultRouter;\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * NavigationRoute makes it easy to create a\n * {@link workbox-routing.Route} that matches for browser\n * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.\n *\n * It will only match incoming Requests whose\n * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}\n * is set to `navigate`.\n *\n * You can optionally only apply this route to a subset of navigation requests\n * by using one or both of the `denylist` and `allowlist` parameters.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass NavigationRoute extends Route {\n    /**\n     * If both `denylist` and `allowlist` are provided, the `denylist` will\n     * take precedence and the request will not match this route.\n     *\n     * The regular expressions in `allowlist` and `denylist`\n     * are matched against the concatenated\n     * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}\n     * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}\n     * portions of the requested URL.\n     *\n     * *Note*: These RegExps may be evaluated against every destination URL during\n     * a navigation. Avoid using\n     * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),\n     * or else your users may see delays when navigating your site.\n     *\n     * @param {workbox-routing~handlerCallback} handler A callback\n     * function that returns a Promise resulting in a Response.\n     * @param {Object} options\n     * @param {Array} [options.denylist] If any of these patterns match,\n     * the route will not handle the request (even if a allowlist RegExp matches).\n     * @param {Array} [options.allowlist=[/./]] If any of these patterns\n     * match the URL's pathname and search parameter, the route will handle the\n     * request (assuming the denylist doesn't match).\n     */\n    constructor(handler, { allowlist = [/./], denylist = [] } = {}) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isArrayOfClass(allowlist, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'NavigationRoute',\n                funcName: 'constructor',\n                paramName: 'options.allowlist',\n            });\n            assert.isArrayOfClass(denylist, RegExp, {\n                moduleName: 'workbox-routing',\n                className: 'NavigationRoute',\n                funcName: 'constructor',\n                paramName: 'options.denylist',\n            });\n        }\n        super((options) => this._match(options), handler);\n        this._allowlist = allowlist;\n        this._denylist = denylist;\n    }\n    /**\n     * Routes match handler.\n     *\n     * @param {Object} options\n     * @param {URL} options.url\n     * @param {Request} options.request\n     * @return {boolean}\n     *\n     * @private\n     */\n    _match({ url, request }) {\n        if (request && request.mode !== 'navigate') {\n            return false;\n        }\n        const pathnameAndSearch = url.pathname + url.search;\n        for (const regExp of this._denylist) {\n            if (regExp.test(pathnameAndSearch)) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`The navigation route ${pathnameAndSearch} is not ` +\n                        `being used, since the URL matches this denylist pattern: ` +\n                        `${regExp.toString()}`);\n                }\n                return false;\n            }\n        }\n        if (this._allowlist.some((regExp) => regExp.test(pathnameAndSearch))) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`The navigation route ${pathnameAndSearch} ` + `is being used.`);\n            }\n            return true;\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.log(`The navigation route ${pathnameAndSearch} is not ` +\n                `being used, since the URL being navigated to doesn't ` +\n                `match the allowlist.`);\n        }\n        return false;\n    }\n}\nexport { NavigationRoute };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n    let route;\n    if (typeof capture === 'string') {\n        const captureUrl = new URL(capture, location.href);\n        if (process.env.NODE_ENV !== 'production') {\n            if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n                throw new WorkboxError('invalid-string', {\n                    moduleName: 'workbox-routing',\n                    funcName: 'registerRoute',\n                    paramName: 'capture',\n                });\n            }\n            // We want to check if Express-style wildcards are in the pathname only.\n            // TODO: Remove this log message in v4.\n            const valueToCheck = capture.startsWith('http')\n                ? captureUrl.pathname\n                : capture;\n            // See https://github.com/pillarjs/path-to-regexp#parameters\n            const wildcards = '[*:?+]';\n            if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n                logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n                    `character (${wildcards}). Strings are now always interpreted as ` +\n                    `exact matches; use a RegExp for partial or wildcard matches.`);\n            }\n        }\n        const matchCallback = ({ url }) => {\n            if (process.env.NODE_ENV !== 'production') {\n                if (url.pathname === captureUrl.pathname &&\n                    url.origin !== captureUrl.origin) {\n                    logger.debug(`${capture} only partially matches the cross-origin URL ` +\n                        `${url.toString()}. This route will only handle cross-origin requests ` +\n                        `if they match the entire URL.`);\n                }\n            }\n            return url.href === captureUrl.href;\n        };\n        // If `capture` is a string then `handler` and `method` must be present.\n        route = new Route(matchCallback, handler, method);\n    }\n    else if (capture instanceof RegExp) {\n        // If `capture` is a `RegExp` then `handler` and `method` must be present.\n        route = new RegExpRoute(capture, handler, method);\n    }\n    else if (typeof capture === 'function') {\n        // If `capture` is a function then `handler` and `method` must be present.\n        route = new Route(capture, handler, method);\n    }\n    else if (capture instanceof Route) {\n        route = capture;\n    }\n    else {\n        throw new WorkboxError('unsupported-route-type', {\n            moduleName: 'workbox-routing',\n            funcName: 'registerRoute',\n            paramName: 'capture',\n        });\n    }\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.registerRoute(route);\n    return route;\n}\nexport { registerRoute };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof workbox-routing\n */\nfunction setCatchHandler(handler) {\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","/*\n  Copyright 2019 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof workbox-routing\n */\nfunction setDefaultHandler(handler) {\n    const defaultRouter = getOrCreateDefaultRouter();\n    defaultRouter.setDefaultHandler(handler);\n}\nexport { setDefaultHandler };\n"],"names":["self","_","e","normalizeHandler","handler","handle","Route","constructor","match","method","this","setCatchHandler","catchHandler","RegExpRoute","regExp","super","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","Error","matchResult","Array","isArray","length","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","WorkboxError","routeIndex","indexOf","splice","defaultRouter","getOrCreateDefaultRouter","allowlist","denylist","options","_match","_allowlist","_denylist","mode","pathnameAndSearch","pathname","search","test","some","capture","captureUrl","matchCallback","RegExp","moduleName","funcName","paramName"],"mappings":"8EAEA,IACIA,KAAK,0BAA4BC,GACrC,CACA,MAAOC,GAAK,CCWL,MCAMC,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFC,YAAYC,EAAOJ,EAASK,EFhBH,OE8BrBC,KAAKN,QAAUD,EAAiBC,GAChCM,KAAKF,MAAQA,EACbE,KAAKD,OAASA,CAClB,CAMAE,gBAAgBP,GACZM,KAAKE,aAAeT,EAAiBC,EACzC,ECnCJ,MAAMS,UAAoBP,EActBC,YAAYO,EAAQV,EAASK,GAiCzBM,OAxBcP,EAAGQ,UACb,MAAMC,EAASH,EAAOI,KAAKF,EAAIG,MAE/B,GAAKF,IAODD,EAAII,SAAWC,SAASD,QAA2B,IAAjBH,EAAOK,OAY7C,OAAOL,EAAOM,MAAM,EAAE,GAEbnB,EAASK,EAC1B,ECvCJ,MAAMe,EAIFjB,cACIG,KAAKe,EAAU,IAAIC,IACnBhB,KAAKiB,EAAqB,IAAID,GAClC,CAMIE,aACA,OAAOlB,KAAKe,CAChB,CAKAI,mBAEI7B,KAAK8B,iBAAiB,SAAWC,IAC7B,MAAMC,QAAEA,GAAYD,EACdE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CACX,oBCzEA,SAAyBpD,GACCgF,IACRzE,gBAAgBP,EAClC,sBCAA,SAA2BA,GACDgF,IACRV,kBAAkBtE,EACpC"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/index.d.ts b/tools/ui/node_modules/workbox-routing/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1139287ff9aa271b6279bc32a6d3f915d2573f39
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/index.d.ts
@@ -0,0 +1,12 @@
+import { NavigationRoute, NavigationRouteMatchOptions } from './NavigationRoute.js';
+import { RegExpRoute } from './RegExpRoute.js';
+import { registerRoute } from './registerRoute.js';
+import { Route } from './Route.js';
+import { Router } from './Router.js';
+import { setCatchHandler } from './setCatchHandler.js';
+import { setDefaultHandler } from './setDefaultHandler.js';
+import './_version.js';
+/**
+ * @module workbox-routing
+ */
+export { NavigationRoute, RegExpRoute, registerRoute, Route, Router, setCatchHandler, setDefaultHandler, NavigationRouteMatchOptions, };
diff --git a/tools/ui/node_modules/workbox-routing/index.js b/tools/ui/node_modules/workbox-routing/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..b84816eeba49baa0f3ee076f8949b95d03c5ec40
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/index.js
@@ -0,0 +1,19 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { NavigationRoute, } from './NavigationRoute.js';
+import { RegExpRoute } from './RegExpRoute.js';
+import { registerRoute } from './registerRoute.js';
+import { Route } from './Route.js';
+import { Router } from './Router.js';
+import { setCatchHandler } from './setCatchHandler.js';
+import { setDefaultHandler } from './setDefaultHandler.js';
+import './_version.js';
+/**
+ * @module workbox-routing
+ */
+export { NavigationRoute, RegExpRoute, registerRoute, Route, Router, setCatchHandler, setDefaultHandler, };
diff --git a/tools/ui/node_modules/workbox-routing/index.mjs b/tools/ui/node_modules/workbox-routing/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/package.json b/tools/ui/node_modules/workbox-routing/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..20d0471610925ad4fc2fcf5caa55750c541bbbda
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/package.json
@@ -0,0 +1,32 @@
+{
+  "name": "workbox-routing",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "A service worker helper library to route request URLs to handlers.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "router",
+    "routing"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.routing",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-routing/registerRoute.d.ts b/tools/ui/node_modules/workbox-routing/registerRoute.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fafe5e9dce9300a17ca01ea8a39c3de378e964e9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/registerRoute.d.ts
@@ -0,0 +1,24 @@
+import { RouteHandler, RouteMatchCallback } from 'workbox-core/types.js';
+import { Route } from './Route.js';
+import { HTTPMethod } from './utils/constants.js';
+import './_version.js';
+/**
+ * Easily register a RegExp, string, or function with a caching
+ * strategy to a singleton Router instance.
+ *
+ * This method will generate a Route for you if needed and
+ * call {@link workbox-routing.Router#registerRoute}.
+ *
+ * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture
+ * If the capture param is a `Route`, all other arguments will be ignored.
+ * @param {workbox-routing~handlerCallback} [handler] A callback
+ * function that returns a Promise resulting in a Response. This parameter
+ * is required if `capture` is not a `Route` object.
+ * @param {string} [method='GET'] The HTTP method to match the Route
+ * against.
+ * @return {workbox-routing.Route} The generated `Route`.
+ *
+ * @memberof workbox-routing
+ */
+declare function registerRoute(capture: RegExp | string | RouteMatchCallback | Route, handler?: RouteHandler, method?: HTTPMethod): Route;
+export { registerRoute };
diff --git a/tools/ui/node_modules/workbox-routing/registerRoute.js b/tools/ui/node_modules/workbox-routing/registerRoute.js
new file mode 100644
index 0000000000000000000000000000000000000000..a766897ffd67380fa7ae8e581bec5d97901705a3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/registerRoute.js
@@ -0,0 +1,93 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { Route } from './Route.js';
+import { RegExpRoute } from './RegExpRoute.js';
+import { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';
+import './_version.js';
+/**
+ * Easily register a RegExp, string, or function with a caching
+ * strategy to a singleton Router instance.
+ *
+ * This method will generate a Route for you if needed and
+ * call {@link workbox-routing.Router#registerRoute}.
+ *
+ * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture
+ * If the capture param is a `Route`, all other arguments will be ignored.
+ * @param {workbox-routing~handlerCallback} [handler] A callback
+ * function that returns a Promise resulting in a Response. This parameter
+ * is required if `capture` is not a `Route` object.
+ * @param {string} [method='GET'] The HTTP method to match the Route
+ * against.
+ * @return {workbox-routing.Route} The generated `Route`.
+ *
+ * @memberof workbox-routing
+ */
+function registerRoute(capture, handler, method) {
+    let route;
+    if (typeof capture === 'string') {
+        const captureUrl = new URL(capture, location.href);
+        if (process.env.NODE_ENV !== 'production') {
+            if (!(capture.startsWith('/') || capture.startsWith('http'))) {
+                throw new WorkboxError('invalid-string', {
+                    moduleName: 'workbox-routing',
+                    funcName: 'registerRoute',
+                    paramName: 'capture',
+                });
+            }
+            // We want to check if Express-style wildcards are in the pathname only.
+            // TODO: Remove this log message in v4.
+            const valueToCheck = capture.startsWith('http')
+                ? captureUrl.pathname
+                : capture;
+            // See https://github.com/pillarjs/path-to-regexp#parameters
+            const wildcards = '[*:?+]';
+            if (new RegExp(`${wildcards}`).exec(valueToCheck)) {
+                logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +
+                    `character (${wildcards}). Strings are now always interpreted as ` +
+                    `exact matches; use a RegExp for partial or wildcard matches.`);
+            }
+        }
+        const matchCallback = ({ url }) => {
+            if (process.env.NODE_ENV !== 'production') {
+                if (url.pathname === captureUrl.pathname &&
+                    url.origin !== captureUrl.origin) {
+                    logger.debug(`${capture} only partially matches the cross-origin URL ` +
+                        `${url.toString()}. This route will only handle cross-origin requests ` +
+                        `if they match the entire URL.`);
+                }
+            }
+            return url.href === captureUrl.href;
+        };
+        // If `capture` is a string then `handler` and `method` must be present.
+        route = new Route(matchCallback, handler, method);
+    }
+    else if (capture instanceof RegExp) {
+        // If `capture` is a `RegExp` then `handler` and `method` must be present.
+        route = new RegExpRoute(capture, handler, method);
+    }
+    else if (typeof capture === 'function') {
+        // If `capture` is a function then `handler` and `method` must be present.
+        route = new Route(capture, handler, method);
+    }
+    else if (capture instanceof Route) {
+        route = capture;
+    }
+    else {
+        throw new WorkboxError('unsupported-route-type', {
+            moduleName: 'workbox-routing',
+            funcName: 'registerRoute',
+            paramName: 'capture',
+        });
+    }
+    const defaultRouter = getOrCreateDefaultRouter();
+    defaultRouter.registerRoute(route);
+    return route;
+}
+export { registerRoute };
diff --git a/tools/ui/node_modules/workbox-routing/registerRoute.mjs b/tools/ui/node_modules/workbox-routing/registerRoute.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..fab0aff9ea8e378bba91efff1134af604c567366
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/registerRoute.mjs
@@ -0,0 +1 @@
+export * from './registerRoute.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/setCatchHandler.d.ts b/tools/ui/node_modules/workbox-routing/setCatchHandler.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..42d4a858b6141235487c9bbe9c4af55bd4a9bb18
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setCatchHandler.d.ts
@@ -0,0 +1,13 @@
+import { RouteHandler } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * If a Route throws an error while handling a request, this `handler`
+ * will be called and given a chance to provide a response.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+declare function setCatchHandler(handler: RouteHandler): void;
+export { setCatchHandler };
diff --git a/tools/ui/node_modules/workbox-routing/setCatchHandler.js b/tools/ui/node_modules/workbox-routing/setCatchHandler.js
new file mode 100644
index 0000000000000000000000000000000000000000..b39aeb16b21c8a58120a8ec40e1f0e31ecdbc988
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setCatchHandler.js
@@ -0,0 +1,23 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';
+import './_version.js';
+/**
+ * If a Route throws an error while handling a request, this `handler`
+ * will be called and given a chance to provide a response.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+function setCatchHandler(handler) {
+    const defaultRouter = getOrCreateDefaultRouter();
+    defaultRouter.setCatchHandler(handler);
+}
+export { setCatchHandler };
diff --git a/tools/ui/node_modules/workbox-routing/setCatchHandler.mjs b/tools/ui/node_modules/workbox-routing/setCatchHandler.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..37013b093b6a57d801a5d56f1d2a6751ded56aed
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setCatchHandler.mjs
@@ -0,0 +1 @@
+export * from './setCatchHandler.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/setDefaultHandler.d.ts b/tools/ui/node_modules/workbox-routing/setDefaultHandler.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..35811336308ff60aa975d4b98fb0e17dbb3e5aa6
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setDefaultHandler.d.ts
@@ -0,0 +1,16 @@
+import { RouteHandler } from 'workbox-core/types.js';
+import './_version.js';
+/**
+ * Define a default `handler` that's called when no routes explicitly
+ * match the incoming request.
+ *
+ * Without a default handler, unmatched requests will go against the
+ * network as if there were no service worker present.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+declare function setDefaultHandler(handler: RouteHandler): void;
+export { setDefaultHandler };
diff --git a/tools/ui/node_modules/workbox-routing/setDefaultHandler.js b/tools/ui/node_modules/workbox-routing/setDefaultHandler.js
new file mode 100644
index 0000000000000000000000000000000000000000..5f2892abca8ea8662d8b934d393c1e5f7ec553e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setDefaultHandler.js
@@ -0,0 +1,26 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';
+import './_version.js';
+/**
+ * Define a default `handler` that's called when no routes explicitly
+ * match the incoming request.
+ *
+ * Without a default handler, unmatched requests will go against the
+ * network as if there were no service worker present.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+function setDefaultHandler(handler) {
+    const defaultRouter = getOrCreateDefaultRouter();
+    defaultRouter.setDefaultHandler(handler);
+}
+export { setDefaultHandler };
diff --git a/tools/ui/node_modules/workbox-routing/setDefaultHandler.mjs b/tools/ui/node_modules/workbox-routing/setDefaultHandler.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..17e2fee413bdafea4d25a443d09bc1f61c46f65e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/setDefaultHandler.mjs
@@ -0,0 +1 @@
+export * from './setDefaultHandler.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/src/NavigationRoute.ts b/tools/ui/node_modules/workbox-routing/src/NavigationRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7c878cd7f4a38793fa99156258c66cd4249ed46d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/NavigationRoute.ts
@@ -0,0 +1,143 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {RouteHandler, RouteMatchCallbackOptions} from 'workbox-core/types.js';
+
+import {Route} from './Route.js';
+
+import './_version.js';
+
+export interface NavigationRouteMatchOptions {
+  allowlist?: RegExp[];
+  denylist?: RegExp[];
+}
+
+/**
+ * NavigationRoute makes it easy to create a
+ * {@link workbox-routing.Route} that matches for browser
+ * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
+ *
+ * It will only match incoming Requests whose
+ * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode}
+ * is set to `navigate`.
+ *
+ * You can optionally only apply this route to a subset of navigation requests
+ * by using one or both of the `denylist` and `allowlist` parameters.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+class NavigationRoute extends Route {
+  private readonly _allowlist: RegExp[];
+  private readonly _denylist: RegExp[];
+
+  /**
+   * If both `denylist` and `allowlist` are provided, the `denylist` will
+   * take precedence and the request will not match this route.
+   *
+   * The regular expressions in `allowlist` and `denylist`
+   * are matched against the concatenated
+   * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
+   * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
+   * portions of the requested URL.
+   *
+   * *Note*: These RegExps may be evaluated against every destination URL during
+   * a navigation. Avoid using
+   * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
+   * or else your users may see delays when navigating your site.
+   *
+   * @param {workbox-routing~handlerCallback} handler A callback
+   * function that returns a Promise resulting in a Response.
+   * @param {Object} options
+   * @param {Array} [options.denylist] If any of these patterns match,
+   * the route will not handle the request (even if a allowlist RegExp matches).
+   * @param {Array} [options.allowlist=[/./]] If any of these patterns
+   * match the URL's pathname and search parameter, the route will handle the
+   * request (assuming the denylist doesn't match).
+   */
+  constructor(
+    handler: RouteHandler,
+    {allowlist = [/./], denylist = []}: NavigationRouteMatchOptions = {},
+  ) {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isArrayOfClass(allowlist, RegExp, {
+        moduleName: 'workbox-routing',
+        className: 'NavigationRoute',
+        funcName: 'constructor',
+        paramName: 'options.allowlist',
+      });
+      assert!.isArrayOfClass(denylist, RegExp, {
+        moduleName: 'workbox-routing',
+        className: 'NavigationRoute',
+        funcName: 'constructor',
+        paramName: 'options.denylist',
+      });
+    }
+
+    super(
+      (options: RouteMatchCallbackOptions) => this._match(options),
+      handler,
+    );
+
+    this._allowlist = allowlist;
+    this._denylist = denylist;
+  }
+
+  /**
+   * Routes match handler.
+   *
+   * @param {Object} options
+   * @param {URL} options.url
+   * @param {Request} options.request
+   * @return {boolean}
+   *
+   * @private
+   */
+  private _match({url, request}: RouteMatchCallbackOptions): boolean {
+    if (request && request.mode !== 'navigate') {
+      return false;
+    }
+
+    const pathnameAndSearch = url.pathname + url.search;
+
+    for (const regExp of this._denylist) {
+      if (regExp.test(pathnameAndSearch)) {
+        if (process.env.NODE_ENV !== 'production') {
+          logger.log(
+            `The navigation route ${pathnameAndSearch} is not ` +
+              `being used, since the URL matches this denylist pattern: ` +
+              `${regExp.toString()}`,
+          );
+        }
+        return false;
+      }
+    }
+
+    if (this._allowlist.some((regExp) => regExp.test(pathnameAndSearch))) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.debug(
+          `The navigation route ${pathnameAndSearch} ` + `is being used.`,
+        );
+      }
+      return true;
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.log(
+        `The navigation route ${pathnameAndSearch} is not ` +
+          `being used, since the URL being navigated to doesn't ` +
+          `match the allowlist.`,
+      );
+    }
+    return false;
+  }
+}
+
+export {NavigationRoute};
diff --git a/tools/ui/node_modules/workbox-routing/src/RegExpRoute.ts b/tools/ui/node_modules/workbox-routing/src/RegExpRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..42f999cfdce6b20f55ea34338f1fddce20f0eea9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/RegExpRoute.ts
@@ -0,0 +1,92 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {
+  RouteHandler,
+  RouteMatchCallback,
+  RouteMatchCallbackOptions,
+} from 'workbox-core/types.js';
+
+import {HTTPMethod} from './utils/constants.js';
+import {Route} from './Route.js';
+
+import './_version.js';
+
+/**
+ * RegExpRoute makes it easy to create a regular expression based
+ * {@link workbox-routing.Route}.
+ *
+ * For same-origin requests the RegExp only needs to match part of the URL. For
+ * requests against third-party servers, you must define a RegExp that matches
+ * the start of the URL.
+ *
+ * @memberof workbox-routing
+ * @extends workbox-routing.Route
+ */
+class RegExpRoute extends Route {
+  /**
+   * If the regular expression contains
+   * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},
+   * the captured values will be passed to the
+   * {@link workbox-routing~handlerCallback} `params`
+   * argument.
+   *
+   * @param {RegExp} regExp The regular expression to match against URLs.
+   * @param {workbox-routing~handlerCallback} handler A callback
+   * function that returns a Promise resulting in a Response.
+   * @param {string} [method='GET'] The HTTP method to match the Route
+   * against.
+   */
+  constructor(regExp: RegExp, handler: RouteHandler, method?: HTTPMethod) {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(regExp, RegExp, {
+        moduleName: 'workbox-routing',
+        className: 'RegExpRoute',
+        funcName: 'constructor',
+        paramName: 'pattern',
+      });
+    }
+
+    const match: RouteMatchCallback = ({url}: RouteMatchCallbackOptions) => {
+      const result = regExp.exec(url.href);
+
+      // Return immediately if there's no match.
+      if (!result) {
+        return;
+      }
+
+      // Require that the match start at the first character in the URL string
+      // if it's a cross-origin request.
+      // See https://github.com/GoogleChrome/workbox/issues/281 for the context
+      // behind this behavior.
+      if (url.origin !== location.origin && result.index !== 0) {
+        if (process.env.NODE_ENV !== 'production') {
+          logger.debug(
+            `The regular expression '${regExp.toString()}' only partially matched ` +
+              `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +
+              `handle cross-origin requests if they match the entire URL.`,
+          );
+        }
+
+        return;
+      }
+
+      // If the route matches, but there aren't any capture groups defined, then
+      // this will return [], which is truthy and therefore sufficient to
+      // indicate a match.
+      // If there are capture groups, then it will return their values.
+      return result.slice(1);
+    };
+
+    super(match, handler, method);
+  }
+}
+
+export {RegExpRoute};
diff --git a/tools/ui/node_modules/workbox-routing/src/Route.ts b/tools/ui/node_modules/workbox-routing/src/Route.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5af836d151b8d5a2f2bc0255ee034e4520a6e8e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/Route.ts
@@ -0,0 +1,80 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {HTTPMethod, defaultMethod, validMethods} from './utils/constants.js';
+import {normalizeHandler} from './utils/normalizeHandler.js';
+import {
+  RouteHandler,
+  RouteHandlerObject,
+  RouteMatchCallback,
+} from 'workbox-core/types.js';
+import './_version.js';
+
+/**
+ * A `Route` consists of a pair of callback functions, "match" and "handler".
+ * The "match" callback determine if a route should be used to "handle" a
+ * request by returning a non-falsy value if it can. The "handler" callback
+ * is called when there is a match and should return a Promise that resolves
+ * to a `Response`.
+ *
+ * @memberof workbox-routing
+ */
+class Route {
+  handler: RouteHandlerObject;
+  match: RouteMatchCallback;
+  method: HTTPMethod;
+  catchHandler?: RouteHandlerObject;
+
+  /**
+   * Constructor for Route class.
+   *
+   * @param {workbox-routing~matchCallback} match
+   * A callback function that determines whether the route matches a given
+   * `fetch` event by returning a non-falsy value.
+   * @param {workbox-routing~handlerCallback} handler A callback
+   * function that returns a Promise resolving to a Response.
+   * @param {string} [method='GET'] The HTTP method to match the Route
+   * against.
+   */
+  constructor(
+    match: RouteMatchCallback,
+    handler: RouteHandler,
+    method: HTTPMethod = defaultMethod,
+  ) {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(match, 'function', {
+        moduleName: 'workbox-routing',
+        className: 'Route',
+        funcName: 'constructor',
+        paramName: 'match',
+      });
+
+      if (method) {
+        assert!.isOneOf(method, validMethods, {paramName: 'method'});
+      }
+    }
+
+    // These values are referenced directly by Router so cannot be
+    // altered by minificaton.
+    this.handler = normalizeHandler(handler);
+    this.match = match;
+    this.method = method;
+  }
+
+  /**
+   *
+   * @param {workbox-routing-handlerCallback} handler A callback
+   * function that returns a Promise resolving to a Response
+   */
+  setCatchHandler(handler: RouteHandler): void {
+    this.catchHandler = normalizeHandler(handler);
+  }
+}
+
+export {Route};
diff --git a/tools/ui/node_modules/workbox-routing/src/Router.ts b/tools/ui/node_modules/workbox-routing/src/Router.ts
new file mode 100644
index 0000000000000000000000000000000000000000..316f301590be805736b40a53be46d630c525cff2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/Router.ts
@@ -0,0 +1,489 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {
+  RouteHandler,
+  RouteHandlerObject,
+  RouteHandlerCallbackOptions,
+  RouteMatchCallbackOptions,
+} from 'workbox-core/types.js';
+import {HTTPMethod, defaultMethod} from './utils/constants.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {normalizeHandler} from './utils/normalizeHandler.js';
+import {Route} from './Route.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import './_version.js';
+
+type RequestArgs = string | [string, RequestInit?];
+
+interface CacheURLsMessageData {
+  type: string;
+  payload: {
+    urlsToCache: RequestArgs[];
+  };
+}
+
+/**
+ * The Router can be used to process a `FetchEvent` using one or more
+ * {@link workbox-routing.Route}, responding with a `Response` if
+ * a matching route exists.
+ *
+ * If no route matches a given a request, the Router will use a "default"
+ * handler if one is defined.
+ *
+ * Should the matching Route throw an error, the Router will use a "catch"
+ * handler if one is defined to gracefully deal with issues and respond with a
+ * Request.
+ *
+ * If a request matches multiple routes, the **earliest** registered route will
+ * be used to respond to the request.
+ *
+ * @memberof workbox-routing
+ */
+class Router {
+  private readonly _routes: Map;
+  private readonly _defaultHandlerMap: Map;
+  private _catchHandler?: RouteHandlerObject;
+
+  /**
+   * Initializes a new Router.
+   */
+  constructor() {
+    this._routes = new Map();
+    this._defaultHandlerMap = new Map();
+  }
+
+  /**
+   * @return {Map>} routes A `Map` of HTTP
+   * method name ('GET', etc.) to an array of all the corresponding `Route`
+   * instances that are registered.
+   */
+  get routes(): Map {
+    return this._routes;
+  }
+
+  /**
+   * Adds a fetch event listener to respond to events when a route matches
+   * the event's request.
+   */
+  addFetchListener(): void {
+    // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+    self.addEventListener('fetch', ((event: FetchEvent) => {
+      const {request} = event;
+      const responsePromise = this.handleRequest({request, event});
+      if (responsePromise) {
+        event.respondWith(responsePromise);
+      }
+    }) as EventListener);
+  }
+
+  /**
+   * Adds a message event listener for URLs to cache from the window.
+   * This is useful to cache resources loaded on the page prior to when the
+   * service worker started controlling it.
+   *
+   * The format of the message data sent from the window should be as follows.
+   * Where the `urlsToCache` array may consist of URL strings or an array of
+   * URL string + `requestInit` object (the same as you'd pass to `fetch()`).
+   *
+   * ```
+   * {
+   *   type: 'CACHE_URLS',
+   *   payload: {
+   *     urlsToCache: [
+   *       './script1.js',
+   *       './script2.js',
+   *       ['./script3.js', {mode: 'no-cors'}],
+   *     ],
+   *   },
+   * }
+   * ```
+   */
+  addCacheListener(): void {
+    // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
+    self.addEventListener('message', ((event: ExtendableMessageEvent) => {
+      // event.data is type 'any'
+      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+      if (event.data && event.data.type === 'CACHE_URLS') {
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+        const {payload}: CacheURLsMessageData = event.data;
+
+        if (process.env.NODE_ENV !== 'production') {
+          logger.debug(`Caching URLs from the window`, payload.urlsToCache);
+        }
+
+        const requestPromises = Promise.all(
+          payload.urlsToCache.map((entry: string | [string, RequestInit?]) => {
+            if (typeof entry === 'string') {
+              entry = [entry];
+            }
+
+            const request = new Request(...entry);
+            return this.handleRequest({request, event});
+
+            // TODO(philipwalton): TypeScript errors without this typecast for
+            // some reason (probably a bug). The real type here should work but
+            // doesn't: `Array | undefined>`.
+          }) as any[],
+        ); // TypeScript
+
+        event.waitUntil(requestPromises);
+
+        // If a MessageChannel was used, reply to the message on success.
+        if (event.ports && event.ports[0]) {
+          void requestPromises.then(() => event.ports[0].postMessage(true));
+        }
+      }
+    }) as EventListener);
+  }
+
+  /**
+   * Apply the routing rules to a FetchEvent object to get a Response from an
+   * appropriate Route's handler.
+   *
+   * @param {Object} options
+   * @param {Request} options.request The request to handle.
+   * @param {ExtendableEvent} options.event The event that triggered the
+   *     request.
+   * @return {Promise|undefined} A promise is returned if a
+   *     registered route can handle the request. If there is no matching
+   *     route and there's no `defaultHandler`, `undefined` is returned.
+   */
+  handleRequest({
+    request,
+    event,
+  }: {
+    request: Request;
+    event: ExtendableEvent;
+  }): Promise | undefined {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'handleRequest',
+        paramName: 'options.request',
+      });
+    }
+
+    const url = new URL(request.url, location.href);
+    if (!url.protocol.startsWith('http')) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.debug(
+          `Workbox Router only supports URLs that start with 'http'.`,
+        );
+      }
+      return;
+    }
+
+    const sameOrigin = url.origin === location.origin;
+    const {params, route} = this.findMatchingRoute({
+      event,
+      request,
+      sameOrigin,
+      url,
+    });
+    let handler = route && route.handler;
+
+    const debugMessages = [];
+    if (process.env.NODE_ENV !== 'production') {
+      if (handler) {
+        debugMessages.push([`Found a route to handle this request:`, route]);
+
+        if (params) {
+          debugMessages.push([
+            `Passing the following params to the route's handler:`,
+            params,
+          ]);
+        }
+      }
+    }
+
+    // If we don't have a handler because there was no matching route, then
+    // fall back to defaultHandler if that's defined.
+    const method = request.method as HTTPMethod;
+    if (!handler && this._defaultHandlerMap.has(method)) {
+      if (process.env.NODE_ENV !== 'production') {
+        debugMessages.push(
+          `Failed to find a matching route. Falling ` +
+            `back to the default handler for ${method}.`,
+        );
+      }
+      handler = this._defaultHandlerMap.get(method);
+    }
+
+    if (!handler) {
+      if (process.env.NODE_ENV !== 'production') {
+        // No handler so Workbox will do nothing. If logs is set of debug
+        // i.e. verbose, we should print out this information.
+        logger.debug(`No route found for: ${getFriendlyURL(url)}`);
+      }
+      return;
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      // We have a handler, meaning Workbox is going to handle the route.
+      // print the routing details to the console.
+      logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);
+
+      debugMessages.forEach((msg) => {
+        if (Array.isArray(msg)) {
+          logger.log(...msg);
+        } else {
+          logger.log(msg);
+        }
+      });
+
+      logger.groupEnd();
+    }
+
+    // Wrap in try and catch in case the handle method throws a synchronous
+    // error. It should still callback to the catch handler.
+    let responsePromise;
+    try {
+      responsePromise = handler.handle({url, request, event, params});
+    } catch (err) {
+      responsePromise = Promise.reject(err);
+    }
+
+    // Get route's catch handler, if it exists
+    const catchHandler = route && route.catchHandler;
+
+    if (
+      responsePromise instanceof Promise &&
+      (this._catchHandler || catchHandler)
+    ) {
+      responsePromise = responsePromise.catch(async (err) => {
+        // If there's a route catch handler, process that first
+        if (catchHandler) {
+          if (process.env.NODE_ENV !== 'production') {
+            // Still include URL here as it will be async from the console group
+            // and may not make sense without the URL
+            logger.groupCollapsed(
+              `Error thrown when responding to: ` +
+                ` ${getFriendlyURL(
+                  url,
+                )}. Falling back to route's Catch Handler.`,
+            );
+            logger.error(`Error thrown by:`, route);
+            logger.error(err);
+            logger.groupEnd();
+          }
+
+          try {
+            return await catchHandler.handle({url, request, event, params});
+          } catch (catchErr) {
+            if (catchErr instanceof Error) {
+              err = catchErr;
+            }
+          }
+        }
+
+        if (this._catchHandler) {
+          if (process.env.NODE_ENV !== 'production') {
+            // Still include URL here as it will be async from the console group
+            // and may not make sense without the URL
+            logger.groupCollapsed(
+              `Error thrown when responding to: ` +
+                ` ${getFriendlyURL(
+                  url,
+                )}. Falling back to global Catch Handler.`,
+            );
+            logger.error(`Error thrown by:`, route);
+            logger.error(err);
+            logger.groupEnd();
+          }
+          return this._catchHandler.handle({url, request, event});
+        }
+
+        throw err;
+      });
+    }
+
+    return responsePromise;
+  }
+
+  /**
+   * Checks a request and URL (and optionally an event) against the list of
+   * registered routes, and if there's a match, returns the corresponding
+   * route along with any params generated by the match.
+   *
+   * @param {Object} options
+   * @param {URL} options.url
+   * @param {boolean} options.sameOrigin The result of comparing `url.origin`
+   *     against the current origin.
+   * @param {Request} options.request The request to match.
+   * @param {Event} options.event The corresponding event.
+   * @return {Object} An object with `route` and `params` properties.
+   *     They are populated if a matching route was found or `undefined`
+   *     otherwise.
+   */
+  findMatchingRoute({
+    url,
+    sameOrigin,
+    request,
+    event,
+  }: RouteMatchCallbackOptions): {
+    route?: Route;
+    params?: RouteHandlerCallbackOptions['params'];
+  } {
+    const routes = this._routes.get(request.method as HTTPMethod) || [];
+    for (const route of routes) {
+      let params: Promise | undefined;
+      // route.match returns type any, not possible to change right now.
+      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+      const matchResult = route.match({url, sameOrigin, request, event});
+      if (matchResult) {
+        if (process.env.NODE_ENV !== 'production') {
+          // Warn developers that using an async matchCallback is almost always
+          // not the right thing to do.
+          if (matchResult instanceof Promise) {
+            logger.warn(
+              `While routing ${getFriendlyURL(url)}, an async ` +
+                `matchCallback function was used. Please convert the ` +
+                `following route to use a synchronous matchCallback function:`,
+              route,
+            );
+          }
+        }
+
+        // See https://github.com/GoogleChrome/workbox/issues/2079
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+        params = matchResult;
+        if (Array.isArray(params) && params.length === 0) {
+          // Instead of passing an empty array in as params, use undefined.
+          params = undefined;
+        } else if (
+          matchResult.constructor === Object && // eslint-disable-line
+          Object.keys(matchResult).length === 0
+        ) {
+          // Instead of passing an empty object in as params, use undefined.
+          params = undefined;
+        } else if (typeof matchResult === 'boolean') {
+          // For the boolean value true (rather than just something truth-y),
+          // don't set params.
+          // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353
+          params = undefined;
+        }
+
+        // Return early if have a match.
+        return {route, params};
+      }
+    }
+    // If no match was found above, return and empty object.
+    return {};
+  }
+
+  /**
+   * Define a default `handler` that's called when no routes explicitly
+   * match the incoming request.
+   *
+   * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.
+   *
+   * Without a default handler, unmatched requests will go against the
+   * network as if there were no service worker present.
+   *
+   * @param {workbox-routing~handlerCallback} handler A callback
+   * function that returns a Promise resulting in a Response.
+   * @param {string} [method='GET'] The HTTP method to associate with this
+   * default handler. Each method has its own default.
+   */
+  setDefaultHandler(
+    handler: RouteHandler,
+    method: HTTPMethod = defaultMethod,
+  ): void {
+    this._defaultHandlerMap.set(method, normalizeHandler(handler));
+  }
+
+  /**
+   * If a Route throws an error while handling a request, this `handler`
+   * will be called and given a chance to provide a response.
+   *
+   * @param {workbox-routing~handlerCallback} handler A callback
+   * function that returns a Promise resulting in a Response.
+   */
+  setCatchHandler(handler: RouteHandler): void {
+    this._catchHandler = normalizeHandler(handler);
+  }
+
+  /**
+   * Registers a route with the router.
+   *
+   * @param {workbox-routing.Route} route The route to register.
+   */
+  registerRoute(route: Route): void {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(route, 'object', {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'registerRoute',
+        paramName: 'route',
+      });
+
+      assert!.hasMethod(route, 'match', {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'registerRoute',
+        paramName: 'route',
+      });
+
+      assert!.isType(route.handler, 'object', {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'registerRoute',
+        paramName: 'route',
+      });
+
+      assert!.hasMethod(route.handler, 'handle', {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'registerRoute',
+        paramName: 'route.handler',
+      });
+
+      assert!.isType(route.method, 'string', {
+        moduleName: 'workbox-routing',
+        className: 'Router',
+        funcName: 'registerRoute',
+        paramName: 'route.method',
+      });
+    }
+
+    if (!this._routes.has(route.method)) {
+      this._routes.set(route.method, []);
+    }
+
+    // Give precedence to all of the earlier routes by adding this additional
+    // route to the end of the array.
+    this._routes.get(route.method)!.push(route);
+  }
+
+  /**
+   * Unregisters a route with the router.
+   *
+   * @param {workbox-routing.Route} route The route to unregister.
+   */
+  unregisterRoute(route: Route): void {
+    if (!this._routes.has(route.method)) {
+      throw new WorkboxError('unregister-route-but-not-found-with-method', {
+        method: route.method,
+      });
+    }
+
+    const routeIndex = this._routes.get(route.method)!.indexOf(route);
+    if (routeIndex > -1) {
+      this._routes.get(route.method)!.splice(routeIndex, 1);
+    } else {
+      throw new WorkboxError('unregister-route-route-not-registered');
+    }
+  }
+}
+
+export {Router};
diff --git a/tools/ui/node_modules/workbox-routing/src/_types.ts b/tools/ui/node_modules/workbox-routing/src/_types.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d798e93b5d4dff570ec8d51f4edb9fb0a6a22066
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/_types.ts
@@ -0,0 +1,66 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import './_version.js';
+
+// * * * IMPORTANT! * * *
+// ------------------------------------------------------------------------- //
+// jdsoc type definitions cannot be declared above TypeScript definitions or
+// they'll be stripped from the built `.js` files, and they'll only be in the
+// `d.ts` files, which aren't read by the jsdoc generator. As a result we
+// have to put declare them below.
+
+/**
+ * The "match" callback is used to determine if a `Route` should apply for a
+ * particular URL. When matching occurs in response to a fetch event from the
+ * client, the `event` object is supplied in addition to the `url`, `request`,
+ * and `sameOrigin` value. However, since the match callback can be invoked
+ * outside of a fetch event, matching logic should not assume the `event`
+ * object will always be available.
+ *
+ * If the match callback returns a truthy value, the matching route's
+ * {@link workbox-routing~handlerCallback} will be
+ * invoked immediately. If the value returned is a non-empty array or object,
+ * that value will be set on the handler's `context.params` argument.
+ *
+ * @callback ~matchCallback
+ * @param {Object} context
+ * @param {Request} context.request The corresponding request.
+ * @param {URL} context.url The request's URL.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {boolean} context.sameOrigin The result of comparing `url.origin`
+ *     against the current origin.
+ * @return {*} To signify a match, return a truthy value.
+ *
+ * @memberof workbox-routing
+ */
+
+/**
+ * The "handler" callback is invoked whenever a `Router` matches a URL to a
+ * `Route` via its {@link workbox-routing~matchCallback}
+ * callback. This callback should return a Promise that resolves with a
+ * `Response`.
+ *
+ * If a non-empty array or object is returned by the
+ * {@link workbox-routing~matchCallback} it
+ * will be passed in as the handler's `context.params` argument.
+ *
+ * @callback ~handlerCallback
+ * @param {Object} context
+ * @param {Request|string} context.request The corresponding request.
+ * @param {URL} context.url The URL that matched, if available.
+ * @param {ExtendableEvent} context.event The corresponding event that triggered
+ *     the request.
+ * @param {Object} [context.params] Array or Object parameters returned by the
+ *     Route's {@link workbox-routing~matchCallback}.
+ *     This will be undefined if an empty array or object were returned.
+ * @return {Promise} The response that will fulfill the request.
+ *
+ * @memberof workbox-routing
+ */
diff --git a/tools/ui/node_modules/workbox-routing/src/_version.ts b/tools/ui/node_modules/workbox-routing/src/_version.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3f011a04a9d2bea072b85c5c6472bb9c00d828eb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/_version.ts
@@ -0,0 +1,2 @@
+// @ts-ignore
+try{self['workbox:routing:7.4.1']&&_()}catch(e){}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/src/index.ts b/tools/ui/node_modules/workbox-routing/src/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e38e29c5fdb7d7831253b6b7211905c3258da508
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/index.ts
@@ -0,0 +1,35 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {
+  NavigationRoute,
+  NavigationRouteMatchOptions,
+} from './NavigationRoute.js';
+import {RegExpRoute} from './RegExpRoute.js';
+import {registerRoute} from './registerRoute.js';
+import {Route} from './Route.js';
+import {Router} from './Router.js';
+import {setCatchHandler} from './setCatchHandler.js';
+import {setDefaultHandler} from './setDefaultHandler.js';
+
+import './_version.js';
+
+/**
+ * @module workbox-routing
+ */
+
+export {
+  NavigationRoute,
+  RegExpRoute,
+  registerRoute,
+  Route,
+  Router,
+  setCatchHandler,
+  setDefaultHandler,
+  NavigationRouteMatchOptions,
+};
diff --git a/tools/ui/node_modules/workbox-routing/src/registerRoute.ts b/tools/ui/node_modules/workbox-routing/src/registerRoute.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54e59844f6250915fa1aa042794d0cc041274029
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/registerRoute.ts
@@ -0,0 +1,115 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {RouteHandler, RouteMatchCallback} from 'workbox-core/types.js';
+
+import {Route} from './Route.js';
+import {RegExpRoute} from './RegExpRoute.js';
+import {HTTPMethod} from './utils/constants.js';
+import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
+
+import './_version.js';
+
+/**
+ * Easily register a RegExp, string, or function with a caching
+ * strategy to a singleton Router instance.
+ *
+ * This method will generate a Route for you if needed and
+ * call {@link workbox-routing.Router#registerRoute}.
+ *
+ * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture
+ * If the capture param is a `Route`, all other arguments will be ignored.
+ * @param {workbox-routing~handlerCallback} [handler] A callback
+ * function that returns a Promise resulting in a Response. This parameter
+ * is required if `capture` is not a `Route` object.
+ * @param {string} [method='GET'] The HTTP method to match the Route
+ * against.
+ * @return {workbox-routing.Route} The generated `Route`.
+ *
+ * @memberof workbox-routing
+ */
+function registerRoute(
+  capture: RegExp | string | RouteMatchCallback | Route,
+  handler?: RouteHandler,
+  method?: HTTPMethod,
+): Route {
+  let route;
+
+  if (typeof capture === 'string') {
+    const captureUrl = new URL(capture, location.href);
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (!(capture.startsWith('/') || capture.startsWith('http'))) {
+        throw new WorkboxError('invalid-string', {
+          moduleName: 'workbox-routing',
+          funcName: 'registerRoute',
+          paramName: 'capture',
+        });
+      }
+
+      // We want to check if Express-style wildcards are in the pathname only.
+      // TODO: Remove this log message in v4.
+      const valueToCheck = capture.startsWith('http')
+        ? captureUrl.pathname
+        : capture;
+
+      // See https://github.com/pillarjs/path-to-regexp#parameters
+      const wildcards = '[*:?+]';
+      if (new RegExp(`${wildcards}`).exec(valueToCheck)) {
+        logger.debug(
+          `The '$capture' parameter contains an Express-style wildcard ` +
+            `character (${wildcards}). Strings are now always interpreted as ` +
+            `exact matches; use a RegExp for partial or wildcard matches.`,
+        );
+      }
+    }
+
+    const matchCallback: RouteMatchCallback = ({url}) => {
+      if (process.env.NODE_ENV !== 'production') {
+        if (
+          url.pathname === captureUrl.pathname &&
+          url.origin !== captureUrl.origin
+        ) {
+          logger.debug(
+            `${capture} only partially matches the cross-origin URL ` +
+              `${url.toString()}. This route will only handle cross-origin requests ` +
+              `if they match the entire URL.`,
+          );
+        }
+      }
+
+      return url.href === captureUrl.href;
+    };
+
+    // If `capture` is a string then `handler` and `method` must be present.
+    route = new Route(matchCallback, handler!, method);
+  } else if (capture instanceof RegExp) {
+    // If `capture` is a `RegExp` then `handler` and `method` must be present.
+    route = new RegExpRoute(capture, handler!, method);
+  } else if (typeof capture === 'function') {
+    // If `capture` is a function then `handler` and `method` must be present.
+    route = new Route(capture, handler!, method);
+  } else if (capture instanceof Route) {
+    route = capture;
+  } else {
+    throw new WorkboxError('unsupported-route-type', {
+      moduleName: 'workbox-routing',
+      funcName: 'registerRoute',
+      paramName: 'capture',
+    });
+  }
+
+  const defaultRouter = getOrCreateDefaultRouter();
+  defaultRouter.registerRoute(route);
+
+  return route;
+}
+
+export {registerRoute};
diff --git a/tools/ui/node_modules/workbox-routing/src/setCatchHandler.ts b/tools/ui/node_modules/workbox-routing/src/setCatchHandler.ts
new file mode 100644
index 0000000000000000000000000000000000000000..375fe18c5ade382986119e9cdf6530b188b6532f
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/setCatchHandler.ts
@@ -0,0 +1,29 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {RouteHandler} from 'workbox-core/types.js';
+
+import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
+
+import './_version.js';
+
+/**
+ * If a Route throws an error while handling a request, this `handler`
+ * will be called and given a chance to provide a response.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+function setCatchHandler(handler: RouteHandler): void {
+  const defaultRouter = getOrCreateDefaultRouter();
+  defaultRouter.setCatchHandler(handler);
+}
+
+export {setCatchHandler};
diff --git a/tools/ui/node_modules/workbox-routing/src/setDefaultHandler.ts b/tools/ui/node_modules/workbox-routing/src/setDefaultHandler.ts
new file mode 100644
index 0000000000000000000000000000000000000000..121941a2c9f85a4cd3905bbb7d7bc7a0199f64df
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/setDefaultHandler.ts
@@ -0,0 +1,32 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {RouteHandler} from 'workbox-core/types.js';
+
+import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
+
+import './_version.js';
+
+/**
+ * Define a default `handler` that's called when no routes explicitly
+ * match the incoming request.
+ *
+ * Without a default handler, unmatched requests will go against the
+ * network as if there were no service worker present.
+ *
+ * @param {workbox-routing~handlerCallback} handler A callback
+ * function that returns a Promise resulting in a Response.
+ *
+ * @memberof workbox-routing
+ */
+function setDefaultHandler(handler: RouteHandler): void {
+  const defaultRouter = getOrCreateDefaultRouter();
+  defaultRouter.setDefaultHandler(handler);
+}
+
+export {setDefaultHandler};
diff --git a/tools/ui/node_modules/workbox-routing/src/utils/constants.ts b/tools/ui/node_modules/workbox-routing/src/utils/constants.ts
new file mode 100644
index 0000000000000000000000000000000000000000..32b54ca088c2780f50233b8632259a3e52d0056d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/utils/constants.ts
@@ -0,0 +1,37 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import '../_version.js';
+
+export type HTTPMethod = 'DELETE' | 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT';
+
+/**
+ * The default HTTP method, 'GET', used when there's no specific method
+ * configured for a route.
+ *
+ * @type {string}
+ *
+ * @private
+ */
+export const defaultMethod: HTTPMethod = 'GET';
+
+/**
+ * The list of valid HTTP methods associated with requests that could be routed.
+ *
+ * @type {Array}
+ *
+ * @private
+ */
+export const validMethods: HTTPMethod[] = [
+  'DELETE',
+  'GET',
+  'HEAD',
+  'PATCH',
+  'POST',
+  'PUT',
+];
diff --git a/tools/ui/node_modules/workbox-routing/src/utils/getOrCreateDefaultRouter.ts b/tools/ui/node_modules/workbox-routing/src/utils/getOrCreateDefaultRouter.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7d648b7686466a782892199d7aebfffaf4a93584
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/utils/getOrCreateDefaultRouter.ts
@@ -0,0 +1,30 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {Router} from '../Router.js';
+import '../_version.js';
+
+let defaultRouter: Router;
+
+/**
+ * Creates a new, singleton Router instance if one does not exist. If one
+ * does already exist, that instance is returned.
+ *
+ * @private
+ * @return {Router}
+ */
+export const getOrCreateDefaultRouter = (): Router => {
+  if (!defaultRouter) {
+    defaultRouter = new Router();
+
+    // The helpers that use the default Router assume these listeners exist.
+    defaultRouter.addFetchListener();
+    defaultRouter.addCacheListener();
+  }
+  return defaultRouter;
+};
diff --git a/tools/ui/node_modules/workbox-routing/src/utils/normalizeHandler.ts b/tools/ui/node_modules/workbox-routing/src/utils/normalizeHandler.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e62f19f36fe48def99ea73b65920f6a4d07f0f74
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/src/utils/normalizeHandler.ts
@@ -0,0 +1,43 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {RouteHandler, RouteHandlerObject} from 'workbox-core/types.js';
+
+import '../_version.js';
+
+/**
+ * @param {function()|Object} handler Either a function, or an object with a
+ * 'handle' method.
+ * @return {Object} An object with a handle method.
+ *
+ * @private
+ */
+export const normalizeHandler = (handler: RouteHandler): RouteHandlerObject => {
+  if (handler && typeof handler === 'object') {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.hasMethod(handler, 'handle', {
+        moduleName: 'workbox-routing',
+        className: 'Route',
+        funcName: 'constructor',
+        paramName: 'handler',
+      });
+    }
+    return handler;
+  } else {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isType(handler, 'function', {
+        moduleName: 'workbox-routing',
+        className: 'Route',
+        funcName: 'constructor',
+        paramName: 'handler',
+      });
+    }
+    return {handle: handler};
+  }
+};
diff --git a/tools/ui/node_modules/workbox-routing/tsconfig.json b/tools/ui/node_modules/workbox-routing/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..3bb2772b586c4d0ceee3d014e64dba7aafbdd570
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/tsconfig.json
@@ -0,0 +1,11 @@
+{
+  "extends": "../../tsconfig",
+  "compilerOptions": {
+    "composite": true,
+    "outDir": "./",
+    "rootDir": "./src",
+    "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
+  },
+  "include": ["src/**/*.ts"],
+  "references": [{"path": "../workbox-core/"}]
+}
diff --git a/tools/ui/node_modules/workbox-routing/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-routing/tsconfig.tsbuildinfo
new file mode 100644
index 0000000000000000000000000000000000000000..c2e6c008a178e8f8591633f3f93bddd69e53ed83
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/tsconfig.tsbuildinfo
@@ -0,0 +1 @@
+{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../infra/type-overrides.d.ts","../workbox-core/_version.d.ts","../workbox-core/types.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/logger.d.ts","./src/_version.ts","./src/utils/constants.ts","./src/utils/normalizehandler.ts","./src/route.ts","./src/navigationroute.ts","./src/regexproute.ts","../workbox-core/_private/getfriendlyurl.d.ts","../workbox-core/_private/workboxerror.d.ts","./src/router.ts","./src/_types.ts","./src/utils/getorcreatedefaultrouter.ts","./src/registerroute.ts","./src/setcatchhandler.ts","./src/setdefaulthandler.ts","./src/index.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/@types/babel__preset-env/index.d.ts","../../node_modules/@types/common-tags/index.d.ts","../../node_modules/@types/eslint/helpers.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/eslint/index.d.ts","../../node_modules/@types/eslint-scope/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts","../../node_modules/@types/fs-extra/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/html-minifier-terser/index.d.ts","../../node_modules/@types/linkify-it/index.d.ts","../../node_modules/@types/mdurl/encode.d.ts","../../node_modules/@types/mdurl/decode.d.ts","../../node_modules/@types/mdurl/parse.d.ts","../../node_modules/@types/mdurl/format.d.ts","../../node_modules/@types/mdurl/index.d.ts","../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../node_modules/@types/markdown-it/lib/token.d.ts","../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../node_modules/@types/markdown-it/lib/index.d.ts","../../node_modules/@types/markdown-it/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/parse-json/index.d.ts","../../node_modules/@types/resolve/index.d.ts","../../node_modules/@types/semver/classes/semver.d.ts","../../node_modules/@types/semver/functions/parse.d.ts","../../node_modules/@types/semver/functions/valid.d.ts","../../node_modules/@types/semver/functions/clean.d.ts","../../node_modules/@types/semver/functions/inc.d.ts","../../node_modules/@types/semver/functions/diff.d.ts","../../node_modules/@types/semver/functions/major.d.ts","../../node_modules/@types/semver/functions/minor.d.ts","../../node_modules/@types/semver/functions/patch.d.ts","../../node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/@types/semver/functions/compare.d.ts","../../node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/@types/semver/functions/sort.d.ts","../../node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/@types/semver/functions/gt.d.ts","../../node_modules/@types/semver/functions/lt.d.ts","../../node_modules/@types/semver/functions/eq.d.ts","../../node_modules/@types/semver/functions/neq.d.ts","../../node_modules/@types/semver/functions/gte.d.ts","../../node_modules/@types/semver/functions/lte.d.ts","../../node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/@types/semver/classes/range.d.ts","../../node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/@types/semver/index.d.ts","../../node_modules/@types/source-list-map/index.d.ts","../../node_modules/@types/stringify-object/index.d.ts","../../node_modules/@types/tapable/index.d.ts","../../node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts","../../node_modules/@types/uglify-js/index.d.ts","../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../node_modules/@types/webpack-sources/lib/source.d.ts","../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../node_modules/@types/webpack-sources/lib/index.d.ts","../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../node_modules/@types/webpack-sources/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"d3f4771304b6b07e5a2bb992e75af76ac060de78803b1b21f0475ffc5654d817","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"0396119f8b76a074eddc16de8dbc4231a448f2534f4c64c5ab7b71908eb6e646","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","f0ae1ac99c66a4827469b8942101642ae65971e36db438afe67d4985caa31222","7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},{"version":"166afddf15afb56b62cf33d41029094ed50ebdba2e4b71a4fb86e39fdd767150","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"ec76de3ed370eade4747dc36edd6cc26e59f43c5e8667d004c044af540571b84","signature":"8d0f0aa989374cc6c7bc141649a9ca7d76b221a39375c8b98b844c3ad8c9b090"},{"version":"56b208f3f9f14393e8ad694d6a9e05f9b213a0fe6cc7dc2ca98aaedfd0104b70","signature":"ea98f3936264da85d34916155aec205fd5be7372873882554fc170418009138a"},{"version":"5a997ea859486c6615b7bd5d04dcc854c931d086054720af178a1e79a88effb3","signature":"03e238c606e3567428238c11720093a64d3ef151ba465b7bf0ae8cca27540853"},{"version":"6d8dba6c1e260548d640b27f35844cead7f066f5859b92f970887deec85f5a39","signature":"42d9828889337328d7197023ea91eac0bde6a19cdfd7e3996d911c9719f31a38"},{"version":"7f9f5cf9bd8650285b28cf462fabe5e89d40b790dd477d38748823e1105e0f57","signature":"4d71c4d4c34b40b6d0004ed4a0227f0645ab2ab87106924d9cfbcd45064b2de6"},"9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff","0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5",{"version":"01b01e82603f7b39b655a5bab72de1d8ecec514dc3680ecd2c2168223e8d1693","signature":"6b4baa3f95e01c06530945674c51c1b3d954ecb0aaf77c7e0f86838f1f14b5b1"},{"version":"bbf71bc821bbaaed269e183f838595cf6ca88a2dd12e7fe2678dbd1522a21718","signature":"53e1e52411d0eb72cc3d2eef58a326eaeece50863a1394f14cd1ffd7a9297c70"},{"version":"ffbc4dd735e67d8ede668ccf9f7bdefedc413683ee786505fbe2fff1d21f77ee","signature":"3a508a012cb8f83e6c3f964b039406e4bbf417a99642a80fcb6952b7fe1cd8af"},{"version":"98afba23e11beb0f98619c6f1b8d1fc8d0145a11d31bb786aa477b4bc5a748c1","signature":"3c7281c1b6ec0997a6d02f43a1946fbf32eabf25c3404e79d28c5d20c13fd6c6"},{"version":"d1707a5f74c3bfcd12fddc3652f1f4adf4c20f61cd3d62963f5740bd3eec2128","signature":"9725c19646f56a5afd09daa1e45c540b5c889b7eb23ddb8a26afcfb236c0816a"},{"version":"3913446a1713104f8b08fe3ee0679838b4214f488fb9fc4754abbf7bdd71e43e","signature":"de54d431b74517477e94c7dee1d287dec99fe5a42794fef6fa80f7e7eebcaf4e"},{"version":"a17706cb195c0b4f9003eae37e62360dc02cf251e775b82cb2edde9430b83b16","signature":"1e554f384a67975250cd1218d6d22f602c9a27e4ff5d12a9512cf7bc05b6b531"},"c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","d83a458e35dfd3cfe0c94758b0b621a733df35ff6b24db007c2721da6574705d","0aeab9bac83e1f076d9f5487c5c783288fe9be64064ee7de3c81eecee157f506",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","7852500a7dc3f9cb6b73d619f6e0249119211ea662fd5e16c59ee5aba3deeb80","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"20fb08397d22742771868b52f647cddfbf44b263f26b6519b449257f8c9f7364","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true},"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true},"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c",{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true},"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true},"0a37b8d00d03f0381d2db2fe31b0571dc9d7cc0f4b87ca103cc3cd2277690ba0","71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","38bf8ff1b403c861e9052c9ea651cb4f38c1ecc084a34d79f8acc6d6477a7321","93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e",{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true},"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5",{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true},"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true},"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb",{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true},"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9",{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true},"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true},"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","9091e564b81e7b4c382a33c62de704a699e10508190547d4f7c1c3e039d2db2b","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","6503fb6addf62f9b10f8564d9869ad824565a914ec1ac3dd7d13da14a3f57036","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","3816fc03ffd9cbd1a7a3362a264756a4a1d547caabea50ca68303046be40e376","0c417b4ec46b88fb62a43ec00204700b560d01eb5677c7faa8ecd34610f096a8","13d29cdeb64e8496424edf42749bbb47de5e42d201cf958911a4638cbcffbd3f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","2905bf42cddf7ba20c88922d36b7afa5431523c1cab119fdb38bf5baab02adf1","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","9d74c7330800b325bb19cc8c1a153a612c080a60094e1ab6cfb6e39cf1b88c36","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","05d64cc1118031b29786632a9a0f6d7cf1dcacb303f27023a466cf3cdc860538","e0fff9119e1a5d2fdd46345734126cd6cb99c2d98a9debf0257047fe3937cc3f","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","e275297155ec3251200abbb334c7f5641fecc68b2a9573e40eed50dff7584762"],"options":{"composite":true,"declaration":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"rootDir":"./src","strict":true,"target":4,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[80,122],[62,80,122],[62,63,64,65,66,80,122],[62,64,80,122],[71,73,80,122],[70,71,72,80,122],[80,122,135,171],[80,122,134,171,173],[80,122,196],[80,122,181],[80,122,185,186,187],[80,122,184],[80,122,186],[80,122,176,182,183,188,191,193,194,195],[80,122,183,189,190,196],[80,122,189,192],[80,122,183,184,189,196],[80,122,183,196],[80,122,177,178,179,180],[80,119,122],[80,121,122],[80,122,127,156],[80,122,123,128,134,135,142,153,164],[80,122,123,124,134,142],[75,76,77,80,122],[80,122,125,165],[80,122,126,127,135,143],[80,122,127,153,161],[80,122,128,130,134,142],[80,121,122,129],[80,122,130,131],[80,122,134],[80,122,132,134],[80,121,122,134],[80,122,134,135,136,153,164],[80,122,134,135,136,149,153,156],[80,117,122,169],[80,122,130,134,137,142,153,164],[80,122,134,135,137,138,142,153,161,164],[80,122,137,139,153,161,164],[80,122,134,140],[80,122,141,164,169],[80,122,130,134,142,153],[80,122,143],[80,122,144],[80,121,122,145],[80,119,120,121,122,123,124,125,126,127,128,129,130,131,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[80,122,147],[80,122,148],[80,122,134,149,150],[80,122,149,151,165,167],[80,122,134,153,154,156],[80,122,155,156],[80,122,153,154],[80,122,156],[80,122,157],[80,119,122,153],[80,122,134,159,160],[80,122,159,160],[80,122,127,142,153,161],[80,122,162],[122],[78,79,80,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[80,122,142,163],[80,122,137,148,164],[80,122,127,165],[80,122,153,166],[80,122,141,167],[80,122,168],[80,122,127,134,136,145,153,164,167,169],[80,122,153,170],[80,122,202,241],[80,122,202,226,241],[80,122,241],[80,122,202],[80,122,202,227,241],[80,122,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[80,122,227,241],[80,122,245],[80,122,171,248,249,250,251,252,253,254,255,256,257,258],[80,122,247,248,257],[80,122,248,257],[80,122,242,247,248,257],[80,122,247,248,249,250,251,252,253,254,255,256,258],[80,122,248],[80,122,127,247,257],[80,89,93,122,164],[80,89,122,153,164],[80,84,122],[80,86,89,122,161,164],[80,122,142,161],[80,122,171],[80,84,122,171],[80,86,89,122,142,164],[80,81,82,85,88,122,134,153,164],[80,89,96,122],[80,81,87,122],[80,89,110,111,122],[80,85,89,122,156,164,171],[80,110,122,171],[80,83,84,122,171],[80,89,122],[80,83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,122],[80,89,104,122],[80,89,96,97,122],[80,87,89,97,98,122],[80,88,122],[80,81,84,89,122],[80,89,93,97,98,122],[80,93,122],[80,87,89,92,122,164],[80,81,86,89,96,122],[80,122,153],[80,84,89,110,122,169,171],[44,80,122],[50,51,52,55,58,59,60,80,122],[44,45,46,50,80,122],[44,45,46,48,50,80,122],[44,46,48,50,52,54,57,80,122],[44,45,48,49,80,122],[44,45,46,48,49,50,53,54,80,122],[44,57,80,122],[55,80,122],[44,45,80,122],[50,51,52,55,58,59,60],[44,50],[44,48,50],[44,48],[44],[55]],"referencedMap":[[42,1],[64,2],[62,1],[67,3],[63,2],[68,1],[65,4],[66,2],[69,1],[74,5],[70,1],[73,6],[71,1],[172,7],[174,8],[175,1],[72,1],[176,1],[197,9],[182,10],[188,11],[186,1],[185,12],[187,13],[196,14],[191,15],[193,16],[194,17],[195,18],[189,1],[190,18],[192,18],[184,18],[183,1],[178,1],[177,1],[180,10],[181,19],[179,10],[173,1],[198,1],[119,20],[120,20],[121,21],[122,22],[123,23],[124,24],[75,1],[78,25],[76,1],[77,1],[125,26],[126,27],[127,28],[128,29],[129,30],[130,31],[131,31],[133,32],[132,33],[134,34],[135,35],[136,36],[118,37],[137,38],[138,39],[139,40],[140,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,49],[149,50],[150,50],[151,51],[152,1],[153,52],[155,53],[154,54],[156,55],[157,56],[158,57],[159,58],[160,59],[161,60],[162,61],[80,62],[79,1],[171,63],[163,64],[164,65],[165,66],[166,67],[167,68],[168,69],[169,70],[170,71],[199,1],[200,1],[201,1],[226,72],[227,73],[202,74],[205,74],[224,72],[225,72],[215,72],[214,75],[212,72],[207,72],[220,72],[218,72],[222,72],[206,72],[219,72],[223,72],[208,72],[209,72],[221,72],[203,72],[210,72],[211,72],[213,72],[217,72],[228,76],[216,72],[204,72],[241,77],[240,1],[235,76],[237,78],[236,76],[229,76],[230,76],[232,76],[234,76],[238,78],[239,78],[231,78],[233,78],[242,1],[243,1],[244,1],[246,79],[245,1],[259,80],[258,81],[249,82],[250,83],[257,84],[251,83],[252,82],[253,82],[254,82],[255,85],[248,86],[256,81],[247,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[96,87],[106,88],[95,87],[116,89],[87,90],[86,91],[115,92],[109,93],[114,94],[89,95],[103,96],[88,97],[112,98],[84,99],[83,92],[113,100],[85,101],[90,102],[91,1],[94,102],[81,1],[117,103],[107,104],[98,105],[99,106],[101,107],[97,108],[100,109],[110,92],[92,110],[93,111],[102,112],[82,113],[105,104],[104,102],[108,1],[111,114],[45,115],[53,1],[46,1],[54,115],[43,1],[44,1],[56,1],[47,1],[61,116],[51,117],[52,118],[58,119],[50,120],[55,121],[59,122],[60,122],[48,1],[57,123],[49,124]],"exportedModulesMap":[[42,1],[64,2],[62,1],[67,3],[63,2],[68,1],[65,4],[66,2],[69,1],[74,5],[70,1],[73,6],[71,1],[172,7],[174,8],[175,1],[72,1],[176,1],[197,9],[182,10],[188,11],[186,1],[185,12],[187,13],[196,14],[191,15],[193,16],[194,17],[195,18],[189,1],[190,18],[192,18],[184,18],[183,1],[178,1],[177,1],[180,10],[181,19],[179,10],[173,1],[198,1],[119,20],[120,20],[121,21],[122,22],[123,23],[124,24],[75,1],[78,25],[76,1],[77,1],[125,26],[126,27],[127,28],[128,29],[129,30],[130,31],[131,31],[133,32],[132,33],[134,34],[135,35],[136,36],[118,37],[137,38],[138,39],[139,40],[140,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,49],[149,50],[150,50],[151,51],[152,1],[153,52],[155,53],[154,54],[156,55],[157,56],[158,57],[159,58],[160,59],[161,60],[162,61],[80,62],[79,1],[171,63],[163,64],[164,65],[165,66],[166,67],[167,68],[168,69],[169,70],[170,71],[199,1],[200,1],[201,1],[226,72],[227,73],[202,74],[205,74],[224,72],[225,72],[215,72],[214,75],[212,72],[207,72],[220,72],[218,72],[222,72],[206,72],[219,72],[223,72],[208,72],[209,72],[221,72],[203,72],[210,72],[211,72],[213,72],[217,72],[228,76],[216,72],[204,72],[241,77],[240,1],[235,76],[237,78],[236,76],[229,76],[230,76],[232,76],[234,76],[238,78],[239,78],[231,78],[233,78],[242,1],[243,1],[244,1],[246,79],[245,1],[259,80],[258,81],[249,82],[250,83],[257,84],[251,83],[252,82],[253,82],[254,82],[255,85],[248,86],[256,81],[247,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[8,1],[96,87],[106,88],[95,87],[116,89],[87,90],[86,91],[115,92],[109,93],[114,94],[89,95],[103,96],[88,97],[112,98],[84,99],[83,92],[113,100],[85,101],[90,102],[91,1],[94,102],[81,1],[117,103],[107,104],[98,105],[99,106],[101,107],[97,108],[100,109],[110,92],[92,110],[93,111],[102,112],[82,113],[105,104],[104,102],[108,1],[111,114],[45,115],[53,1],[46,1],[54,115],[43,1],[44,1],[61,125],[51,126],[52,127],[58,127],[50,128],[55,127],[59,129],[60,129],[57,130],[49,129]],"semanticDiagnosticsPerFile":[42,64,62,67,63,68,65,66,69,74,70,73,71,172,174,175,72,176,197,182,188,186,185,187,196,191,193,194,195,189,190,192,184,183,178,177,180,181,179,173,198,119,120,121,122,123,124,75,78,76,77,125,126,127,128,129,130,131,133,132,134,135,136,118,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,155,154,156,157,158,159,160,161,162,80,79,171,163,164,165,166,167,168,169,170,199,200,201,226,227,202,205,224,225,215,214,212,207,220,218,222,206,219,223,208,209,221,203,210,211,213,217,228,216,204,241,240,235,237,236,229,230,232,234,238,239,231,233,242,243,244,246,245,259,258,249,250,257,251,252,253,254,255,248,256,247,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,8,96,106,95,116,87,86,115,109,114,89,103,88,112,84,83,113,85,90,91,94,81,117,107,98,99,101,97,100,110,92,93,102,82,105,104,108,111,45,53,46,54,43,44,56,47,61,51,52,58,50,55,59,60,48,57,49],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/utils/constants.d.ts b/tools/ui/node_modules/workbox-routing/utils/constants.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9d1068952a29c8527e860930c6e70e32a7f283a2
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/constants.d.ts
@@ -0,0 +1,19 @@
+import '../_version.js';
+export type HTTPMethod = 'DELETE' | 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT';
+/**
+ * The default HTTP method, 'GET', used when there's no specific method
+ * configured for a route.
+ *
+ * @type {string}
+ *
+ * @private
+ */
+export declare const defaultMethod: HTTPMethod;
+/**
+ * The list of valid HTTP methods associated with requests that could be routed.
+ *
+ * @type {Array}
+ *
+ * @private
+ */
+export declare const validMethods: HTTPMethod[];
diff --git a/tools/ui/node_modules/workbox-routing/utils/constants.js b/tools/ui/node_modules/workbox-routing/utils/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..2404732690deee57c0d57a7af86635bca3d1611c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/constants.js
@@ -0,0 +1,32 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+/**
+ * The default HTTP method, 'GET', used when there's no specific method
+ * configured for a route.
+ *
+ * @type {string}
+ *
+ * @private
+ */
+export const defaultMethod = 'GET';
+/**
+ * The list of valid HTTP methods associated with requests that could be routed.
+ *
+ * @type {Array}
+ *
+ * @private
+ */
+export const validMethods = [
+    'DELETE',
+    'GET',
+    'HEAD',
+    'PATCH',
+    'POST',
+    'PUT',
+];
diff --git a/tools/ui/node_modules/workbox-routing/utils/constants.mjs b/tools/ui/node_modules/workbox-routing/utils/constants.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..f3f4c8f2658cad983ad14478588d456cb83091d0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/constants.mjs
@@ -0,0 +1 @@
+export * from './constants.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.d.ts b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..071082ee87b921f0cbe8a21a1bd99ab7fb65d5cb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.d.ts
@@ -0,0 +1,10 @@
+import { Router } from '../Router.js';
+import '../_version.js';
+/**
+ * Creates a new, singleton Router instance if one does not exist. If one
+ * does already exist, that instance is returned.
+ *
+ * @private
+ * @return {Router}
+ */
+export declare const getOrCreateDefaultRouter: () => Router;
diff --git a/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js
new file mode 100644
index 0000000000000000000000000000000000000000..09447168de5725553daf0d0a98b53276fd265e8d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js
@@ -0,0 +1,26 @@
+/*
+  Copyright 2019 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { Router } from '../Router.js';
+import '../_version.js';
+let defaultRouter;
+/**
+ * Creates a new, singleton Router instance if one does not exist. If one
+ * does already exist, that instance is returned.
+ *
+ * @private
+ * @return {Router}
+ */
+export const getOrCreateDefaultRouter = () => {
+    if (!defaultRouter) {
+        defaultRouter = new Router();
+        // The helpers that use the default Router assume these listeners exist.
+        defaultRouter.addFetchListener();
+        defaultRouter.addCacheListener();
+    }
+    return defaultRouter;
+};
diff --git a/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.mjs b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..09892ef9ffef2b297b6f29a912780f2479a9bf13
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.mjs
@@ -0,0 +1 @@
+export * from './getOrCreateDefaultRouter.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.d.ts b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ae9bed5718b9e67df61794f52cb641f99aabc54a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.d.ts
@@ -0,0 +1,10 @@
+import { RouteHandler, RouteHandlerObject } from 'workbox-core/types.js';
+import '../_version.js';
+/**
+ * @param {function()|Object} handler Either a function, or an object with a
+ * 'handle' method.
+ * @return {Object} An object with a handle method.
+ *
+ * @private
+ */
+export declare const normalizeHandler: (handler: RouteHandler) => RouteHandlerObject;
diff --git a/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.js b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf4230439d3cf2cb6781c7f9885841d8651b2a64
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.js
@@ -0,0 +1,40 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import '../_version.js';
+/**
+ * @param {function()|Object} handler Either a function, or an object with a
+ * 'handle' method.
+ * @return {Object} An object with a handle method.
+ *
+ * @private
+ */
+export const normalizeHandler = (handler) => {
+    if (handler && typeof handler === 'object') {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.hasMethod(handler, 'handle', {
+                moduleName: 'workbox-routing',
+                className: 'Route',
+                funcName: 'constructor',
+                paramName: 'handler',
+            });
+        }
+        return handler;
+    }
+    else {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isType(handler, 'function', {
+                moduleName: 'workbox-routing',
+                className: 'Route',
+                funcName: 'constructor',
+                paramName: 'handler',
+            });
+        }
+        return { handle: handler };
+    }
+};
diff --git a/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.mjs b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..061a9f2a73f65556a9c551d1723e0f78b8ce80b9
--- /dev/null
+++ b/tools/ui/node_modules/workbox-routing/utils/normalizeHandler.mjs
@@ -0,0 +1 @@
+export * from './normalizeHandler.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/CacheFirst.d.ts b/tools/ui/node_modules/workbox-strategies/CacheFirst.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0e97629d4e82e23e89acf5785f07dc1888aa1432
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheFirst.d.ts
@@ -0,0 +1,28 @@
+import { Strategy } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+/**
+ * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)
+ * request strategy.
+ *
+ * A cache first strategy is useful for assets that have been revisioned,
+ * such as URLs like `/styles/example.a8f5f1.css`, since they
+ * can be cached for long periods of time.
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+declare class CacheFirst extends Strategy {
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+}
+export { CacheFirst };
diff --git a/tools/ui/node_modules/workbox-strategies/CacheFirst.js b/tools/ui/node_modules/workbox-strategies/CacheFirst.js
new file mode 100644
index 0000000000000000000000000000000000000000..085628f54f4b1d13508e41c4d1fac9706122eaa7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheFirst.js
@@ -0,0 +1,89 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { Strategy } from './Strategy.js';
+import { messages } from './utils/messages.js';
+import './_version.js';
+/**
+ * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)
+ * request strategy.
+ *
+ * A cache first strategy is useful for assets that have been revisioned,
+ * such as URLs like `/styles/example.a8f5f1.css`, since they
+ * can be cached for long periods of time.
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class CacheFirst extends Strategy {
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        const logs = [];
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-strategies',
+                className: this.constructor.name,
+                funcName: 'makeRequest',
+                paramName: 'request',
+            });
+        }
+        let response = await handler.cacheMatch(request);
+        let error = undefined;
+        if (!response) {
+            if (process.env.NODE_ENV !== 'production') {
+                logs.push(`No response found in the '${this.cacheName}' cache. ` +
+                    `Will respond with a network request.`);
+            }
+            try {
+                response = await handler.fetchAndCachePut(request);
+            }
+            catch (err) {
+                if (err instanceof Error) {
+                    error = err;
+                }
+            }
+            if (process.env.NODE_ENV !== 'production') {
+                if (response) {
+                    logs.push(`Got response from network.`);
+                }
+                else {
+                    logs.push(`Unable to get a response from the network.`);
+                }
+            }
+        }
+        else {
+            if (process.env.NODE_ENV !== 'production') {
+                logs.push(`Found a cached response in the '${this.cacheName}' cache.`);
+            }
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+            for (const log of logs) {
+                logger.log(log);
+            }
+            messages.printFinalResponse(response);
+            logger.groupEnd();
+        }
+        if (!response) {
+            throw new WorkboxError('no-response', { url: request.url, error });
+        }
+        return response;
+    }
+}
+export { CacheFirst };
diff --git a/tools/ui/node_modules/workbox-strategies/CacheFirst.mjs b/tools/ui/node_modules/workbox-strategies/CacheFirst.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..8387fc12f58c8a10eef1389739e5817101a191d8
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheFirst.mjs
@@ -0,0 +1 @@
+export * from './CacheFirst.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/CacheOnly.d.ts b/tools/ui/node_modules/workbox-strategies/CacheOnly.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..22bfd59d0c37987916362c85a469efc3defd8a77
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheOnly.d.ts
@@ -0,0 +1,26 @@
+import { Strategy } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+/**
+ * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If there is no cache match, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+declare class CacheOnly extends Strategy {
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+}
+export { CacheOnly };
diff --git a/tools/ui/node_modules/workbox-strategies/CacheOnly.js b/tools/ui/node_modules/workbox-strategies/CacheOnly.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d9d55701f470ca002dca11fcc04d12ef6ca8b99
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheOnly.js
@@ -0,0 +1,61 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { Strategy } from './Strategy.js';
+import { messages } from './utils/messages.js';
+import './_version.js';
+/**
+ * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If there is no cache match, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class CacheOnly extends Strategy {
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-strategies',
+                className: this.constructor.name,
+                funcName: 'makeRequest',
+                paramName: 'request',
+            });
+        }
+        const response = await handler.cacheMatch(request);
+        if (process.env.NODE_ENV !== 'production') {
+            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+            if (response) {
+                logger.log(`Found a cached response in the '${this.cacheName}' ` + `cache.`);
+                messages.printFinalResponse(response);
+            }
+            else {
+                logger.log(`No response found in the '${this.cacheName}' cache.`);
+            }
+            logger.groupEnd();
+        }
+        if (!response) {
+            throw new WorkboxError('no-response', { url: request.url });
+        }
+        return response;
+    }
+}
+export { CacheOnly };
diff --git a/tools/ui/node_modules/workbox-strategies/CacheOnly.mjs b/tools/ui/node_modules/workbox-strategies/CacheOnly.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..412ac7e20a7dda061107689477b5eda37981521b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/CacheOnly.mjs
@@ -0,0 +1 @@
+export * from './CacheOnly.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/LICENSE b/tools/ui/node_modules/workbox-strategies/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2018 Google LLC
+
+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/tools/ui/node_modules/workbox-strategies/NetworkFirst.d.ts b/tools/ui/node_modules/workbox-strategies/NetworkFirst.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3e8097131f498dc15f392dc96b8b5b9d84a49a33
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkFirst.d.ts
@@ -0,0 +1,80 @@
+import { Strategy, StrategyOptions } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+export interface NetworkFirstOptions extends StrategyOptions {
+    networkTimeoutSeconds?: number;
+}
+/**
+ * An implementation of a
+ * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)
+ * request strategy.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+declare class NetworkFirst extends Strategy {
+    private readonly _networkTimeoutSeconds;
+    /**
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+     * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+     * that fail to respond within the timeout will fallback to the cache.
+     *
+     * This option can be used to combat
+     * "[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}"
+     * scenarios.
+     */
+    constructor(options?: NetworkFirstOptions);
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+    /**
+     * @param {Object} options
+     * @param {Request} options.request
+     * @param {Array} options.logs A reference to the logs array
+     * @param {Event} options.event
+     * @return {Promise}
+     *
+     * @private
+     */
+    private _getTimeoutPromise;
+    /**
+     * @param {Object} options
+     * @param {number|undefined} options.timeoutId
+     * @param {Request} options.request
+     * @param {Array} options.logs A reference to the logs Array.
+     * @param {Event} options.event
+     * @return {Promise}
+     *
+     * @private
+     */
+    _getNetworkPromise({ timeoutId, request, logs, handler, }: {
+        request: Request;
+        logs: any[];
+        timeoutId?: number;
+        handler: StrategyHandler;
+    }): Promise;
+}
+export { NetworkFirst };
diff --git a/tools/ui/node_modules/workbox-strategies/NetworkFirst.js b/tools/ui/node_modules/workbox-strategies/NetworkFirst.js
new file mode 100644
index 0000000000000000000000000000000000000000..1471537ee9371aadba3ae4cad585fb890729e3f7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkFirst.js
@@ -0,0 +1,197 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';
+import { Strategy } from './Strategy.js';
+import { messages } from './utils/messages.js';
+import './_version.js';
+/**
+ * An implementation of a
+ * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)
+ * request strategy.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class NetworkFirst extends Strategy {
+    /**
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+     * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+     * that fail to respond within the timeout will fallback to the cache.
+     *
+     * This option can be used to combat
+     * "[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}"
+     * scenarios.
+     */
+    constructor(options = {}) {
+        super(options);
+        // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
+            this.plugins.unshift(cacheOkAndOpaquePlugin);
+        }
+        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+        if (process.env.NODE_ENV !== 'production') {
+            if (this._networkTimeoutSeconds) {
+                assert.isType(this._networkTimeoutSeconds, 'number', {
+                    moduleName: 'workbox-strategies',
+                    className: this.constructor.name,
+                    funcName: 'constructor',
+                    paramName: 'networkTimeoutSeconds',
+                });
+            }
+        }
+    }
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        const logs = [];
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-strategies',
+                className: this.constructor.name,
+                funcName: 'handle',
+                paramName: 'makeRequest',
+            });
+        }
+        const promises = [];
+        let timeoutId;
+        if (this._networkTimeoutSeconds) {
+            const { id, promise } = this._getTimeoutPromise({ request, logs, handler });
+            timeoutId = id;
+            promises.push(promise);
+        }
+        const networkPromise = this._getNetworkPromise({
+            timeoutId,
+            request,
+            logs,
+            handler,
+        });
+        promises.push(networkPromise);
+        const response = await handler.waitUntil((async () => {
+            // Promise.race() will resolve as soon as the first promise resolves.
+            return ((await handler.waitUntil(Promise.race(promises))) ||
+                // If Promise.race() resolved with null, it might be due to a network
+                // timeout + a cache miss. If that were to happen, we'd rather wait until
+                // the networkPromise resolves instead of returning null.
+                // Note that it's fine to await an already-resolved promise, so we don't
+                // have to check to see if it's still "in flight".
+                (await networkPromise));
+        })());
+        if (process.env.NODE_ENV !== 'production') {
+            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+            for (const log of logs) {
+                logger.log(log);
+            }
+            messages.printFinalResponse(response);
+            logger.groupEnd();
+        }
+        if (!response) {
+            throw new WorkboxError('no-response', { url: request.url });
+        }
+        return response;
+    }
+    /**
+     * @param {Object} options
+     * @param {Request} options.request
+     * @param {Array} options.logs A reference to the logs array
+     * @param {Event} options.event
+     * @return {Promise}
+     *
+     * @private
+     */
+    _getTimeoutPromise({ request, logs, handler, }) {
+        let timeoutId;
+        const timeoutPromise = new Promise((resolve) => {
+            const onNetworkTimeout = async () => {
+                if (process.env.NODE_ENV !== 'production') {
+                    logs.push(`Timing out the network response at ` +
+                        `${this._networkTimeoutSeconds} seconds.`);
+                }
+                resolve(await handler.cacheMatch(request));
+            };
+            timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);
+        });
+        return {
+            promise: timeoutPromise,
+            id: timeoutId,
+        };
+    }
+    /**
+     * @param {Object} options
+     * @param {number|undefined} options.timeoutId
+     * @param {Request} options.request
+     * @param {Array} options.logs A reference to the logs Array.
+     * @param {Event} options.event
+     * @return {Promise}
+     *
+     * @private
+     */
+    async _getNetworkPromise({ timeoutId, request, logs, handler, }) {
+        let error;
+        let response;
+        try {
+            response = await handler.fetchAndCachePut(request);
+        }
+        catch (fetchError) {
+            if (fetchError instanceof Error) {
+                error = fetchError;
+            }
+        }
+        if (timeoutId) {
+            clearTimeout(timeoutId);
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            if (response) {
+                logs.push(`Got response from network.`);
+            }
+            else {
+                logs.push(`Unable to get a response from the network. Will respond ` +
+                    `with a cached response.`);
+            }
+        }
+        if (error || !response) {
+            response = await handler.cacheMatch(request);
+            if (process.env.NODE_ENV !== 'production') {
+                if (response) {
+                    logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache.`);
+                }
+                else {
+                    logs.push(`No response found in the '${this.cacheName}' cache.`);
+                }
+            }
+        }
+        return response;
+    }
+}
+export { NetworkFirst };
diff --git a/tools/ui/node_modules/workbox-strategies/NetworkFirst.mjs b/tools/ui/node_modules/workbox-strategies/NetworkFirst.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..28fcdb64af9d0e6bd14f00cef2f5a9523aa38253
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkFirst.mjs
@@ -0,0 +1 @@
+export * from './NetworkFirst.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/NetworkOnly.d.ts b/tools/ui/node_modules/workbox-strategies/NetworkOnly.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..454b6e1edc8592604eaa102fc23703f958455298
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkOnly.d.ts
@@ -0,0 +1,43 @@
+import { Strategy, StrategyOptions } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+interface NetworkOnlyOptions extends Omit {
+    networkTimeoutSeconds?: number;
+}
+/**
+ * An implementation of a
+ * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If the network request fails, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+declare class NetworkOnly extends Strategy {
+    private readonly _networkTimeoutSeconds;
+    /**
+     * @param {Object} [options]
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+     * that fail to respond within the timeout will result in a network error.
+     */
+    constructor(options?: NetworkOnlyOptions);
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+}
+export { NetworkOnly, NetworkOnlyOptions };
diff --git a/tools/ui/node_modules/workbox-strategies/NetworkOnly.js b/tools/ui/node_modules/workbox-strategies/NetworkOnly.js
new file mode 100644
index 0000000000000000000000000000000000000000..991acdfa73ca022cf729ac46e2843760337a9c62
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkOnly.js
@@ -0,0 +1,98 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { timeout } from 'workbox-core/_private/timeout.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { Strategy } from './Strategy.js';
+import { messages } from './utils/messages.js';
+import './_version.js';
+/**
+ * An implementation of a
+ * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If the network request fails, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class NetworkOnly extends Strategy {
+    /**
+     * @param {Object} [options]
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+     * that fail to respond within the timeout will result in a network error.
+     */
+    constructor(options = {}) {
+        super(options);
+        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+    }
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-strategies',
+                className: this.constructor.name,
+                funcName: '_handle',
+                paramName: 'request',
+            });
+        }
+        let error = undefined;
+        let response;
+        try {
+            const promises = [
+                handler.fetch(request),
+            ];
+            if (this._networkTimeoutSeconds) {
+                const timeoutPromise = timeout(this._networkTimeoutSeconds * 1000);
+                promises.push(timeoutPromise);
+            }
+            response = await Promise.race(promises);
+            if (!response) {
+                throw new Error(`Timed out the network response after ` +
+                    `${this._networkTimeoutSeconds} seconds.`);
+            }
+        }
+        catch (err) {
+            if (err instanceof Error) {
+                error = err;
+            }
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+            if (response) {
+                logger.log(`Got response from network.`);
+            }
+            else {
+                logger.log(`Unable to get a response from the network.`);
+            }
+            messages.printFinalResponse(response);
+            logger.groupEnd();
+        }
+        if (!response) {
+            throw new WorkboxError('no-response', { url: request.url, error });
+        }
+        return response;
+    }
+}
+export { NetworkOnly };
diff --git a/tools/ui/node_modules/workbox-strategies/NetworkOnly.mjs b/tools/ui/node_modules/workbox-strategies/NetworkOnly.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..ce7a2525bd0f56180218b66ad601e844bc3646a7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/NetworkOnly.mjs
@@ -0,0 +1 @@
+export * from './NetworkOnly.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/README.md b/tools/ui/node_modules/workbox-strategies/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..d1a5ec5b4a80bb1036d3501a096aeec082aff768
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/README.md
@@ -0,0 +1 @@
+This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-strategies
diff --git a/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.d.ts b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..858e1a66fcb0af2949dc27805161becc6a7ab43b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.d.ts
@@ -0,0 +1,49 @@
+import { Strategy, StrategyOptions } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+/**
+ * An implementation of a
+ * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)
+ * request strategy.
+ *
+ * Resources are requested from both the cache and the network in parallel.
+ * The strategy will respond with the cached version if available, otherwise
+ * wait for the network response. The cache is updated with the network response
+ * with each successful request.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+declare class StaleWhileRevalidate extends Strategy {
+    /**
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+     */
+    constructor(options?: StrategyOptions);
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    _handle(request: Request, handler: StrategyHandler): Promise;
+}
+export { StaleWhileRevalidate };
diff --git a/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.js b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.js
new file mode 100644
index 0000000000000000000000000000000000000000..e93e3c3ae19be6206fd995366212b51b88ab3b3a
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.js
@@ -0,0 +1,118 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';
+import { Strategy } from './Strategy.js';
+import { messages } from './utils/messages.js';
+import './_version.js';
+/**
+ * An implementation of a
+ * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)
+ * request strategy.
+ *
+ * Resources are requested from both the cache and the network in parallel.
+ * The strategy will respond with the cached version if available, otherwise
+ * wait for the network response. The cache is updated with the network response
+ * with each successful request.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class StaleWhileRevalidate extends Strategy {
+    /**
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+     */
+    constructor(options = {}) {
+        super(options);
+        // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
+            this.plugins.unshift(cacheOkAndOpaquePlugin);
+        }
+    }
+    /**
+     * @private
+     * @param {Request|string} request A request to run this strategy for.
+     * @param {workbox-strategies.StrategyHandler} handler The event that
+     *     triggered the request.
+     * @return {Promise}
+     */
+    async _handle(request, handler) {
+        const logs = [];
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(request, Request, {
+                moduleName: 'workbox-strategies',
+                className: this.constructor.name,
+                funcName: 'handle',
+                paramName: 'request',
+            });
+        }
+        const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {
+            // Swallow this error because a 'no-response' error will be thrown in
+            // main handler return flow. This will be in the `waitUntil()` flow.
+        });
+        void handler.waitUntil(fetchAndCachePromise);
+        let response = await handler.cacheMatch(request);
+        let error;
+        if (response) {
+            if (process.env.NODE_ENV !== 'production') {
+                logs.push(`Found a cached response in the '${this.cacheName}'` +
+                    ` cache. Will update with the network response in the background.`);
+            }
+        }
+        else {
+            if (process.env.NODE_ENV !== 'production') {
+                logs.push(`No response found in the '${this.cacheName}' cache. ` +
+                    `Will wait for the network response.`);
+            }
+            try {
+                // NOTE(philipwalton): Really annoying that we have to type cast here.
+                // https://github.com/microsoft/TypeScript/issues/20006
+                response = (await fetchAndCachePromise);
+            }
+            catch (err) {
+                if (err instanceof Error) {
+                    error = err;
+                }
+            }
+        }
+        if (process.env.NODE_ENV !== 'production') {
+            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+            for (const log of logs) {
+                logger.log(log);
+            }
+            messages.printFinalResponse(response);
+            logger.groupEnd();
+        }
+        if (!response) {
+            throw new WorkboxError('no-response', { url: request.url, error });
+        }
+        return response;
+    }
+}
+export { StaleWhileRevalidate };
diff --git a/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.mjs b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..6e1a02d2ecacf5c7fa0c00aadd8cdb65d4d33e99
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StaleWhileRevalidate.mjs
@@ -0,0 +1 @@
+export * from './StaleWhileRevalidate.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/Strategy.d.ts b/tools/ui/node_modules/workbox-strategies/Strategy.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1947398b5bc372111badb53fd89f491f0d44f4a3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/Strategy.d.ts
@@ -0,0 +1,107 @@
+import { HandlerCallbackOptions, RouteHandlerObject, WorkboxPlugin } from 'workbox-core/types.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+export interface StrategyOptions {
+    cacheName?: string;
+    plugins?: WorkboxPlugin[];
+    fetchOptions?: RequestInit;
+    matchOptions?: CacheQueryOptions;
+}
+/**
+ * An abstract base class that all other strategy classes must extend from:
+ *
+ * @memberof workbox-strategies
+ */
+declare abstract class Strategy implements RouteHandlerObject {
+    cacheName: string;
+    plugins: WorkboxPlugin[];
+    fetchOptions?: RequestInit;
+    matchOptions?: CacheQueryOptions;
+    protected abstract _handle(request: Request, handler: StrategyHandler): Promise;
+    /**
+     * Creates a new instance of the strategy and sets all documented option
+     * properties as public instance properties.
+     *
+     * Note: if a custom strategy class extends the base Strategy class and does
+     * not need more than these properties, it does not need to define its own
+     * constructor.
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to the cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] The
+     * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+     * for any `cache.match()` or `cache.put()` calls made by this strategy.
+     */
+    constructor(options?: StrategyOptions);
+    /**
+     * Perform a request strategy and returns a `Promise` that will resolve with
+     * a `Response`, invoking all relevant plugin callbacks.
+     *
+     * When a strategy instance is registered with a Workbox
+     * {@link workbox-routing.Route}, this method is automatically
+     * called when the route matches.
+     *
+     * Alternatively, this method can be used in a standalone `FetchEvent`
+     * listener by passing it to `event.respondWith()`.
+     *
+     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+     *     properties listed below.
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params]
+     */
+    handle(options: FetchEvent | HandlerCallbackOptions): Promise;
+    /**
+     * Similar to {@link workbox-strategies.Strategy~handle}, but
+     * instead of just returning a `Promise` that resolves to a `Response` it
+     * it will return an tuple of `[response, done]` promises, where the former
+     * (`response`) is equivalent to what `handle()` returns, and the latter is a
+     * Promise that will resolve once any promises that were added to
+     * `event.waitUntil()` as part of performing the strategy have completed.
+     *
+     * You can await the `done` promise to ensure any extra work performed by
+     * the strategy (usually caching responses) completes successfully.
+     *
+     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+     *     properties listed below.
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params]
+     * @return {Array} A tuple of [response, done]
+     *     promises that can be used to determine when the response resolves as
+     *     well as when the handler has completed all its work.
+     */
+    handleAll(options: FetchEvent | HandlerCallbackOptions): [Promise, Promise];
+    _getResponse(handler: StrategyHandler, request: Request, event: ExtendableEvent): Promise;
+    _awaitComplete(responseDone: Promise, handler: StrategyHandler, request: Request, event: ExtendableEvent): Promise;
+}
+export { Strategy };
+/**
+ * Classes extending the `Strategy` based class should implement this method,
+ * and leverage the {@link workbox-strategies.StrategyHandler}
+ * arg to perform all fetching and cache logic, which will ensure all relevant
+ * cache, cache options, fetch options and plugins are used (per the current
+ * strategy instance).
+ *
+ * @name _handle
+ * @instance
+ * @abstract
+ * @function
+ * @param {Request} request
+ * @param {workbox-strategies.StrategyHandler} handler
+ * @return {Promise}
+ *
+ * @memberof workbox-strategies.Strategy
+ */
diff --git a/tools/ui/node_modules/workbox-strategies/Strategy.js b/tools/ui/node_modules/workbox-strategies/Strategy.js
new file mode 100644
index 0000000000000000000000000000000000000000..e81a2f67d0e9ef886bb527c7b11b38cccf3edeeb
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/Strategy.js
@@ -0,0 +1,228 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { cacheNames } from 'workbox-core/_private/cacheNames.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+/**
+ * An abstract base class that all other strategy classes must extend from:
+ *
+ * @memberof workbox-strategies
+ */
+class Strategy {
+    /**
+     * Creates a new instance of the strategy and sets all documented option
+     * properties as public instance properties.
+     *
+     * Note: if a custom strategy class extends the base Strategy class and does
+     * not need more than these properties, it does not need to define its own
+     * constructor.
+     *
+     * @param {Object} [options]
+     * @param {string} [options.cacheName] Cache name to store and retrieve
+     * requests. Defaults to the cache names provided by
+     * {@link workbox-core.cacheNames}.
+     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * to use in conjunction with this caching strategy.
+     * @param {Object} [options.fetchOptions] Values passed along to the
+     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+     * `fetch()` requests made by this strategy.
+     * @param {Object} [options.matchOptions] The
+     * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+     * for any `cache.match()` or `cache.put()` calls made by this strategy.
+     */
+    constructor(options = {}) {
+        /**
+         * Cache name to store and retrieve
+         * requests. Defaults to the cache names provided by
+         * {@link workbox-core.cacheNames}.
+         *
+         * @type {string}
+         */
+        this.cacheName = cacheNames.getRuntimeName(options.cacheName);
+        /**
+         * The list
+         * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+         * used by this strategy.
+         *
+         * @type {Array}
+         */
+        this.plugins = options.plugins || [];
+        /**
+         * Values passed along to the
+         * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
+         * of all fetch() requests made by this strategy.
+         *
+         * @type {Object}
+         */
+        this.fetchOptions = options.fetchOptions;
+        /**
+         * The
+         * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+         * for any `cache.match()` or `cache.put()` calls made by this strategy.
+         *
+         * @type {Object}
+         */
+        this.matchOptions = options.matchOptions;
+    }
+    /**
+     * Perform a request strategy and returns a `Promise` that will resolve with
+     * a `Response`, invoking all relevant plugin callbacks.
+     *
+     * When a strategy instance is registered with a Workbox
+     * {@link workbox-routing.Route}, this method is automatically
+     * called when the route matches.
+     *
+     * Alternatively, this method can be used in a standalone `FetchEvent`
+     * listener by passing it to `event.respondWith()`.
+     *
+     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+     *     properties listed below.
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params]
+     */
+    handle(options) {
+        const [responseDone] = this.handleAll(options);
+        return responseDone;
+    }
+    /**
+     * Similar to {@link workbox-strategies.Strategy~handle}, but
+     * instead of just returning a `Promise` that resolves to a `Response` it
+     * it will return an tuple of `[response, done]` promises, where the former
+     * (`response`) is equivalent to what `handle()` returns, and the latter is a
+     * Promise that will resolve once any promises that were added to
+     * `event.waitUntil()` as part of performing the strategy have completed.
+     *
+     * You can await the `done` promise to ensure any extra work performed by
+     * the strategy (usually caching responses) completes successfully.
+     *
+     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+     *     properties listed below.
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params]
+     * @return {Array} A tuple of [response, done]
+     *     promises that can be used to determine when the response resolves as
+     *     well as when the handler has completed all its work.
+     */
+    handleAll(options) {
+        // Allow for flexible options to be passed.
+        if (options instanceof FetchEvent) {
+            options = {
+                event: options,
+                request: options.request,
+            };
+        }
+        const event = options.event;
+        const request = typeof options.request === 'string'
+            ? new Request(options.request)
+            : options.request;
+        const params = 'params' in options ? options.params : undefined;
+        const handler = new StrategyHandler(this, { event, request, params });
+        const responseDone = this._getResponse(handler, request, event);
+        const handlerDone = this._awaitComplete(responseDone, handler, request, event);
+        // Return an array of promises, suitable for use with Promise.all().
+        return [responseDone, handlerDone];
+    }
+    async _getResponse(handler, request, event) {
+        await handler.runCallbacks('handlerWillStart', { event, request });
+        let response = undefined;
+        try {
+            response = await this._handle(request, handler);
+            // The "official" Strategy subclasses all throw this error automatically,
+            // but in case a third-party Strategy doesn't, ensure that we have a
+            // consistent failure when there's no response or an error response.
+            if (!response || response.type === 'error') {
+                throw new WorkboxError('no-response', { url: request.url });
+            }
+        }
+        catch (error) {
+            if (error instanceof Error) {
+                for (const callback of handler.iterateCallbacks('handlerDidError')) {
+                    response = await callback({ error, event, request });
+                    if (response) {
+                        break;
+                    }
+                }
+            }
+            if (!response) {
+                throw error;
+            }
+            else if (process.env.NODE_ENV !== 'production') {
+                logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +
+                    `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +
+                    `a handlerDidError plugin.`);
+            }
+        }
+        for (const callback of handler.iterateCallbacks('handlerWillRespond')) {
+            response = await callback({ event, request, response });
+        }
+        return response;
+    }
+    async _awaitComplete(responseDone, handler, request, event) {
+        let response;
+        let error;
+        try {
+            response = await responseDone;
+        }
+        catch (error) {
+            // Ignore errors, as response errors should be caught via the `response`
+            // promise above. The `done` promise will only throw for errors in
+            // promises passed to `handler.waitUntil()`.
+        }
+        try {
+            await handler.runCallbacks('handlerDidRespond', {
+                event,
+                request,
+                response,
+            });
+            await handler.doneWaiting();
+        }
+        catch (waitUntilError) {
+            if (waitUntilError instanceof Error) {
+                error = waitUntilError;
+            }
+        }
+        await handler.runCallbacks('handlerDidComplete', {
+            event,
+            request,
+            response,
+            error: error,
+        });
+        handler.destroy();
+        if (error) {
+            throw error;
+        }
+    }
+}
+export { Strategy };
+/**
+ * Classes extending the `Strategy` based class should implement this method,
+ * and leverage the {@link workbox-strategies.StrategyHandler}
+ * arg to perform all fetching and cache logic, which will ensure all relevant
+ * cache, cache options, fetch options and plugins are used (per the current
+ * strategy instance).
+ *
+ * @name _handle
+ * @instance
+ * @abstract
+ * @function
+ * @param {Request} request
+ * @param {workbox-strategies.StrategyHandler} handler
+ * @return {Promise}
+ *
+ * @memberof workbox-strategies.Strategy
+ */
diff --git a/tools/ui/node_modules/workbox-strategies/Strategy.mjs b/tools/ui/node_modules/workbox-strategies/Strategy.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..3a4705c03d87df6c19dd30407f39e617635f89f3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/Strategy.mjs
@@ -0,0 +1 @@
+export * from './Strategy.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/StrategyHandler.d.ts b/tools/ui/node_modules/workbox-strategies/StrategyHandler.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..916270e6037cd66eae9d6209ffac7d39a546d5b7
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StrategyHandler.d.ts
@@ -0,0 +1,184 @@
+import { HandlerCallbackOptions, WorkboxPlugin, WorkboxPluginCallbackParam } from 'workbox-core/types.js';
+import { Strategy } from './Strategy.js';
+import './_version.js';
+/**
+ * A class created every time a Strategy instance calls
+ * {@link workbox-strategies.Strategy~handle} or
+ * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and
+ * cache actions around plugin callbacks and keeps track of when the strategy
+ * is "done" (i.e. all added `event.waitUntil()` promises have resolved).
+ *
+ * @memberof workbox-strategies
+ */
+declare class StrategyHandler {
+    request: Request;
+    url?: URL;
+    event: ExtendableEvent;
+    params?: any;
+    private _cacheKeys;
+    private readonly _strategy;
+    private readonly _extendLifetimePromises;
+    private readonly _handlerDeferred;
+    private readonly _plugins;
+    private readonly _pluginStateMap;
+    /**
+     * Creates a new instance associated with the passed strategy and event
+     * that's handling the request.
+     *
+     * The constructor also initializes the state that will be passed to each of
+     * the plugins handling this request.
+     *
+     * @param {workbox-strategies.Strategy} strategy
+     * @param {Object} options
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params] The return value from the
+     *     {@link workbox-routing~matchCallback} (if applicable).
+     */
+    constructor(strategy: Strategy, options: HandlerCallbackOptions);
+    /**
+     * Fetches a given request (and invokes any applicable plugin callback
+     * methods) using the `fetchOptions` (for non-navigation requests) and
+     * `plugins` defined on the `Strategy` object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - `requestWillFetch()`
+     * - `fetchDidSucceed()`
+     * - `fetchDidFail()`
+     *
+     * @param {Request|string} input The URL or request to fetch.
+     * @return {Promise}
+     */
+    fetch(input: RequestInfo): Promise;
+    /**
+     * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on
+     * the response generated by `this.fetch()`.
+     *
+     * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,
+     * so you do not have to manually call `waitUntil()` on the event.
+     *
+     * @param {Request|string} input The request or URL to fetch and cache.
+     * @return {Promise}
+     */
+    fetchAndCachePut(input: RequestInfo): Promise;
+    /**
+     * Matches a request from the cache (and invokes any applicable plugin
+     * callback methods) using the `cacheName`, `matchOptions`, and `plugins`
+     * defined on the strategy object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - cacheKeyWillBeUsed()
+     * - cachedResponseWillBeUsed()
+     *
+     * @param {Request|string} key The Request or URL to use as the cache key.
+     * @return {Promise} A matching response, if found.
+     */
+    cacheMatch(key: RequestInfo): Promise;
+    /**
+     * Puts a request/response pair in the cache (and invokes any applicable
+     * plugin callback methods) using the `cacheName` and `plugins` defined on
+     * the strategy object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - cacheKeyWillBeUsed()
+     * - cacheWillUpdate()
+     * - cacheDidUpdate()
+     *
+     * @param {Request|string} key The request or URL to use as the cache key.
+     * @param {Response} response The response to cache.
+     * @return {Promise} `false` if a cacheWillUpdate caused the response
+     * not be cached, and `true` otherwise.
+     */
+    cachePut(key: RequestInfo, response: Response): Promise;
+    /**
+     * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and
+     * executes any of those callbacks found in sequence. The final `Request`
+     * object returned by the last plugin is treated as the cache key for cache
+     * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have
+     * been registered, the passed request is returned unmodified
+     *
+     * @param {Request} request
+     * @param {string} mode
+     * @return {Promise}
+     */
+    getCacheKey(request: Request, mode: 'read' | 'write'): Promise;
+    /**
+     * Returns true if the strategy has at least one plugin with the given
+     * callback.
+     *
+     * @param {string} name The name of the callback to check for.
+     * @return {boolean}
+     */
+    hasCallback(name: C): boolean;
+    /**
+     * Runs all plugin callbacks matching the given name, in order, passing the
+     * given param object (merged ith the current plugin state) as the only
+     * argument.
+     *
+     * Note: since this method runs all plugins, it's not suitable for cases
+     * where the return value of a callback needs to be applied prior to calling
+     * the next callback. See
+     * {@link workbox-strategies.StrategyHandler#iterateCallbacks}
+     * below for how to handle that case.
+     *
+     * @param {string} name The name of the callback to run within each plugin.
+     * @param {Object} param The object to pass as the first (and only) param
+     *     when executing each callback. This object will be merged with the
+     *     current plugin state prior to callback execution.
+     */
+    runCallbacks>(name: C, param: Omit): Promise;
+    /**
+     * Accepts a callback and returns an iterable of matching plugin callbacks,
+     * where each callback is wrapped with the current handler state (i.e. when
+     * you call each callback, whatever object parameter you pass it will
+     * be merged with the plugin's current state).
+     *
+     * @param {string} name The name fo the callback to run
+     * @return {Array}
+     */
+    iterateCallbacks(name: C): Generator>;
+    /**
+     * Adds a promise to the
+     * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}
+     * of the event associated with the request being handled (usually a
+     * `FetchEvent`).
+     *
+     * Note: you can await
+     * {@link workbox-strategies.StrategyHandler~doneWaiting}
+     * to know when all added promises have settled.
+     *
+     * @param {Promise} promise A promise to add to the extend lifetime promises
+     *     of the event that triggered the request.
+     */
+    waitUntil(promise: Promise): Promise;
+    /**
+     * Returns a promise that resolves once all promises passed to
+     * {@link workbox-strategies.StrategyHandler~waitUntil}
+     * have settled.
+     *
+     * Note: any work done after `doneWaiting()` settles should be manually
+     * passed to an event's `waitUntil()` method (not this handler's
+     * `waitUntil()` method), otherwise the service worker thread may be killed
+     * prior to your work completing.
+     */
+    doneWaiting(): Promise;
+    /**
+     * Stops running the strategy and immediately resolves any pending
+     * `waitUntil()` promises.
+     */
+    destroy(): void;
+    /**
+     * This method will call cacheWillUpdate on the available plugins (or use
+     * status === 200) to determine if the Response is safe and valid to cache.
+     *
+     * @param {Request} options.request
+     * @param {Response} options.response
+     * @return {Promise}
+     *
+     * @private
+     */
+    _ensureResponseSafeToCache(response: Response): Promise;
+}
+export { StrategyHandler };
diff --git a/tools/ui/node_modules/workbox-strategies/StrategyHandler.js b/tools/ui/node_modules/workbox-strategies/StrategyHandler.js
new file mode 100644
index 0000000000000000000000000000000000000000..65e2199d21c4d246b027ed92fefceb87a21f0e8b
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StrategyHandler.js
@@ -0,0 +1,521 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { assert } from 'workbox-core/_private/assert.js';
+import { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';
+import { Deferred } from 'workbox-core/_private/Deferred.js';
+import { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';
+import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';
+import { logger } from 'workbox-core/_private/logger.js';
+import { timeout } from 'workbox-core/_private/timeout.js';
+import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';
+import './_version.js';
+function toRequest(input) {
+    return typeof input === 'string' ? new Request(input) : input;
+}
+/**
+ * A class created every time a Strategy instance calls
+ * {@link workbox-strategies.Strategy~handle} or
+ * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and
+ * cache actions around plugin callbacks and keeps track of when the strategy
+ * is "done" (i.e. all added `event.waitUntil()` promises have resolved).
+ *
+ * @memberof workbox-strategies
+ */
+class StrategyHandler {
+    /**
+     * Creates a new instance associated with the passed strategy and event
+     * that's handling the request.
+     *
+     * The constructor also initializes the state that will be passed to each of
+     * the plugins handling this request.
+     *
+     * @param {workbox-strategies.Strategy} strategy
+     * @param {Object} options
+     * @param {Request|string} options.request A request to run this strategy for.
+     * @param {ExtendableEvent} options.event The event associated with the
+     *     request.
+     * @param {URL} [options.url]
+     * @param {*} [options.params] The return value from the
+     *     {@link workbox-routing~matchCallback} (if applicable).
+     */
+    constructor(strategy, options) {
+        this._cacheKeys = {};
+        /**
+         * The request the strategy is performing (passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * @name request
+         * @instance
+         * @type {Request}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * The event associated with this request.
+         * @name event
+         * @instance
+         * @type {ExtendableEvent}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * A `URL` instance of `request.url` (if passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * Note: the `url` param will be present if the strategy was invoked
+         * from a workbox `Route` object.
+         * @name url
+         * @instance
+         * @type {URL|undefined}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * A `param` value (if passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * Note: the `param` param will be present if the strategy was invoked
+         * from a workbox `Route` object and the
+         * {@link workbox-routing~matchCallback} returned
+         * a truthy value (it will be that value).
+         * @name params
+         * @instance
+         * @type {*|undefined}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        if (process.env.NODE_ENV !== 'production') {
+            assert.isInstance(options.event, ExtendableEvent, {
+                moduleName: 'workbox-strategies',
+                className: 'StrategyHandler',
+                funcName: 'constructor',
+                paramName: 'options.event',
+            });
+        }
+        Object.assign(this, options);
+        this.event = options.event;
+        this._strategy = strategy;
+        this._handlerDeferred = new Deferred();
+        this._extendLifetimePromises = [];
+        // Copy the plugins list (since it's mutable on the strategy),
+        // so any mutations don't affect this handler instance.
+        this._plugins = [...strategy.plugins];
+        this._pluginStateMap = new Map();
+        for (const plugin of this._plugins) {
+            this._pluginStateMap.set(plugin, {});
+        }
+        this.event.waitUntil(this._handlerDeferred.promise);
+    }
+    /**
+     * Fetches a given request (and invokes any applicable plugin callback
+     * methods) using the `fetchOptions` (for non-navigation requests) and
+     * `plugins` defined on the `Strategy` object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - `requestWillFetch()`
+     * - `fetchDidSucceed()`
+     * - `fetchDidFail()`
+     *
+     * @param {Request|string} input The URL or request to fetch.
+     * @return {Promise}
+     */
+    async fetch(input) {
+        const { event } = this;
+        let request = toRequest(input);
+        if (request.mode === 'navigate' &&
+            event instanceof FetchEvent &&
+            event.preloadResponse) {
+            const possiblePreloadResponse = (await event.preloadResponse);
+            if (possiblePreloadResponse) {
+                if (process.env.NODE_ENV !== 'production') {
+                    logger.log(`Using a preloaded navigation response for ` +
+                        `'${getFriendlyURL(request.url)}'`);
+                }
+                return possiblePreloadResponse;
+            }
+        }
+        // If there is a fetchDidFail plugin, we need to save a clone of the
+        // original request before it's either modified by a requestWillFetch
+        // plugin or before the original request's body is consumed via fetch().
+        const originalRequest = this.hasCallback('fetchDidFail')
+            ? request.clone()
+            : null;
+        try {
+            for (const cb of this.iterateCallbacks('requestWillFetch')) {
+                request = await cb({ request: request.clone(), event });
+            }
+        }
+        catch (err) {
+            if (err instanceof Error) {
+                throw new WorkboxError('plugin-error-request-will-fetch', {
+                    thrownErrorMessage: err.message,
+                });
+            }
+        }
+        // The request can be altered by plugins with `requestWillFetch` making
+        // the original request (most likely from a `fetch` event) different
+        // from the Request we make. Pass both to `fetchDidFail` to aid debugging.
+        const pluginFilteredRequest = request.clone();
+        try {
+            let fetchResponse;
+            // See https://github.com/GoogleChrome/workbox/issues/1796
+            fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);
+            if (process.env.NODE_ENV !== 'production') {
+                logger.debug(`Network request for ` +
+                    `'${getFriendlyURL(request.url)}' returned a response with ` +
+                    `status '${fetchResponse.status}'.`);
+            }
+            for (const callback of this.iterateCallbacks('fetchDidSucceed')) {
+                fetchResponse = await callback({
+                    event,
+                    request: pluginFilteredRequest,
+                    response: fetchResponse,
+                });
+            }
+            return fetchResponse;
+        }
+        catch (error) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.log(`Network request for ` +
+                    `'${getFriendlyURL(request.url)}' threw an error.`, error);
+            }
+            // `originalRequest` will only exist if a `fetchDidFail` callback
+            // is being used (see above).
+            if (originalRequest) {
+                await this.runCallbacks('fetchDidFail', {
+                    error: error,
+                    event,
+                    originalRequest: originalRequest.clone(),
+                    request: pluginFilteredRequest.clone(),
+                });
+            }
+            throw error;
+        }
+    }
+    /**
+     * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on
+     * the response generated by `this.fetch()`.
+     *
+     * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,
+     * so you do not have to manually call `waitUntil()` on the event.
+     *
+     * @param {Request|string} input The request or URL to fetch and cache.
+     * @return {Promise}
+     */
+    async fetchAndCachePut(input) {
+        const response = await this.fetch(input);
+        const responseClone = response.clone();
+        void this.waitUntil(this.cachePut(input, responseClone));
+        return response;
+    }
+    /**
+     * Matches a request from the cache (and invokes any applicable plugin
+     * callback methods) using the `cacheName`, `matchOptions`, and `plugins`
+     * defined on the strategy object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - cacheKeyWillBeUsed()
+     * - cachedResponseWillBeUsed()
+     *
+     * @param {Request|string} key The Request or URL to use as the cache key.
+     * @return {Promise} A matching response, if found.
+     */
+    async cacheMatch(key) {
+        const request = toRequest(key);
+        let cachedResponse;
+        const { cacheName, matchOptions } = this._strategy;
+        const effectiveRequest = await this.getCacheKey(request, 'read');
+        const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });
+        cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);
+        if (process.env.NODE_ENV !== 'production') {
+            if (cachedResponse) {
+                logger.debug(`Found a cached response in '${cacheName}'.`);
+            }
+            else {
+                logger.debug(`No cached response found in '${cacheName}'.`);
+            }
+        }
+        for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {
+            cachedResponse =
+                (await callback({
+                    cacheName,
+                    matchOptions,
+                    cachedResponse,
+                    request: effectiveRequest,
+                    event: this.event,
+                })) || undefined;
+        }
+        return cachedResponse;
+    }
+    /**
+     * Puts a request/response pair in the cache (and invokes any applicable
+     * plugin callback methods) using the `cacheName` and `plugins` defined on
+     * the strategy object.
+     *
+     * The following plugin lifecycle methods are invoked when using this method:
+     * - cacheKeyWillBeUsed()
+     * - cacheWillUpdate()
+     * - cacheDidUpdate()
+     *
+     * @param {Request|string} key The request or URL to use as the cache key.
+     * @param {Response} response The response to cache.
+     * @return {Promise} `false` if a cacheWillUpdate caused the response
+     * not be cached, and `true` otherwise.
+     */
+    async cachePut(key, response) {
+        const request = toRequest(key);
+        // Run in the next task to avoid blocking other cache reads.
+        // https://github.com/w3c/ServiceWorker/issues/1397
+        await timeout(0);
+        const effectiveRequest = await this.getCacheKey(request, 'write');
+        if (process.env.NODE_ENV !== 'production') {
+            if (effectiveRequest.method && effectiveRequest.method !== 'GET') {
+                throw new WorkboxError('attempt-to-cache-non-get-request', {
+                    url: getFriendlyURL(effectiveRequest.url),
+                    method: effectiveRequest.method,
+                });
+            }
+            // See https://github.com/GoogleChrome/workbox/issues/2818
+            const vary = response.headers.get('Vary');
+            if (vary) {
+                logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +
+                    `has a 'Vary: ${vary}' header. ` +
+                    `Consider setting the {ignoreVary: true} option on your strategy ` +
+                    `to ensure cache matching and deletion works as expected.`);
+            }
+        }
+        if (!response) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.error(`Cannot cache non-existent response for ` +
+                    `'${getFriendlyURL(effectiveRequest.url)}'.`);
+            }
+            throw new WorkboxError('cache-put-with-no-response', {
+                url: getFriendlyURL(effectiveRequest.url),
+            });
+        }
+        const responseToCache = await this._ensureResponseSafeToCache(response);
+        if (!responseToCache) {
+            if (process.env.NODE_ENV !== 'production') {
+                logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +
+                    `will not be cached.`, responseToCache);
+            }
+            return false;
+        }
+        const { cacheName, matchOptions } = this._strategy;
+        const cache = await self.caches.open(cacheName);
+        const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');
+        const oldResponse = hasCacheUpdateCallback
+            ? await cacheMatchIgnoreParams(
+            // TODO(philipwalton): the `__WB_REVISION__` param is a precaching
+            // feature. Consider into ways to only add this behavior if using
+            // precaching.
+            cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)
+            : null;
+        if (process.env.NODE_ENV !== 'production') {
+            logger.debug(`Updating the '${cacheName}' cache with a new Response ` +
+                `for ${getFriendlyURL(effectiveRequest.url)}.`);
+        }
+        try {
+            await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);
+        }
+        catch (error) {
+            if (error instanceof Error) {
+                // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError
+                if (error.name === 'QuotaExceededError') {
+                    await executeQuotaErrorCallbacks();
+                }
+                throw error;
+            }
+        }
+        for (const callback of this.iterateCallbacks('cacheDidUpdate')) {
+            await callback({
+                cacheName,
+                oldResponse,
+                newResponse: responseToCache.clone(),
+                request: effectiveRequest,
+                event: this.event,
+            });
+        }
+        return true;
+    }
+    /**
+     * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and
+     * executes any of those callbacks found in sequence. The final `Request`
+     * object returned by the last plugin is treated as the cache key for cache
+     * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have
+     * been registered, the passed request is returned unmodified
+     *
+     * @param {Request} request
+     * @param {string} mode
+     * @return {Promise}
+     */
+    async getCacheKey(request, mode) {
+        const key = `${request.url} | ${mode}`;
+        if (!this._cacheKeys[key]) {
+            let effectiveRequest = request;
+            for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {
+                effectiveRequest = toRequest(await callback({
+                    mode,
+                    request: effectiveRequest,
+                    event: this.event,
+                    // params has a type any can't change right now.
+                    params: this.params, // eslint-disable-line
+                }));
+            }
+            this._cacheKeys[key] = effectiveRequest;
+        }
+        return this._cacheKeys[key];
+    }
+    /**
+     * Returns true if the strategy has at least one plugin with the given
+     * callback.
+     *
+     * @param {string} name The name of the callback to check for.
+     * @return {boolean}
+     */
+    hasCallback(name) {
+        for (const plugin of this._strategy.plugins) {
+            if (name in plugin) {
+                return true;
+            }
+        }
+        return false;
+    }
+    /**
+     * Runs all plugin callbacks matching the given name, in order, passing the
+     * given param object (merged ith the current plugin state) as the only
+     * argument.
+     *
+     * Note: since this method runs all plugins, it's not suitable for cases
+     * where the return value of a callback needs to be applied prior to calling
+     * the next callback. See
+     * {@link workbox-strategies.StrategyHandler#iterateCallbacks}
+     * below for how to handle that case.
+     *
+     * @param {string} name The name of the callback to run within each plugin.
+     * @param {Object} param The object to pass as the first (and only) param
+     *     when executing each callback. This object will be merged with the
+     *     current plugin state prior to callback execution.
+     */
+    async runCallbacks(name, param) {
+        for (const callback of this.iterateCallbacks(name)) {
+            // TODO(philipwalton): not sure why `any` is needed. It seems like
+            // this should work with `as WorkboxPluginCallbackParam[C]`.
+            await callback(param);
+        }
+    }
+    /**
+     * Accepts a callback and returns an iterable of matching plugin callbacks,
+     * where each callback is wrapped with the current handler state (i.e. when
+     * you call each callback, whatever object parameter you pass it will
+     * be merged with the plugin's current state).
+     *
+     * @param {string} name The name fo the callback to run
+     * @return {Array}
+     */
+    *iterateCallbacks(name) {
+        for (const plugin of this._strategy.plugins) {
+            if (typeof plugin[name] === 'function') {
+                const state = this._pluginStateMap.get(plugin);
+                const statefulCallback = (param) => {
+                    const statefulParam = Object.assign(Object.assign({}, param), { state });
+                    // TODO(philipwalton): not sure why `any` is needed. It seems like
+                    // this should work with `as WorkboxPluginCallbackParam[C]`.
+                    return plugin[name](statefulParam);
+                };
+                yield statefulCallback;
+            }
+        }
+    }
+    /**
+     * Adds a promise to the
+     * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}
+     * of the event associated with the request being handled (usually a
+     * `FetchEvent`).
+     *
+     * Note: you can await
+     * {@link workbox-strategies.StrategyHandler~doneWaiting}
+     * to know when all added promises have settled.
+     *
+     * @param {Promise} promise A promise to add to the extend lifetime promises
+     *     of the event that triggered the request.
+     */
+    waitUntil(promise) {
+        this._extendLifetimePromises.push(promise);
+        return promise;
+    }
+    /**
+     * Returns a promise that resolves once all promises passed to
+     * {@link workbox-strategies.StrategyHandler~waitUntil}
+     * have settled.
+     *
+     * Note: any work done after `doneWaiting()` settles should be manually
+     * passed to an event's `waitUntil()` method (not this handler's
+     * `waitUntil()` method), otherwise the service worker thread may be killed
+     * prior to your work completing.
+     */
+    async doneWaiting() {
+        while (this._extendLifetimePromises.length) {
+            const promises = this._extendLifetimePromises.splice(0);
+            const result = await Promise.allSettled(promises);
+            const firstRejection = result.find((i) => i.status === 'rejected');
+            if (firstRejection) {
+                throw firstRejection.reason;
+            }
+        }
+    }
+    /**
+     * Stops running the strategy and immediately resolves any pending
+     * `waitUntil()` promises.
+     */
+    destroy() {
+        this._handlerDeferred.resolve(null);
+    }
+    /**
+     * This method will call cacheWillUpdate on the available plugins (or use
+     * status === 200) to determine if the Response is safe and valid to cache.
+     *
+     * @param {Request} options.request
+     * @param {Response} options.response
+     * @return {Promise}
+     *
+     * @private
+     */
+    async _ensureResponseSafeToCache(response) {
+        let responseToCache = response;
+        let pluginsUsed = false;
+        for (const callback of this.iterateCallbacks('cacheWillUpdate')) {
+            responseToCache =
+                (await callback({
+                    request: this.request,
+                    response: responseToCache,
+                    event: this.event,
+                })) || undefined;
+            pluginsUsed = true;
+            if (!responseToCache) {
+                break;
+            }
+        }
+        if (!pluginsUsed) {
+            if (responseToCache && responseToCache.status !== 200) {
+                responseToCache = undefined;
+            }
+            if (process.env.NODE_ENV !== 'production') {
+                if (responseToCache) {
+                    if (responseToCache.status !== 200) {
+                        if (responseToCache.status === 0) {
+                            logger.warn(`The response for '${this.request.url}' ` +
+                                `is an opaque response. The caching strategy that you're ` +
+                                `using will not cache opaque responses by default.`);
+                        }
+                        else {
+                            logger.debug(`The response for '${this.request.url}' ` +
+                                `returned a status code of '${response.status}' and won't ` +
+                                `be cached as a result.`);
+                        }
+                    }
+                }
+            }
+        }
+        return responseToCache;
+    }
+}
+export { StrategyHandler };
diff --git a/tools/ui/node_modules/workbox-strategies/StrategyHandler.mjs b/tools/ui/node_modules/workbox-strategies/StrategyHandler.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..358b2ef4ccf7767c3c98059f68db4e876f1d08e5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/StrategyHandler.mjs
@@ -0,0 +1 @@
+export * from './StrategyHandler.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/_version.d.ts b/tools/ui/node_modules/workbox-strategies/_version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tools/ui/node_modules/workbox-strategies/_version.js b/tools/ui/node_modules/workbox-strategies/_version.js
new file mode 100644
index 0000000000000000000000000000000000000000..dfd2ca119789c37517e5d75d5abda8b99b10fc26
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/_version.js
@@ -0,0 +1,6 @@
+"use strict";
+// @ts-ignore
+try {
+    self['workbox:strategies:7.4.0'] && _();
+}
+catch (e) { }
diff --git a/tools/ui/node_modules/workbox-strategies/_version.mjs b/tools/ui/node_modules/workbox-strategies/_version.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..a4c4cc6d02baacbeba73ab09247a4637d427cd8c
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/_version.mjs
@@ -0,0 +1 @@
+try{self['workbox:strategies:7.4.1']&&_()}catch(e){}// eslint-disable-line
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..cc1581fd05cdcc888c0f201381cceb742372a6df
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js
@@ -0,0 +1,1338 @@
+this.workbox = this.workbox || {};
+this.workbox.strategies = (function (exports, assert_js, logger_js, WorkboxError_js, cacheNames_js, getFriendlyURL_js, cacheMatchIgnoreParams_js, Deferred_js, executeQuotaErrorCallbacks_js, timeout_js) {
+    'use strict';
+
+    // @ts-ignore
+    try {
+      self['workbox:strategies:7.4.0'] && _();
+    } catch (e) {}
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    function toRequest(input) {
+      return typeof input === 'string' ? new Request(input) : input;
+    }
+    /**
+     * A class created every time a Strategy instance calls
+     * {@link workbox-strategies.Strategy~handle} or
+     * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and
+     * cache actions around plugin callbacks and keeps track of when the strategy
+     * is "done" (i.e. all added `event.waitUntil()` promises have resolved).
+     *
+     * @memberof workbox-strategies
+     */
+    class StrategyHandler {
+      /**
+       * Creates a new instance associated with the passed strategy and event
+       * that's handling the request.
+       *
+       * The constructor also initializes the state that will be passed to each of
+       * the plugins handling this request.
+       *
+       * @param {workbox-strategies.Strategy} strategy
+       * @param {Object} options
+       * @param {Request|string} options.request A request to run this strategy for.
+       * @param {ExtendableEvent} options.event The event associated with the
+       *     request.
+       * @param {URL} [options.url]
+       * @param {*} [options.params] The return value from the
+       *     {@link workbox-routing~matchCallback} (if applicable).
+       */
+      constructor(strategy, options) {
+        this._cacheKeys = {};
+        /**
+         * The request the strategy is performing (passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * @name request
+         * @instance
+         * @type {Request}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * The event associated with this request.
+         * @name event
+         * @instance
+         * @type {ExtendableEvent}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * A `URL` instance of `request.url` (if passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * Note: the `url` param will be present if the strategy was invoked
+         * from a workbox `Route` object.
+         * @name url
+         * @instance
+         * @type {URL|undefined}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        /**
+         * A `param` value (if passed to the strategy's
+         * `handle()` or `handleAll()` method).
+         * Note: the `param` param will be present if the strategy was invoked
+         * from a workbox `Route` object and the
+         * {@link workbox-routing~matchCallback} returned
+         * a truthy value (it will be that value).
+         * @name params
+         * @instance
+         * @type {*|undefined}
+         * @memberof workbox-strategies.StrategyHandler
+         */
+        {
+          assert_js.assert.isInstance(options.event, ExtendableEvent, {
+            moduleName: 'workbox-strategies',
+            className: 'StrategyHandler',
+            funcName: 'constructor',
+            paramName: 'options.event'
+          });
+        }
+        Object.assign(this, options);
+        this.event = options.event;
+        this._strategy = strategy;
+        this._handlerDeferred = new Deferred_js.Deferred();
+        this._extendLifetimePromises = [];
+        // Copy the plugins list (since it's mutable on the strategy),
+        // so any mutations don't affect this handler instance.
+        this._plugins = [...strategy.plugins];
+        this._pluginStateMap = new Map();
+        for (const plugin of this._plugins) {
+          this._pluginStateMap.set(plugin, {});
+        }
+        this.event.waitUntil(this._handlerDeferred.promise);
+      }
+      /**
+       * Fetches a given request (and invokes any applicable plugin callback
+       * methods) using the `fetchOptions` (for non-navigation requests) and
+       * `plugins` defined on the `Strategy` object.
+       *
+       * The following plugin lifecycle methods are invoked when using this method:
+       * - `requestWillFetch()`
+       * - `fetchDidSucceed()`
+       * - `fetchDidFail()`
+       *
+       * @param {Request|string} input The URL or request to fetch.
+       * @return {Promise}
+       */
+      async fetch(input) {
+        const {
+          event
+        } = this;
+        let request = toRequest(input);
+        if (request.mode === 'navigate' && event instanceof FetchEvent && event.preloadResponse) {
+          const possiblePreloadResponse = await event.preloadResponse;
+          if (possiblePreloadResponse) {
+            {
+              logger_js.logger.log(`Using a preloaded navigation response for ` + `'${getFriendlyURL_js.getFriendlyURL(request.url)}'`);
+            }
+            return possiblePreloadResponse;
+          }
+        }
+        // If there is a fetchDidFail plugin, we need to save a clone of the
+        // original request before it's either modified by a requestWillFetch
+        // plugin or before the original request's body is consumed via fetch().
+        const originalRequest = this.hasCallback('fetchDidFail') ? request.clone() : null;
+        try {
+          for (const cb of this.iterateCallbacks('requestWillFetch')) {
+            request = await cb({
+              request: request.clone(),
+              event
+            });
+          }
+        } catch (err) {
+          if (err instanceof Error) {
+            throw new WorkboxError_js.WorkboxError('plugin-error-request-will-fetch', {
+              thrownErrorMessage: err.message
+            });
+          }
+        }
+        // The request can be altered by plugins with `requestWillFetch` making
+        // the original request (most likely from a `fetch` event) different
+        // from the Request we make. Pass both to `fetchDidFail` to aid debugging.
+        const pluginFilteredRequest = request.clone();
+        try {
+          let fetchResponse;
+          // See https://github.com/GoogleChrome/workbox/issues/1796
+          fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);
+          if ("dev" !== 'production') {
+            logger_js.logger.debug(`Network request for ` + `'${getFriendlyURL_js.getFriendlyURL(request.url)}' returned a response with ` + `status '${fetchResponse.status}'.`);
+          }
+          for (const callback of this.iterateCallbacks('fetchDidSucceed')) {
+            fetchResponse = await callback({
+              event,
+              request: pluginFilteredRequest,
+              response: fetchResponse
+            });
+          }
+          return fetchResponse;
+        } catch (error) {
+          {
+            logger_js.logger.log(`Network request for ` + `'${getFriendlyURL_js.getFriendlyURL(request.url)}' threw an error.`, error);
+          }
+          // `originalRequest` will only exist if a `fetchDidFail` callback
+          // is being used (see above).
+          if (originalRequest) {
+            await this.runCallbacks('fetchDidFail', {
+              error: error,
+              event,
+              originalRequest: originalRequest.clone(),
+              request: pluginFilteredRequest.clone()
+            });
+          }
+          throw error;
+        }
+      }
+      /**
+       * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on
+       * the response generated by `this.fetch()`.
+       *
+       * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,
+       * so you do not have to manually call `waitUntil()` on the event.
+       *
+       * @param {Request|string} input The request or URL to fetch and cache.
+       * @return {Promise}
+       */
+      async fetchAndCachePut(input) {
+        const response = await this.fetch(input);
+        const responseClone = response.clone();
+        void this.waitUntil(this.cachePut(input, responseClone));
+        return response;
+      }
+      /**
+       * Matches a request from the cache (and invokes any applicable plugin
+       * callback methods) using the `cacheName`, `matchOptions`, and `plugins`
+       * defined on the strategy object.
+       *
+       * The following plugin lifecycle methods are invoked when using this method:
+       * - cacheKeyWillBeUsed()
+       * - cachedResponseWillBeUsed()
+       *
+       * @param {Request|string} key The Request or URL to use as the cache key.
+       * @return {Promise} A matching response, if found.
+       */
+      async cacheMatch(key) {
+        const request = toRequest(key);
+        let cachedResponse;
+        const {
+          cacheName,
+          matchOptions
+        } = this._strategy;
+        const effectiveRequest = await this.getCacheKey(request, 'read');
+        const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), {
+          cacheName
+        });
+        cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);
+        {
+          if (cachedResponse) {
+            logger_js.logger.debug(`Found a cached response in '${cacheName}'.`);
+          } else {
+            logger_js.logger.debug(`No cached response found in '${cacheName}'.`);
+          }
+        }
+        for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {
+          cachedResponse = (await callback({
+            cacheName,
+            matchOptions,
+            cachedResponse,
+            request: effectiveRequest,
+            event: this.event
+          })) || undefined;
+        }
+        return cachedResponse;
+      }
+      /**
+       * Puts a request/response pair in the cache (and invokes any applicable
+       * plugin callback methods) using the `cacheName` and `plugins` defined on
+       * the strategy object.
+       *
+       * The following plugin lifecycle methods are invoked when using this method:
+       * - cacheKeyWillBeUsed()
+       * - cacheWillUpdate()
+       * - cacheDidUpdate()
+       *
+       * @param {Request|string} key The request or URL to use as the cache key.
+       * @param {Response} response The response to cache.
+       * @return {Promise} `false` if a cacheWillUpdate caused the response
+       * not be cached, and `true` otherwise.
+       */
+      async cachePut(key, response) {
+        const request = toRequest(key);
+        // Run in the next task to avoid blocking other cache reads.
+        // https://github.com/w3c/ServiceWorker/issues/1397
+        await timeout_js.timeout(0);
+        const effectiveRequest = await this.getCacheKey(request, 'write');
+        {
+          if (effectiveRequest.method && effectiveRequest.method !== 'GET') {
+            throw new WorkboxError_js.WorkboxError('attempt-to-cache-non-get-request', {
+              url: getFriendlyURL_js.getFriendlyURL(effectiveRequest.url),
+              method: effectiveRequest.method
+            });
+          }
+          // See https://github.com/GoogleChrome/workbox/issues/2818
+          const vary = response.headers.get('Vary');
+          if (vary) {
+            logger_js.logger.debug(`The response for ${getFriendlyURL_js.getFriendlyURL(effectiveRequest.url)} ` + `has a 'Vary: ${vary}' header. ` + `Consider setting the {ignoreVary: true} option on your strategy ` + `to ensure cache matching and deletion works as expected.`);
+          }
+        }
+        if (!response) {
+          {
+            logger_js.logger.error(`Cannot cache non-existent response for ` + `'${getFriendlyURL_js.getFriendlyURL(effectiveRequest.url)}'.`);
+          }
+          throw new WorkboxError_js.WorkboxError('cache-put-with-no-response', {
+            url: getFriendlyURL_js.getFriendlyURL(effectiveRequest.url)
+          });
+        }
+        const responseToCache = await this._ensureResponseSafeToCache(response);
+        if (!responseToCache) {
+          {
+            logger_js.logger.debug(`Response '${getFriendlyURL_js.getFriendlyURL(effectiveRequest.url)}' ` + `will not be cached.`, responseToCache);
+          }
+          return false;
+        }
+        const {
+          cacheName,
+          matchOptions
+        } = this._strategy;
+        const cache = await self.caches.open(cacheName);
+        const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');
+        const oldResponse = hasCacheUpdateCallback ? await cacheMatchIgnoreParams_js.cacheMatchIgnoreParams(
+        // TODO(philipwalton): the `__WB_REVISION__` param is a precaching
+        // feature. Consider into ways to only add this behavior if using
+        // precaching.
+        cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions) : null;
+        {
+          logger_js.logger.debug(`Updating the '${cacheName}' cache with a new Response ` + `for ${getFriendlyURL_js.getFriendlyURL(effectiveRequest.url)}.`);
+        }
+        try {
+          await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);
+        } catch (error) {
+          if (error instanceof Error) {
+            // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError
+            if (error.name === 'QuotaExceededError') {
+              await executeQuotaErrorCallbacks_js.executeQuotaErrorCallbacks();
+            }
+            throw error;
+          }
+        }
+        for (const callback of this.iterateCallbacks('cacheDidUpdate')) {
+          await callback({
+            cacheName,
+            oldResponse,
+            newResponse: responseToCache.clone(),
+            request: effectiveRequest,
+            event: this.event
+          });
+        }
+        return true;
+      }
+      /**
+       * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and
+       * executes any of those callbacks found in sequence. The final `Request`
+       * object returned by the last plugin is treated as the cache key for cache
+       * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have
+       * been registered, the passed request is returned unmodified
+       *
+       * @param {Request} request
+       * @param {string} mode
+       * @return {Promise}
+       */
+      async getCacheKey(request, mode) {
+        const key = `${request.url} | ${mode}`;
+        if (!this._cacheKeys[key]) {
+          let effectiveRequest = request;
+          for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {
+            effectiveRequest = toRequest(await callback({
+              mode,
+              request: effectiveRequest,
+              event: this.event,
+              // params has a type any can't change right now.
+              params: this.params // eslint-disable-line
+            }));
+          }
+          this._cacheKeys[key] = effectiveRequest;
+        }
+        return this._cacheKeys[key];
+      }
+      /**
+       * Returns true if the strategy has at least one plugin with the given
+       * callback.
+       *
+       * @param {string} name The name of the callback to check for.
+       * @return {boolean}
+       */
+      hasCallback(name) {
+        for (const plugin of this._strategy.plugins) {
+          if (name in plugin) {
+            return true;
+          }
+        }
+        return false;
+      }
+      /**
+       * Runs all plugin callbacks matching the given name, in order, passing the
+       * given param object (merged ith the current plugin state) as the only
+       * argument.
+       *
+       * Note: since this method runs all plugins, it's not suitable for cases
+       * where the return value of a callback needs to be applied prior to calling
+       * the next callback. See
+       * {@link workbox-strategies.StrategyHandler#iterateCallbacks}
+       * below for how to handle that case.
+       *
+       * @param {string} name The name of the callback to run within each plugin.
+       * @param {Object} param The object to pass as the first (and only) param
+       *     when executing each callback. This object will be merged with the
+       *     current plugin state prior to callback execution.
+       */
+      async runCallbacks(name, param) {
+        for (const callback of this.iterateCallbacks(name)) {
+          // TODO(philipwalton): not sure why `any` is needed. It seems like
+          // this should work with `as WorkboxPluginCallbackParam[C]`.
+          await callback(param);
+        }
+      }
+      /**
+       * Accepts a callback and returns an iterable of matching plugin callbacks,
+       * where each callback is wrapped with the current handler state (i.e. when
+       * you call each callback, whatever object parameter you pass it will
+       * be merged with the plugin's current state).
+       *
+       * @param {string} name The name fo the callback to run
+       * @return {Array}
+       */
+      *iterateCallbacks(name) {
+        for (const plugin of this._strategy.plugins) {
+          if (typeof plugin[name] === 'function') {
+            const state = this._pluginStateMap.get(plugin);
+            const statefulCallback = param => {
+              const statefulParam = Object.assign(Object.assign({}, param), {
+                state
+              });
+              // TODO(philipwalton): not sure why `any` is needed. It seems like
+              // this should work with `as WorkboxPluginCallbackParam[C]`.
+              return plugin[name](statefulParam);
+            };
+            yield statefulCallback;
+          }
+        }
+      }
+      /**
+       * Adds a promise to the
+       * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}
+       * of the event associated with the request being handled (usually a
+       * `FetchEvent`).
+       *
+       * Note: you can await
+       * {@link workbox-strategies.StrategyHandler~doneWaiting}
+       * to know when all added promises have settled.
+       *
+       * @param {Promise} promise A promise to add to the extend lifetime promises
+       *     of the event that triggered the request.
+       */
+      waitUntil(promise) {
+        this._extendLifetimePromises.push(promise);
+        return promise;
+      }
+      /**
+       * Returns a promise that resolves once all promises passed to
+       * {@link workbox-strategies.StrategyHandler~waitUntil}
+       * have settled.
+       *
+       * Note: any work done after `doneWaiting()` settles should be manually
+       * passed to an event's `waitUntil()` method (not this handler's
+       * `waitUntil()` method), otherwise the service worker thread may be killed
+       * prior to your work completing.
+       */
+      async doneWaiting() {
+        while (this._extendLifetimePromises.length) {
+          const promises = this._extendLifetimePromises.splice(0);
+          const result = await Promise.allSettled(promises);
+          const firstRejection = result.find(i => i.status === 'rejected');
+          if (firstRejection) {
+            throw firstRejection.reason;
+          }
+        }
+      }
+      /**
+       * Stops running the strategy and immediately resolves any pending
+       * `waitUntil()` promises.
+       */
+      destroy() {
+        this._handlerDeferred.resolve(null);
+      }
+      /**
+       * This method will call cacheWillUpdate on the available plugins (or use
+       * status === 200) to determine if the Response is safe and valid to cache.
+       *
+       * @param {Request} options.request
+       * @param {Response} options.response
+       * @return {Promise}
+       *
+       * @private
+       */
+      async _ensureResponseSafeToCache(response) {
+        let responseToCache = response;
+        let pluginsUsed = false;
+        for (const callback of this.iterateCallbacks('cacheWillUpdate')) {
+          responseToCache = (await callback({
+            request: this.request,
+            response: responseToCache,
+            event: this.event
+          })) || undefined;
+          pluginsUsed = true;
+          if (!responseToCache) {
+            break;
+          }
+        }
+        if (!pluginsUsed) {
+          if (responseToCache && responseToCache.status !== 200) {
+            responseToCache = undefined;
+          }
+          {
+            if (responseToCache) {
+              if (responseToCache.status !== 200) {
+                if (responseToCache.status === 0) {
+                  logger_js.logger.warn(`The response for '${this.request.url}' ` + `is an opaque response. The caching strategy that you're ` + `using will not cache opaque responses by default.`);
+                } else {
+                  logger_js.logger.debug(`The response for '${this.request.url}' ` + `returned a status code of '${response.status}' and won't ` + `be cached as a result.`);
+                }
+              }
+            }
+          }
+        }
+        return responseToCache;
+      }
+    }
+
+    /*
+      Copyright 2020 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An abstract base class that all other strategy classes must extend from:
+     *
+     * @memberof workbox-strategies
+     */
+    class Strategy {
+      /**
+       * Creates a new instance of the strategy and sets all documented option
+       * properties as public instance properties.
+       *
+       * Note: if a custom strategy class extends the base Strategy class and does
+       * not need more than these properties, it does not need to define its own
+       * constructor.
+       *
+       * @param {Object} [options]
+       * @param {string} [options.cacheName] Cache name to store and retrieve
+       * requests. Defaults to the cache names provided by
+       * {@link workbox-core.cacheNames}.
+       * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+       * to use in conjunction with this caching strategy.
+       * @param {Object} [options.fetchOptions] Values passed along to the
+       * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+       * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+       * `fetch()` requests made by this strategy.
+       * @param {Object} [options.matchOptions] The
+       * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+       * for any `cache.match()` or `cache.put()` calls made by this strategy.
+       */
+      constructor(options = {}) {
+        /**
+         * Cache name to store and retrieve
+         * requests. Defaults to the cache names provided by
+         * {@link workbox-core.cacheNames}.
+         *
+         * @type {string}
+         */
+        this.cacheName = cacheNames_js.cacheNames.getRuntimeName(options.cacheName);
+        /**
+         * The list
+         * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+         * used by this strategy.
+         *
+         * @type {Array}
+         */
+        this.plugins = options.plugins || [];
+        /**
+         * Values passed along to the
+         * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
+         * of all fetch() requests made by this strategy.
+         *
+         * @type {Object}
+         */
+        this.fetchOptions = options.fetchOptions;
+        /**
+         * The
+         * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+         * for any `cache.match()` or `cache.put()` calls made by this strategy.
+         *
+         * @type {Object}
+         */
+        this.matchOptions = options.matchOptions;
+      }
+      /**
+       * Perform a request strategy and returns a `Promise` that will resolve with
+       * a `Response`, invoking all relevant plugin callbacks.
+       *
+       * When a strategy instance is registered with a Workbox
+       * {@link workbox-routing.Route}, this method is automatically
+       * called when the route matches.
+       *
+       * Alternatively, this method can be used in a standalone `FetchEvent`
+       * listener by passing it to `event.respondWith()`.
+       *
+       * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+       *     properties listed below.
+       * @param {Request|string} options.request A request to run this strategy for.
+       * @param {ExtendableEvent} options.event The event associated with the
+       *     request.
+       * @param {URL} [options.url]
+       * @param {*} [options.params]
+       */
+      handle(options) {
+        const [responseDone] = this.handleAll(options);
+        return responseDone;
+      }
+      /**
+       * Similar to {@link workbox-strategies.Strategy~handle}, but
+       * instead of just returning a `Promise` that resolves to a `Response` it
+       * it will return an tuple of `[response, done]` promises, where the former
+       * (`response`) is equivalent to what `handle()` returns, and the latter is a
+       * Promise that will resolve once any promises that were added to
+       * `event.waitUntil()` as part of performing the strategy have completed.
+       *
+       * You can await the `done` promise to ensure any extra work performed by
+       * the strategy (usually caching responses) completes successfully.
+       *
+       * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+       *     properties listed below.
+       * @param {Request|string} options.request A request to run this strategy for.
+       * @param {ExtendableEvent} options.event The event associated with the
+       *     request.
+       * @param {URL} [options.url]
+       * @param {*} [options.params]
+       * @return {Array} A tuple of [response, done]
+       *     promises that can be used to determine when the response resolves as
+       *     well as when the handler has completed all its work.
+       */
+      handleAll(options) {
+        // Allow for flexible options to be passed.
+        if (options instanceof FetchEvent) {
+          options = {
+            event: options,
+            request: options.request
+          };
+        }
+        const event = options.event;
+        const request = typeof options.request === 'string' ? new Request(options.request) : options.request;
+        const params = 'params' in options ? options.params : undefined;
+        const handler = new StrategyHandler(this, {
+          event,
+          request,
+          params
+        });
+        const responseDone = this._getResponse(handler, request, event);
+        const handlerDone = this._awaitComplete(responseDone, handler, request, event);
+        // Return an array of promises, suitable for use with Promise.all().
+        return [responseDone, handlerDone];
+      }
+      async _getResponse(handler, request, event) {
+        await handler.runCallbacks('handlerWillStart', {
+          event,
+          request
+        });
+        let response = undefined;
+        try {
+          response = await this._handle(request, handler);
+          // The "official" Strategy subclasses all throw this error automatically,
+          // but in case a third-party Strategy doesn't, ensure that we have a
+          // consistent failure when there's no response or an error response.
+          if (!response || response.type === 'error') {
+            throw new WorkboxError_js.WorkboxError('no-response', {
+              url: request.url
+            });
+          }
+        } catch (error) {
+          if (error instanceof Error) {
+            for (const callback of handler.iterateCallbacks('handlerDidError')) {
+              response = await callback({
+                error,
+                event,
+                request
+              });
+              if (response) {
+                break;
+              }
+            }
+          }
+          if (!response) {
+            throw error;
+          } else {
+            logger_js.logger.log(`While responding to '${getFriendlyURL_js.getFriendlyURL(request.url)}', ` + `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` + `a handlerDidError plugin.`);
+          }
+        }
+        for (const callback of handler.iterateCallbacks('handlerWillRespond')) {
+          response = await callback({
+            event,
+            request,
+            response
+          });
+        }
+        return response;
+      }
+      async _awaitComplete(responseDone, handler, request, event) {
+        let response;
+        let error;
+        try {
+          response = await responseDone;
+        } catch (error) {
+          // Ignore errors, as response errors should be caught via the `response`
+          // promise above. The `done` promise will only throw for errors in
+          // promises passed to `handler.waitUntil()`.
+        }
+        try {
+          await handler.runCallbacks('handlerDidRespond', {
+            event,
+            request,
+            response
+          });
+          await handler.doneWaiting();
+        } catch (waitUntilError) {
+          if (waitUntilError instanceof Error) {
+            error = waitUntilError;
+          }
+        }
+        await handler.runCallbacks('handlerDidComplete', {
+          event,
+          request,
+          response,
+          error: error
+        });
+        handler.destroy();
+        if (error) {
+          throw error;
+        }
+      }
+    }
+    /**
+     * Classes extending the `Strategy` based class should implement this method,
+     * and leverage the {@link workbox-strategies.StrategyHandler}
+     * arg to perform all fetching and cache logic, which will ensure all relevant
+     * cache, cache options, fetch options and plugins are used (per the current
+     * strategy instance).
+     *
+     * @name _handle
+     * @instance
+     * @abstract
+     * @function
+     * @param {Request} request
+     * @param {workbox-strategies.StrategyHandler} handler
+     * @return {Promise}
+     *
+     * @memberof workbox-strategies.Strategy
+     */
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const messages = {
+      strategyStart: (strategyName, request) => `Using ${strategyName} to respond to '${getFriendlyURL_js.getFriendlyURL(request.url)}'`,
+      printFinalResponse: response => {
+        if (response) {
+          logger_js.logger.groupCollapsed(`View the final response here.`);
+          logger_js.logger.log(response || '[No response returned]');
+          logger_js.logger.groupEnd();
+        }
+      }
+    };
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)
+     * request strategy.
+     *
+     * A cache first strategy is useful for assets that have been revisioned,
+     * such as URLs like `/styles/example.a8f5f1.css`, since they
+     * can be cached for long periods of time.
+     *
+     * If the network request fails, and there is no cache match, this will throw
+     * a `WorkboxError` exception.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-strategies
+     */
+    class CacheFirst extends Strategy {
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        const logs = [];
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-strategies',
+            className: this.constructor.name,
+            funcName: 'makeRequest',
+            paramName: 'request'
+          });
+        }
+        let response = await handler.cacheMatch(request);
+        let error = undefined;
+        if (!response) {
+          {
+            logs.push(`No response found in the '${this.cacheName}' cache. ` + `Will respond with a network request.`);
+          }
+          try {
+            response = await handler.fetchAndCachePut(request);
+          } catch (err) {
+            if (err instanceof Error) {
+              error = err;
+            }
+          }
+          {
+            if (response) {
+              logs.push(`Got response from network.`);
+            } else {
+              logs.push(`Unable to get a response from the network.`);
+            }
+          }
+        } else {
+          {
+            logs.push(`Found a cached response in the '${this.cacheName}' cache.`);
+          }
+        }
+        {
+          logger_js.logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+          for (const log of logs) {
+            logger_js.logger.log(log);
+          }
+          messages.printFinalResponse(response);
+          logger_js.logger.groupEnd();
+        }
+        if (!response) {
+          throw new WorkboxError_js.WorkboxError('no-response', {
+            url: request.url,
+            error
+          });
+        }
+        return response;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)
+     * request strategy.
+     *
+     * This class is useful if you want to take advantage of any
+     * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+     *
+     * If there is no cache match, this will throw a `WorkboxError` exception.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-strategies
+     */
+    class CacheOnly extends Strategy {
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-strategies',
+            className: this.constructor.name,
+            funcName: 'makeRequest',
+            paramName: 'request'
+          });
+        }
+        const response = await handler.cacheMatch(request);
+        {
+          logger_js.logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+          if (response) {
+            logger_js.logger.log(`Found a cached response in the '${this.cacheName}' ` + `cache.`);
+            messages.printFinalResponse(response);
+          } else {
+            logger_js.logger.log(`No response found in the '${this.cacheName}' cache.`);
+          }
+          logger_js.logger.groupEnd();
+        }
+        if (!response) {
+          throw new WorkboxError_js.WorkboxError('no-response', {
+            url: request.url
+          });
+        }
+        return response;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    const cacheOkAndOpaquePlugin = {
+      /**
+       * Returns a valid response (to allow caching) if the status is 200 (OK) or
+       * 0 (opaque).
+       *
+       * @param {Object} options
+       * @param {Response} options.response
+       * @return {Response|null}
+       *
+       * @private
+       */
+      cacheWillUpdate: async ({
+        response
+      }) => {
+        if (response.status === 200 || response.status === 0) {
+          return response;
+        }
+        return null;
+      }
+    };
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a
+     * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)
+     * request strategy.
+     *
+     * By default, this strategy will cache responses with a 200 status code as
+     * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+     * Opaque responses are are cross-origin requests where the response doesn't
+     * support [CORS](https://enable-cors.org/).
+     *
+     * If the network request fails, and there is no cache match, this will throw
+     * a `WorkboxError` exception.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-strategies
+     */
+    class NetworkFirst extends Strategy {
+      /**
+       * @param {Object} [options]
+       * @param {string} [options.cacheName] Cache name to store and retrieve
+       * requests. Defaults to cache names provided by
+       * {@link workbox-core.cacheNames}.
+       * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+       * to use in conjunction with this caching strategy.
+       * @param {Object} [options.fetchOptions] Values passed along to the
+       * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+       * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+       * `fetch()` requests made by this strategy.
+       * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+       * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+       * that fail to respond within the timeout will fallback to the cache.
+       *
+       * This option can be used to combat
+       * "[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}"
+       * scenarios.
+       */
+      constructor(options = {}) {
+        super(options);
+        // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+        if (!this.plugins.some(p => 'cacheWillUpdate' in p)) {
+          this.plugins.unshift(cacheOkAndOpaquePlugin);
+        }
+        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+        {
+          if (this._networkTimeoutSeconds) {
+            assert_js.assert.isType(this._networkTimeoutSeconds, 'number', {
+              moduleName: 'workbox-strategies',
+              className: this.constructor.name,
+              funcName: 'constructor',
+              paramName: 'networkTimeoutSeconds'
+            });
+          }
+        }
+      }
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        const logs = [];
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-strategies',
+            className: this.constructor.name,
+            funcName: 'handle',
+            paramName: 'makeRequest'
+          });
+        }
+        const promises = [];
+        let timeoutId;
+        if (this._networkTimeoutSeconds) {
+          const {
+            id,
+            promise
+          } = this._getTimeoutPromise({
+            request,
+            logs,
+            handler
+          });
+          timeoutId = id;
+          promises.push(promise);
+        }
+        const networkPromise = this._getNetworkPromise({
+          timeoutId,
+          request,
+          logs,
+          handler
+        });
+        promises.push(networkPromise);
+        const response = await handler.waitUntil((async () => {
+          // Promise.race() will resolve as soon as the first promise resolves.
+          return (await handler.waitUntil(Promise.race(promises))) || (
+          // If Promise.race() resolved with null, it might be due to a network
+          // timeout + a cache miss. If that were to happen, we'd rather wait until
+          // the networkPromise resolves instead of returning null.
+          // Note that it's fine to await an already-resolved promise, so we don't
+          // have to check to see if it's still "in flight".
+          await networkPromise);
+        })());
+        {
+          logger_js.logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+          for (const log of logs) {
+            logger_js.logger.log(log);
+          }
+          messages.printFinalResponse(response);
+          logger_js.logger.groupEnd();
+        }
+        if (!response) {
+          throw new WorkboxError_js.WorkboxError('no-response', {
+            url: request.url
+          });
+        }
+        return response;
+      }
+      /**
+       * @param {Object} options
+       * @param {Request} options.request
+       * @param {Array} options.logs A reference to the logs array
+       * @param {Event} options.event
+       * @return {Promise}
+       *
+       * @private
+       */
+      _getTimeoutPromise({
+        request,
+        logs,
+        handler
+      }) {
+        let timeoutId;
+        const timeoutPromise = new Promise(resolve => {
+          const onNetworkTimeout = async () => {
+            {
+              logs.push(`Timing out the network response at ` + `${this._networkTimeoutSeconds} seconds.`);
+            }
+            resolve(await handler.cacheMatch(request));
+          };
+          timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);
+        });
+        return {
+          promise: timeoutPromise,
+          id: timeoutId
+        };
+      }
+      /**
+       * @param {Object} options
+       * @param {number|undefined} options.timeoutId
+       * @param {Request} options.request
+       * @param {Array} options.logs A reference to the logs Array.
+       * @param {Event} options.event
+       * @return {Promise}
+       *
+       * @private
+       */
+      async _getNetworkPromise({
+        timeoutId,
+        request,
+        logs,
+        handler
+      }) {
+        let error;
+        let response;
+        try {
+          response = await handler.fetchAndCachePut(request);
+        } catch (fetchError) {
+          if (fetchError instanceof Error) {
+            error = fetchError;
+          }
+        }
+        if (timeoutId) {
+          clearTimeout(timeoutId);
+        }
+        {
+          if (response) {
+            logs.push(`Got response from network.`);
+          } else {
+            logs.push(`Unable to get a response from the network. Will respond ` + `with a cached response.`);
+          }
+        }
+        if (error || !response) {
+          response = await handler.cacheMatch(request);
+          {
+            if (response) {
+              logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache.`);
+            } else {
+              logs.push(`No response found in the '${this.cacheName}' cache.`);
+            }
+          }
+        }
+        return response;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a
+     * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)
+     * request strategy.
+     *
+     * This class is useful if you want to take advantage of any
+     * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+     *
+     * If the network request fails, this will throw a `WorkboxError` exception.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-strategies
+     */
+    class NetworkOnly extends Strategy {
+      /**
+       * @param {Object} [options]
+       * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+       * to use in conjunction with this caching strategy.
+       * @param {Object} [options.fetchOptions] Values passed along to the
+       * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+       * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+       * `fetch()` requests made by this strategy.
+       * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+       * that fail to respond within the timeout will result in a network error.
+       */
+      constructor(options = {}) {
+        super(options);
+        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+      }
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-strategies',
+            className: this.constructor.name,
+            funcName: '_handle',
+            paramName: 'request'
+          });
+        }
+        let error = undefined;
+        let response;
+        try {
+          const promises = [handler.fetch(request)];
+          if (this._networkTimeoutSeconds) {
+            const timeoutPromise = timeout_js.timeout(this._networkTimeoutSeconds * 1000);
+            promises.push(timeoutPromise);
+          }
+          response = await Promise.race(promises);
+          if (!response) {
+            throw new Error(`Timed out the network response after ` + `${this._networkTimeoutSeconds} seconds.`);
+          }
+        } catch (err) {
+          if (err instanceof Error) {
+            error = err;
+          }
+        }
+        {
+          logger_js.logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+          if (response) {
+            logger_js.logger.log(`Got response from network.`);
+          } else {
+            logger_js.logger.log(`Unable to get a response from the network.`);
+          }
+          messages.printFinalResponse(response);
+          logger_js.logger.groupEnd();
+        }
+        if (!response) {
+          throw new WorkboxError_js.WorkboxError('no-response', {
+            url: request.url,
+            error
+          });
+        }
+        return response;
+      }
+    }
+
+    /*
+      Copyright 2018 Google LLC
+
+      Use of this source code is governed by an MIT-style
+      license that can be found in the LICENSE file or at
+      https://opensource.org/licenses/MIT.
+    */
+    /**
+     * An implementation of a
+     * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)
+     * request strategy.
+     *
+     * Resources are requested from both the cache and the network in parallel.
+     * The strategy will respond with the cached version if available, otherwise
+     * wait for the network response. The cache is updated with the network response
+     * with each successful request.
+     *
+     * By default, this strategy will cache responses with a 200 status code as
+     * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+     * Opaque responses are cross-origin requests where the response doesn't
+     * support [CORS](https://enable-cors.org/).
+     *
+     * If the network request fails, and there is no cache match, this will throw
+     * a `WorkboxError` exception.
+     *
+     * @extends workbox-strategies.Strategy
+     * @memberof workbox-strategies
+     */
+    class StaleWhileRevalidate extends Strategy {
+      /**
+       * @param {Object} [options]
+       * @param {string} [options.cacheName] Cache name to store and retrieve
+       * requests. Defaults to cache names provided by
+       * {@link workbox-core.cacheNames}.
+       * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+       * to use in conjunction with this caching strategy.
+       * @param {Object} [options.fetchOptions] Values passed along to the
+       * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+       * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+       * `fetch()` requests made by this strategy.
+       * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+       */
+      constructor(options = {}) {
+        super(options);
+        // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+        if (!this.plugins.some(p => 'cacheWillUpdate' in p)) {
+          this.plugins.unshift(cacheOkAndOpaquePlugin);
+        }
+      }
+      /**
+       * @private
+       * @param {Request|string} request A request to run this strategy for.
+       * @param {workbox-strategies.StrategyHandler} handler The event that
+       *     triggered the request.
+       * @return {Promise}
+       */
+      async _handle(request, handler) {
+        const logs = [];
+        {
+          assert_js.assert.isInstance(request, Request, {
+            moduleName: 'workbox-strategies',
+            className: this.constructor.name,
+            funcName: 'handle',
+            paramName: 'request'
+          });
+        }
+        const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {
+          // Swallow this error because a 'no-response' error will be thrown in
+          // main handler return flow. This will be in the `waitUntil()` flow.
+        });
+        void handler.waitUntil(fetchAndCachePromise);
+        let response = await handler.cacheMatch(request);
+        let error;
+        if (response) {
+          {
+            logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache. Will update with the network response in the background.`);
+          }
+        } else {
+          {
+            logs.push(`No response found in the '${this.cacheName}' cache. ` + `Will wait for the network response.`);
+          }
+          try {
+            // NOTE(philipwalton): Really annoying that we have to type cast here.
+            // https://github.com/microsoft/TypeScript/issues/20006
+            response = await fetchAndCachePromise;
+          } catch (err) {
+            if (err instanceof Error) {
+              error = err;
+            }
+          }
+        }
+        {
+          logger_js.logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));
+          for (const log of logs) {
+            logger_js.logger.log(log);
+          }
+          messages.printFinalResponse(response);
+          logger_js.logger.groupEnd();
+        }
+        if (!response) {
+          throw new WorkboxError_js.WorkboxError('no-response', {
+            url: request.url,
+            error
+          });
+        }
+        return response;
+      }
+    }
+
+    exports.CacheFirst = CacheFirst;
+    exports.CacheOnly = CacheOnly;
+    exports.NetworkFirst = NetworkFirst;
+    exports.NetworkOnly = NetworkOnly;
+    exports.StaleWhileRevalidate = StaleWhileRevalidate;
+    exports.Strategy = Strategy;
+    exports.StrategyHandler = StrategyHandler;
+
+    return exports;
+
+})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private);
+//# sourceMappingURL=workbox-strategies.dev.js.map
diff --git a/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js.map b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..1d891dcb0fce5419417d6926a991e5a6b3286be5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.dev.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-strategies.dev.js","sources":["../_version.js","../StrategyHandler.js","../Strategy.js","../utils/messages.js","../CacheFirst.js","../CacheOnly.js","../plugins/cacheOkAndOpaquePlugin.js","../NetworkFirst.js","../NetworkOnly.js","../StaleWhileRevalidate.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:strategies:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n    return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n    /**\n     * Creates a new instance associated with the passed strategy and event\n     * that's handling the request.\n     *\n     * The constructor also initializes the state that will be passed to each of\n     * the plugins handling this request.\n     *\n     * @param {workbox-strategies.Strategy} strategy\n     * @param {Object} options\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params] The return value from the\n     *     {@link workbox-routing~matchCallback} (if applicable).\n     */\n    constructor(strategy, options) {\n        this._cacheKeys = {};\n        /**\n         * The request the strategy is performing (passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * @name request\n         * @instance\n         * @type {Request}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * The event associated with this request.\n         * @name event\n         * @instance\n         * @type {ExtendableEvent}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * A `URL` instance of `request.url` (if passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * Note: the `url` param will be present if the strategy was invoked\n         * from a workbox `Route` object.\n         * @name url\n         * @instance\n         * @type {URL|undefined}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * A `param` value (if passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * Note: the `param` param will be present if the strategy was invoked\n         * from a workbox `Route` object and the\n         * {@link workbox-routing~matchCallback} returned\n         * a truthy value (it will be that value).\n         * @name params\n         * @instance\n         * @type {*|undefined}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(options.event, ExtendableEvent, {\n                moduleName: 'workbox-strategies',\n                className: 'StrategyHandler',\n                funcName: 'constructor',\n                paramName: 'options.event',\n            });\n        }\n        Object.assign(this, options);\n        this.event = options.event;\n        this._strategy = strategy;\n        this._handlerDeferred = new Deferred();\n        this._extendLifetimePromises = [];\n        // Copy the plugins list (since it's mutable on the strategy),\n        // so any mutations don't affect this handler instance.\n        this._plugins = [...strategy.plugins];\n        this._pluginStateMap = new Map();\n        for (const plugin of this._plugins) {\n            this._pluginStateMap.set(plugin, {});\n        }\n        this.event.waitUntil(this._handlerDeferred.promise);\n    }\n    /**\n     * Fetches a given request (and invokes any applicable plugin callback\n     * methods) using the `fetchOptions` (for non-navigation requests) and\n     * `plugins` defined on the `Strategy` object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - `requestWillFetch()`\n     * - `fetchDidSucceed()`\n     * - `fetchDidFail()`\n     *\n     * @param {Request|string} input The URL or request to fetch.\n     * @return {Promise}\n     */\n    async fetch(input) {\n        const { event } = this;\n        let request = toRequest(input);\n        if (request.mode === 'navigate' &&\n            event instanceof FetchEvent &&\n            event.preloadResponse) {\n            const possiblePreloadResponse = (await event.preloadResponse);\n            if (possiblePreloadResponse) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Using a preloaded navigation response for ` +\n                        `'${getFriendlyURL(request.url)}'`);\n                }\n                return possiblePreloadResponse;\n            }\n        }\n        // If there is a fetchDidFail plugin, we need to save a clone of the\n        // original request before it's either modified by a requestWillFetch\n        // plugin or before the original request's body is consumed via fetch().\n        const originalRequest = this.hasCallback('fetchDidFail')\n            ? request.clone()\n            : null;\n        try {\n            for (const cb of this.iterateCallbacks('requestWillFetch')) {\n                request = await cb({ request: request.clone(), event });\n            }\n        }\n        catch (err) {\n            if (err instanceof Error) {\n                throw new WorkboxError('plugin-error-request-will-fetch', {\n                    thrownErrorMessage: err.message,\n                });\n            }\n        }\n        // The request can be altered by plugins with `requestWillFetch` making\n        // the original request (most likely from a `fetch` event) different\n        // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n        const pluginFilteredRequest = request.clone();\n        try {\n            let fetchResponse;\n            // See https://github.com/GoogleChrome/workbox/issues/1796\n            fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Network request for ` +\n                    `'${getFriendlyURL(request.url)}' returned a response with ` +\n                    `status '${fetchResponse.status}'.`);\n            }\n            for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n                fetchResponse = await callback({\n                    event,\n                    request: pluginFilteredRequest,\n                    response: fetchResponse,\n                });\n            }\n            return fetchResponse;\n        }\n        catch (error) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.log(`Network request for ` +\n                    `'${getFriendlyURL(request.url)}' threw an error.`, error);\n            }\n            // `originalRequest` will only exist if a `fetchDidFail` callback\n            // is being used (see above).\n            if (originalRequest) {\n                await this.runCallbacks('fetchDidFail', {\n                    error: error,\n                    event,\n                    originalRequest: originalRequest.clone(),\n                    request: pluginFilteredRequest.clone(),\n                });\n            }\n            throw error;\n        }\n    }\n    /**\n     * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n     * the response generated by `this.fetch()`.\n     *\n     * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n     * so you do not have to manually call `waitUntil()` on the event.\n     *\n     * @param {Request|string} input The request or URL to fetch and cache.\n     * @return {Promise}\n     */\n    async fetchAndCachePut(input) {\n        const response = await this.fetch(input);\n        const responseClone = response.clone();\n        void this.waitUntil(this.cachePut(input, responseClone));\n        return response;\n    }\n    /**\n     * Matches a request from the cache (and invokes any applicable plugin\n     * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n     * defined on the strategy object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - cacheKeyWillBeUsed()\n     * - cachedResponseWillBeUsed()\n     *\n     * @param {Request|string} key The Request or URL to use as the cache key.\n     * @return {Promise} A matching response, if found.\n     */\n    async cacheMatch(key) {\n        const request = toRequest(key);\n        let cachedResponse;\n        const { cacheName, matchOptions } = this._strategy;\n        const effectiveRequest = await this.getCacheKey(request, 'read');\n        const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n        cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n        if (process.env.NODE_ENV !== 'production') {\n            if (cachedResponse) {\n                logger.debug(`Found a cached response in '${cacheName}'.`);\n            }\n            else {\n                logger.debug(`No cached response found in '${cacheName}'.`);\n            }\n        }\n        for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n            cachedResponse =\n                (await callback({\n                    cacheName,\n                    matchOptions,\n                    cachedResponse,\n                    request: effectiveRequest,\n                    event: this.event,\n                })) || undefined;\n        }\n        return cachedResponse;\n    }\n    /**\n     * Puts a request/response pair in the cache (and invokes any applicable\n     * plugin callback methods) using the `cacheName` and `plugins` defined on\n     * the strategy object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - cacheKeyWillBeUsed()\n     * - cacheWillUpdate()\n     * - cacheDidUpdate()\n     *\n     * @param {Request|string} key The request or URL to use as the cache key.\n     * @param {Response} response The response to cache.\n     * @return {Promise} `false` if a cacheWillUpdate caused the response\n     * not be cached, and `true` otherwise.\n     */\n    async cachePut(key, response) {\n        const request = toRequest(key);\n        // Run in the next task to avoid blocking other cache reads.\n        // https://github.com/w3c/ServiceWorker/issues/1397\n        await timeout(0);\n        const effectiveRequest = await this.getCacheKey(request, 'write');\n        if (process.env.NODE_ENV !== 'production') {\n            if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n                throw new WorkboxError('attempt-to-cache-non-get-request', {\n                    url: getFriendlyURL(effectiveRequest.url),\n                    method: effectiveRequest.method,\n                });\n            }\n            // See https://github.com/GoogleChrome/workbox/issues/2818\n            const vary = response.headers.get('Vary');\n            if (vary) {\n                logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n                    `has a 'Vary: ${vary}' header. ` +\n                    `Consider setting the {ignoreVary: true} option on your strategy ` +\n                    `to ensure cache matching and deletion works as expected.`);\n            }\n        }\n        if (!response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.error(`Cannot cache non-existent response for ` +\n                    `'${getFriendlyURL(effectiveRequest.url)}'.`);\n            }\n            throw new WorkboxError('cache-put-with-no-response', {\n                url: getFriendlyURL(effectiveRequest.url),\n            });\n        }\n        const responseToCache = await this._ensureResponseSafeToCache(response);\n        if (!responseToCache) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n                    `will not be cached.`, responseToCache);\n            }\n            return false;\n        }\n        const { cacheName, matchOptions } = this._strategy;\n        const cache = await self.caches.open(cacheName);\n        const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n        const oldResponse = hasCacheUpdateCallback\n            ? await cacheMatchIgnoreParams(\n            // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n            // feature. Consider into ways to only add this behavior if using\n            // precaching.\n            cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n            : null;\n        if (process.env.NODE_ENV !== 'production') {\n            logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n                `for ${getFriendlyURL(effectiveRequest.url)}.`);\n        }\n        try {\n            await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n        }\n        catch (error) {\n            if (error instanceof Error) {\n                // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n                if (error.name === 'QuotaExceededError') {\n                    await executeQuotaErrorCallbacks();\n                }\n                throw error;\n            }\n        }\n        for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n            await callback({\n                cacheName,\n                oldResponse,\n                newResponse: responseToCache.clone(),\n                request: effectiveRequest,\n                event: this.event,\n            });\n        }\n        return true;\n    }\n    /**\n     * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n     * executes any of those callbacks found in sequence. The final `Request`\n     * object returned by the last plugin is treated as the cache key for cache\n     * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n     * been registered, the passed request is returned unmodified\n     *\n     * @param {Request} request\n     * @param {string} mode\n     * @return {Promise}\n     */\n    async getCacheKey(request, mode) {\n        const key = `${request.url} | ${mode}`;\n        if (!this._cacheKeys[key]) {\n            let effectiveRequest = request;\n            for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n                effectiveRequest = toRequest(await callback({\n                    mode,\n                    request: effectiveRequest,\n                    event: this.event,\n                    // params has a type any can't change right now.\n                    params: this.params, // eslint-disable-line\n                }));\n            }\n            this._cacheKeys[key] = effectiveRequest;\n        }\n        return this._cacheKeys[key];\n    }\n    /**\n     * Returns true if the strategy has at least one plugin with the given\n     * callback.\n     *\n     * @param {string} name The name of the callback to check for.\n     * @return {boolean}\n     */\n    hasCallback(name) {\n        for (const plugin of this._strategy.plugins) {\n            if (name in plugin) {\n                return true;\n            }\n        }\n        return false;\n    }\n    /**\n     * Runs all plugin callbacks matching the given name, in order, passing the\n     * given param object (merged ith the current plugin state) as the only\n     * argument.\n     *\n     * Note: since this method runs all plugins, it's not suitable for cases\n     * where the return value of a callback needs to be applied prior to calling\n     * the next callback. See\n     * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n     * below for how to handle that case.\n     *\n     * @param {string} name The name of the callback to run within each plugin.\n     * @param {Object} param The object to pass as the first (and only) param\n     *     when executing each callback. This object will be merged with the\n     *     current plugin state prior to callback execution.\n     */\n    async runCallbacks(name, param) {\n        for (const callback of this.iterateCallbacks(name)) {\n            // TODO(philipwalton): not sure why `any` is needed. It seems like\n            // this should work with `as WorkboxPluginCallbackParam[C]`.\n            await callback(param);\n        }\n    }\n    /**\n     * Accepts a callback and returns an iterable of matching plugin callbacks,\n     * where each callback is wrapped with the current handler state (i.e. when\n     * you call each callback, whatever object parameter you pass it will\n     * be merged with the plugin's current state).\n     *\n     * @param {string} name The name fo the callback to run\n     * @return {Array}\n     */\n    *iterateCallbacks(name) {\n        for (const plugin of this._strategy.plugins) {\n            if (typeof plugin[name] === 'function') {\n                const state = this._pluginStateMap.get(plugin);\n                const statefulCallback = (param) => {\n                    const statefulParam = Object.assign(Object.assign({}, param), { state });\n                    // TODO(philipwalton): not sure why `any` is needed. It seems like\n                    // this should work with `as WorkboxPluginCallbackParam[C]`.\n                    return plugin[name](statefulParam);\n                };\n                yield statefulCallback;\n            }\n        }\n    }\n    /**\n     * Adds a promise to the\n     * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n     * of the event associated with the request being handled (usually a\n     * `FetchEvent`).\n     *\n     * Note: you can await\n     * {@link workbox-strategies.StrategyHandler~doneWaiting}\n     * to know when all added promises have settled.\n     *\n     * @param {Promise} promise A promise to add to the extend lifetime promises\n     *     of the event that triggered the request.\n     */\n    waitUntil(promise) {\n        this._extendLifetimePromises.push(promise);\n        return promise;\n    }\n    /**\n     * Returns a promise that resolves once all promises passed to\n     * {@link workbox-strategies.StrategyHandler~waitUntil}\n     * have settled.\n     *\n     * Note: any work done after `doneWaiting()` settles should be manually\n     * passed to an event's `waitUntil()` method (not this handler's\n     * `waitUntil()` method), otherwise the service worker thread may be killed\n     * prior to your work completing.\n     */\n    async doneWaiting() {\n        while (this._extendLifetimePromises.length) {\n            const promises = this._extendLifetimePromises.splice(0);\n            const result = await Promise.allSettled(promises);\n            const firstRejection = result.find((i) => i.status === 'rejected');\n            if (firstRejection) {\n                throw firstRejection.reason;\n            }\n        }\n    }\n    /**\n     * Stops running the strategy and immediately resolves any pending\n     * `waitUntil()` promises.\n     */\n    destroy() {\n        this._handlerDeferred.resolve(null);\n    }\n    /**\n     * This method will call cacheWillUpdate on the available plugins (or use\n     * status === 200) to determine if the Response is safe and valid to cache.\n     *\n     * @param {Request} options.request\n     * @param {Response} options.response\n     * @return {Promise}\n     *\n     * @private\n     */\n    async _ensureResponseSafeToCache(response) {\n        let responseToCache = response;\n        let pluginsUsed = false;\n        for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n            responseToCache =\n                (await callback({\n                    request: this.request,\n                    response: responseToCache,\n                    event: this.event,\n                })) || undefined;\n            pluginsUsed = true;\n            if (!responseToCache) {\n                break;\n            }\n        }\n        if (!pluginsUsed) {\n            if (responseToCache && responseToCache.status !== 200) {\n                responseToCache = undefined;\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                if (responseToCache) {\n                    if (responseToCache.status !== 200) {\n                        if (responseToCache.status === 0) {\n                            logger.warn(`The response for '${this.request.url}' ` +\n                                `is an opaque response. The caching strategy that you're ` +\n                                `using will not cache opaque responses by default.`);\n                        }\n                        else {\n                            logger.debug(`The response for '${this.request.url}' ` +\n                                `returned a status code of '${response.status}' and won't ` +\n                                `be cached as a result.`);\n                        }\n                    }\n                }\n            }\n        }\n        return responseToCache;\n    }\n}\nexport { StrategyHandler };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n    /**\n     * Creates a new instance of the strategy and sets all documented option\n     * properties as public instance properties.\n     *\n     * Note: if a custom strategy class extends the base Strategy class and does\n     * not need more than these properties, it does not need to define its own\n     * constructor.\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to the cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] The\n     * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n     * for any `cache.match()` or `cache.put()` calls made by this strategy.\n     */\n    constructor(options = {}) {\n        /**\n         * Cache name to store and retrieve\n         * requests. Defaults to the cache names provided by\n         * {@link workbox-core.cacheNames}.\n         *\n         * @type {string}\n         */\n        this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n        /**\n         * The list\n         * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n         * used by this strategy.\n         *\n         * @type {Array}\n         */\n        this.plugins = options.plugins || [];\n        /**\n         * Values passed along to the\n         * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n         * of all fetch() requests made by this strategy.\n         *\n         * @type {Object}\n         */\n        this.fetchOptions = options.fetchOptions;\n        /**\n         * The\n         * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n         * for any `cache.match()` or `cache.put()` calls made by this strategy.\n         *\n         * @type {Object}\n         */\n        this.matchOptions = options.matchOptions;\n    }\n    /**\n     * Perform a request strategy and returns a `Promise` that will resolve with\n     * a `Response`, invoking all relevant plugin callbacks.\n     *\n     * When a strategy instance is registered with a Workbox\n     * {@link workbox-routing.Route}, this method is automatically\n     * called when the route matches.\n     *\n     * Alternatively, this method can be used in a standalone `FetchEvent`\n     * listener by passing it to `event.respondWith()`.\n     *\n     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n     *     properties listed below.\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params]\n     */\n    handle(options) {\n        const [responseDone] = this.handleAll(options);\n        return responseDone;\n    }\n    /**\n     * Similar to {@link workbox-strategies.Strategy~handle}, but\n     * instead of just returning a `Promise` that resolves to a `Response` it\n     * it will return an tuple of `[response, done]` promises, where the former\n     * (`response`) is equivalent to what `handle()` returns, and the latter is a\n     * Promise that will resolve once any promises that were added to\n     * `event.waitUntil()` as part of performing the strategy have completed.\n     *\n     * You can await the `done` promise to ensure any extra work performed by\n     * the strategy (usually caching responses) completes successfully.\n     *\n     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n     *     properties listed below.\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params]\n     * @return {Array} A tuple of [response, done]\n     *     promises that can be used to determine when the response resolves as\n     *     well as when the handler has completed all its work.\n     */\n    handleAll(options) {\n        // Allow for flexible options to be passed.\n        if (options instanceof FetchEvent) {\n            options = {\n                event: options,\n                request: options.request,\n            };\n        }\n        const event = options.event;\n        const request = typeof options.request === 'string'\n            ? new Request(options.request)\n            : options.request;\n        const params = 'params' in options ? options.params : undefined;\n        const handler = new StrategyHandler(this, { event, request, params });\n        const responseDone = this._getResponse(handler, request, event);\n        const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n        // Return an array of promises, suitable for use with Promise.all().\n        return [responseDone, handlerDone];\n    }\n    async _getResponse(handler, request, event) {\n        await handler.runCallbacks('handlerWillStart', { event, request });\n        let response = undefined;\n        try {\n            response = await this._handle(request, handler);\n            // The \"official\" Strategy subclasses all throw this error automatically,\n            // but in case a third-party Strategy doesn't, ensure that we have a\n            // consistent failure when there's no response or an error response.\n            if (!response || response.type === 'error') {\n                throw new WorkboxError('no-response', { url: request.url });\n            }\n        }\n        catch (error) {\n            if (error instanceof Error) {\n                for (const callback of handler.iterateCallbacks('handlerDidError')) {\n                    response = await callback({ error, event, request });\n                    if (response) {\n                        break;\n                    }\n                }\n            }\n            if (!response) {\n                throw error;\n            }\n            else if (process.env.NODE_ENV !== 'production') {\n                logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n                    `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n                    `a handlerDidError plugin.`);\n            }\n        }\n        for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n            response = await callback({ event, request, response });\n        }\n        return response;\n    }\n    async _awaitComplete(responseDone, handler, request, event) {\n        let response;\n        let error;\n        try {\n            response = await responseDone;\n        }\n        catch (error) {\n            // Ignore errors, as response errors should be caught via the `response`\n            // promise above. The `done` promise will only throw for errors in\n            // promises passed to `handler.waitUntil()`.\n        }\n        try {\n            await handler.runCallbacks('handlerDidRespond', {\n                event,\n                request,\n                response,\n            });\n            await handler.doneWaiting();\n        }\n        catch (waitUntilError) {\n            if (waitUntilError instanceof Error) {\n                error = waitUntilError;\n            }\n        }\n        await handler.runCallbacks('handlerDidComplete', {\n            event,\n            request,\n            response,\n            error: error,\n        });\n        handler.destroy();\n        if (error) {\n            throw error;\n        }\n    }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport '../_version.js';\nexport const messages = {\n    strategyStart: (strategyName, request) => `Using ${strategyName} to respond to '${getFriendlyURL(request.url)}'`,\n    printFinalResponse: (response) => {\n        if (response) {\n            logger.groupCollapsed(`View the final response here.`);\n            logger.log(response || '[No response returned]');\n            logger.groupEnd();\n        }\n    },\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass CacheFirst extends Strategy {\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'makeRequest',\n                paramName: 'request',\n            });\n        }\n        let response = await handler.cacheMatch(request);\n        let error = undefined;\n        if (!response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`No response found in the '${this.cacheName}' cache. ` +\n                    `Will respond with a network request.`);\n            }\n            try {\n                response = await handler.fetchAndCachePut(request);\n            }\n            catch (err) {\n                if (err instanceof Error) {\n                    error = err;\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                if (response) {\n                    logs.push(`Got response from network.`);\n                }\n                else {\n                    logs.push(`Unable to get a response from the network.`);\n                }\n            }\n        }\n        else {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`Found a cached response in the '${this.cacheName}' cache.`);\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { CacheFirst };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)\n * request strategy.\n *\n * This class is useful if you want to take advantage of any\n * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).\n *\n * If there is no cache match, this will throw a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass CacheOnly extends Strategy {\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'makeRequest',\n                paramName: 'request',\n            });\n        }\n        const response = await handler.cacheMatch(request);\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            if (response) {\n                logger.log(`Found a cached response in the '${this.cacheName}' ` + `cache.`);\n                messages.printFinalResponse(response);\n            }\n            else {\n                logger.log(`No response found in the '${this.cacheName}' cache.`);\n            }\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url });\n        }\n        return response;\n    }\n}\nexport { CacheOnly };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n    /**\n     * Returns a valid response (to allow caching) if the status is 200 (OK) or\n     * 0 (opaque).\n     *\n     * @param {Object} options\n     * @param {Response} options.response\n     * @return {Response|null}\n     *\n     * @private\n     */\n    cacheWillUpdate: async ({ response }) => {\n        if (response.status === 200 || response.status === 0) {\n            return response;\n        }\n        return null;\n    },\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass NetworkFirst extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n     * @param {number} [options.networkTimeoutSeconds] If set, any network requests\n     * that fail to respond within the timeout will fallback to the cache.\n     *\n     * This option can be used to combat\n     * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n     * scenarios.\n     */\n    constructor(options = {}) {\n        super(options);\n        // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n            this.plugins.unshift(cacheOkAndOpaquePlugin);\n        }\n        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n        if (process.env.NODE_ENV !== 'production') {\n            if (this._networkTimeoutSeconds) {\n                assert.isType(this._networkTimeoutSeconds, 'number', {\n                    moduleName: 'workbox-strategies',\n                    className: this.constructor.name,\n                    funcName: 'constructor',\n                    paramName: 'networkTimeoutSeconds',\n                });\n            }\n        }\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'handle',\n                paramName: 'makeRequest',\n            });\n        }\n        const promises = [];\n        let timeoutId;\n        if (this._networkTimeoutSeconds) {\n            const { id, promise } = this._getTimeoutPromise({ request, logs, handler });\n            timeoutId = id;\n            promises.push(promise);\n        }\n        const networkPromise = this._getNetworkPromise({\n            timeoutId,\n            request,\n            logs,\n            handler,\n        });\n        promises.push(networkPromise);\n        const response = await handler.waitUntil((async () => {\n            // Promise.race() will resolve as soon as the first promise resolves.\n            return ((await handler.waitUntil(Promise.race(promises))) ||\n                // If Promise.race() resolved with null, it might be due to a network\n                // timeout + a cache miss. If that were to happen, we'd rather wait until\n                // the networkPromise resolves instead of returning null.\n                // Note that it's fine to await an already-resolved promise, so we don't\n                // have to check to see if it's still \"in flight\".\n                (await networkPromise));\n        })());\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url });\n        }\n        return response;\n    }\n    /**\n     * @param {Object} options\n     * @param {Request} options.request\n     * @param {Array} options.logs A reference to the logs array\n     * @param {Event} options.event\n     * @return {Promise}\n     *\n     * @private\n     */\n    _getTimeoutPromise({ request, logs, handler, }) {\n        let timeoutId;\n        const timeoutPromise = new Promise((resolve) => {\n            const onNetworkTimeout = async () => {\n                if (process.env.NODE_ENV !== 'production') {\n                    logs.push(`Timing out the network response at ` +\n                        `${this._networkTimeoutSeconds} seconds.`);\n                }\n                resolve(await handler.cacheMatch(request));\n            };\n            timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n        });\n        return {\n            promise: timeoutPromise,\n            id: timeoutId,\n        };\n    }\n    /**\n     * @param {Object} options\n     * @param {number|undefined} options.timeoutId\n     * @param {Request} options.request\n     * @param {Array} options.logs A reference to the logs Array.\n     * @param {Event} options.event\n     * @return {Promise}\n     *\n     * @private\n     */\n    async _getNetworkPromise({ timeoutId, request, logs, handler, }) {\n        let error;\n        let response;\n        try {\n            response = await handler.fetchAndCachePut(request);\n        }\n        catch (fetchError) {\n            if (fetchError instanceof Error) {\n                error = fetchError;\n            }\n        }\n        if (timeoutId) {\n            clearTimeout(timeoutId);\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (response) {\n                logs.push(`Got response from network.`);\n            }\n            else {\n                logs.push(`Unable to get a response from the network. Will respond ` +\n                    `with a cached response.`);\n            }\n        }\n        if (error || !response) {\n            response = await handler.cacheMatch(request);\n            if (process.env.NODE_ENV !== 'production') {\n                if (response) {\n                    logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache.`);\n                }\n                else {\n                    logs.push(`No response found in the '${this.cacheName}' cache.`);\n                }\n            }\n        }\n        return response;\n    }\n}\nexport { NetworkFirst };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)\n * request strategy.\n *\n * This class is useful if you want to take advantage of any\n * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).\n *\n * If the network request fails, this will throw a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass NetworkOnly extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {number} [options.networkTimeoutSeconds] If set, any network requests\n     * that fail to respond within the timeout will result in a network error.\n     */\n    constructor(options = {}) {\n        super(options);\n        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: '_handle',\n                paramName: 'request',\n            });\n        }\n        let error = undefined;\n        let response;\n        try {\n            const promises = [\n                handler.fetch(request),\n            ];\n            if (this._networkTimeoutSeconds) {\n                const timeoutPromise = timeout(this._networkTimeoutSeconds * 1000);\n                promises.push(timeoutPromise);\n            }\n            response = await Promise.race(promises);\n            if (!response) {\n                throw new Error(`Timed out the network response after ` +\n                    `${this._networkTimeoutSeconds} seconds.`);\n            }\n        }\n        catch (err) {\n            if (err instanceof Error) {\n                error = err;\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            if (response) {\n                logger.log(`Got response from network.`);\n            }\n            else {\n                logger.log(`Unable to get a response from the network.`);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { NetworkOnly };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)\n * request strategy.\n *\n * Resources are requested from both the cache and the network in parallel.\n * The strategy will respond with the cached version if available, otherwise\n * wait for the network response. The cache is updated with the network response\n * with each successful request.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass StaleWhileRevalidate extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n     */\n    constructor(options = {}) {\n        super(options);\n        // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n            this.plugins.unshift(cacheOkAndOpaquePlugin);\n        }\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'handle',\n                paramName: 'request',\n            });\n        }\n        const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {\n            // Swallow this error because a 'no-response' error will be thrown in\n            // main handler return flow. This will be in the `waitUntil()` flow.\n        });\n        void handler.waitUntil(fetchAndCachePromise);\n        let response = await handler.cacheMatch(request);\n        let error;\n        if (response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`Found a cached response in the '${this.cacheName}'` +\n                    ` cache. Will update with the network response in the background.`);\n            }\n        }\n        else {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`No response found in the '${this.cacheName}' cache. ` +\n                    `Will wait for the network response.`);\n            }\n            try {\n                // NOTE(philipwalton): Really annoying that we have to type cast here.\n                // https://github.com/microsoft/TypeScript/issues/20006\n                response = (await fetchAndCachePromise);\n            }\n            catch (err) {\n                if (err instanceof Error) {\n                    error = err;\n                }\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { StaleWhileRevalidate };\n"],"names":["self","_","e","toRequest","input","Request","StrategyHandler","constructor","strategy","options","_cacheKeys","assert","isInstance","event","ExtendableEvent","moduleName","className","funcName","paramName","Object","assign","_strategy","_handlerDeferred","Deferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","Map","plugin","set","waitUntil","promise","fetch","request","mode","FetchEvent","preloadResponse","possiblePreloadResponse","logger","log","getFriendlyURL","url","originalRequest","hasCallback","clone","cb","iterateCallbacks","err","Error","WorkboxError","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","undefined","fetchOptions","process","debug","status","callback","response","error","runCallbacks","fetchAndCachePut","responseClone","cachePut","cacheMatch","key","cachedResponse","cacheName","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","match","timeout","method","vary","headers","get","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","cacheMatchIgnoreParams","put","name","executeQuotaErrorCallbacks","newResponse","params","param","state","statefulCallback","statefulParam","push","doneWaiting","length","promises","splice","result","Promise","allSettled","firstRejection","find","i","reason","destroy","resolve","pluginsUsed","warn","Strategy","cacheNames","getRuntimeName","handle","responseDone","handleAll","handler","_getResponse","handlerDone","_awaitComplete","_handle","type","toString","waitUntilError","messages","strategyStart","strategyName","printFinalResponse","groupCollapsed","groupEnd","CacheFirst","logs","CacheOnly","cacheOkAndOpaquePlugin","cacheWillUpdate","NetworkFirst","some","p","unshift","_networkTimeoutSeconds","networkTimeoutSeconds","isType","timeoutId","id","_getTimeoutPromise","networkPromise","_getNetworkPromise","race","timeoutPromise","onNetworkTimeout","setTimeout","fetchError","clearTimeout","NetworkOnly","StaleWhileRevalidate","fetchAndCachePromise","catch"],"mappings":";;;;IACA;IACA,IAAI;IACAA,EAAAA,IAAI,CAAC,0BAA0B,CAAC,IAAIC,CAAC,EAAE;IAC3C,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ICLZ;IACA;;IAEA;IACA;IACA;IACA;IAUA,SAASC,SAASA,CAACC,KAAK,EAAE;MACtB,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAG,IAAI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J,UAAA;IACJ,QAAA;IACJ,MAAA;IACJ,IAAA;IACA,IAAA,OAAOuB,eAAe;IAC1B,EAAA;IACJ;;ICvgBA;IACA;;IAEA;IACA;IACA;IACA;IAOA;IACA;IACA;IACA;IACA;IACA,MAAMgC,QAAQ,CAAC;IACX;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACI3G,EAAAA,WAAWA,CAACE,OAAO,GAAG,EAAE,EAAE;IACtB;IACR;IACA;IACA;IACA;IACA;IACA;QACQ,IAAI,CAAC6D,SAAS,GAAG6C,wBAAU,CAACC,cAAc,CAAC3G,OAAO,CAAC6D,SAAS,CAAC;IAC7D;IACR;IACA;IACA;IACA;IACA;IACA;IACQ,IAAA,IAAI,CAAC5C,OAAO,GAAGjB,OAAO,CAACiB,OAAO,IAAI,EAAE;IACpC;IACR;IACA;IACA;IACA;IACA;IACA;IACQ,IAAA,IAAI,CAAC8B,YAAY,GAAG/C,OAAO,CAAC+C,YAAY;IACxC;IACR;IACA;IACA;IACA;IACA;IACA;IACQ,IAAA,IAAI,CAACe,YAAY,GAAG9D,OAAO,CAAC8D,YAAY;IAC5C,EAAA;IACA;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACI8C,MAAMA,CAAC5G,OAAO,EAAE;QACZ,MAAM,CAAC6G,YAAY,CAAC,GAAG,IAAI,CAACC,SAAS,CAAC9G,OAAO,CAAC;IAC9C,IAAA,OAAO6G,YAAY;IACvB,EAAA;IACA;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACIC,SAASA,CAAC9G,OAAO,EAAE;IACf;QACA,IAAIA,OAAO,YAAY2B,UAAU,EAAE;IAC/B3B,MAAAA,OAAO,GAAG;IACN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AA,gEAAA,CAAiE,CAAC;IAC3E,MAAA;IACJ,IAAA,CAAC,MACI;IACD,MAA2C;YACvCiE,IAAI,CAACrC,IAAI,CAAE,CAAA,0BAAA,EAA4B,IAAI,CAAC5B,SAAU,CAAA,SAAA,CAAU,GAC3D,CAAA,mCAAA,CAAoC,CAAC;IAC9C,MAAA;UACA,IAAI;IACA;IACA;YACAT,QAAQ,GAAI,MAAMkG,oBAAqB;UAC3C,CAAC,CACD,OAAO/G,GAAG,EAAE;YACR,IAAIA,GAAG,YAAYC,KAAK,EAAE;IACtBa,UAAAA,KAAK,GAAGd,GAAG;IACf,QAAA;IACJ,MAAA;IACJ,IAAA;IACA,IAA2C;IACvCT,MAAAA,gBAAM,CAAC6F,cAAc,CAACJ,QAAQ,CAACC,aAAa,CAAC,IAAI,CAAC1H,WAAW,CAACmF,IAAI,EAAExD,OAAO,CAAC,CAAC;IAC7E,MAAA,KAAK,MAAMM,GAAG,IAAI+F,IAAI,EAAE;IACpBhG,QAAAA,gBAAM,CAACC,GAAG,CAACA,GAAG,CAAC;IACnB,MAAA;IACAwF,MAAAA,QAAQ,CAACG,kBAAkB,CAACtE,QAAQ,CAAC;UACrCtB,gBAAM,CAAC8F,QAAQ,EAAE;IACrB,IAAA;QACA,IAAI,CAACxE,QAAQ,EAAE;IACX,MAAA,MAAM,IAAIX,4BAAY,CAAC,aAAa,EAAE;YAAER,GAAG,EAAER,OAAO,CAACQ,GAAG;IAAEoB,QAAAA;IAAM,OAAC,CAAC;IACtE,IAAA;IACA,IAAA,OAAOD,QAAQ;IACnB,EAAA;IACJ;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js
new file mode 100644
index 0000000000000000000000000000000000000000..799f9413b212eec26f714edaf226f3879da990cc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js
@@ -0,0 +1,2 @@
+this.workbox=this.workbox||{},this.workbox.strategies=function(t,e,s,r,n,i,a,o,c){"use strict";try{self["workbox:strategies:7.4.0"]&&_()}catch(t){}function h(t){return"string"==typeof t?new Request(t):t}class l{constructor(t,e){this.l={},Object.assign(this,e),this.event=e.event,this.u=t,this.p=new n.Deferred,this.m=[],this.v=[...t.plugins],this.q=new Map;for(const t of this.v)this.q.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:s}=this;let r=h(t);if("navigate"===r.mode&&s instanceof FetchEvent&&s.preloadResponse){const t=await s.preloadResponse;if(t)return t}const n=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))r=await t({request:r.clone(),event:s})}catch(t){if(t instanceof Error)throw new e.WorkboxError("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=r.clone();try{let t;t=await fetch(r,"navigate"===r.mode?void 0:this.u.fetchOptions);for(const e of this.iterateCallbacks("fetchDidSucceed"))t=await e({event:s,request:i,response:t});return t}catch(t){throw n&&await this.runCallbacks("fetchDidFail",{error:t,event:s,originalRequest:n.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=h(t);let s;const{cacheName:r,matchOptions:n}=this.u,i=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},n),{cacheName:r});s=await caches.match(i,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:r,matchOptions:n,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,s){const n=h(t);await c.timeout(0);const o=await this.getCacheKey(n,"write");if(!s)throw new e.WorkboxError("cache-put-with-no-response",{url:a.getFriendlyURL(o.url)});const l=await this.g(s);if(!l)return!1;const{cacheName:w,matchOptions:u}=this.u,f=await self.caches.open(w),d=this.hasCallback("cacheDidUpdate"),p=d?await r.cacheMatchIgnoreParams(f,o.clone(),["__WB_REVISION__"],u):null;try{await f.put(o,d?l.clone():l)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await i.executeQuotaErrorCallbacks(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:w,oldResponse:p,newResponse:l.clone(),request:o,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.l[s]){let r=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))r=h(await t({mode:e,request:r,event:this.event,params:this.params}));this.l[s]=r}return this.l[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.q.get(e),r=r=>{const n=Object.assign(Object.assign({},r),{state:s});return e[t](n)};yield r}}waitUntil(t){return this.m.push(t),t}async doneWaiting(){for(;this.m.length;){const t=this.m.splice(0),e=(await Promise.allSettled(t)).find((t=>"rejected"===t.status));if(e)throw e.reason}}destroy(){this.p.resolve(null)}async g(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class w{constructor(t={}){this.cacheName=s.cacheNames.getRuntimeName(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,r="params"in t?t.params:void 0,n=new l(this,{event:e,request:s,params:r}),i=this._(n,s,e);return[i,this.k(i,n,s,e)]}async _(t,s,r){let n;await t.runCallbacks("handlerWillStart",{event:r,request:s});try{if(n=await this._handle(s,t),!n||"error"===n.type)throw new e.WorkboxError("no-response",{url:s.url})}catch(e){if(e instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(n=await i({error:e,event:r,request:s}),n)break;if(!n)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))n=await e({event:r,request:s,response:n});return n}async k(t,e,s,r){let n,i;try{n=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:r,request:s,response:n}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:r,request:s,response:n,error:i}),e.destroy(),i)throw i}}const u={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null};return t.CacheFirst=class extends w{async _handle(t,s){let r,n=await s.cacheMatch(t);if(!n)try{n=await s.fetchAndCachePut(t)}catch(t){t instanceof Error&&(r=t)}if(!n)throw new e.WorkboxError("no-response",{url:t.url,error:r});return n}},t.CacheOnly=class extends w{async _handle(t,s){const r=await s.cacheMatch(t);if(!r)throw new e.WorkboxError("no-response",{url:t.url});return r}},t.NetworkFirst=class extends w{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u),this.R=t.networkTimeoutSeconds||0}async _handle(t,s){const r=[],n=[];let i;if(this.R){const{id:e,promise:a}=this.W({request:t,logs:r,handler:s});i=e,n.push(a)}const a=this.O({timeoutId:i,request:t,logs:r,handler:s});n.push(a);const o=await s.waitUntil((async()=>await s.waitUntil(Promise.race(n))||await a)());if(!o)throw new e.WorkboxError("no-response",{url:t.url});return o}W({request:t,logs:e,handler:s}){let r;return{promise:new Promise((e=>{r=setTimeout((async()=>{e(await s.cacheMatch(t))}),1e3*this.R)})),id:r}}async O({timeoutId:t,request:e,logs:s,handler:r}){let n,i;try{i=await r.fetchAndCachePut(e)}catch(t){t instanceof Error&&(n=t)}return t&&clearTimeout(t),!n&&i||(i=await r.cacheMatch(e)),i}},t.NetworkOnly=class extends w{constructor(t={}){super(t),this.R=t.networkTimeoutSeconds||0}async _handle(t,s){let r,n;try{const e=[s.fetch(t)];if(this.R){const t=c.timeout(1e3*this.R);e.push(t)}if(n=await Promise.race(e),!n)throw new Error(`Timed out the network response after ${this.R} seconds.`)}catch(t){t instanceof Error&&(r=t)}if(!n)throw new e.WorkboxError("no-response",{url:t.url,error:r});return n}},t.StaleWhileRevalidate=class extends w{constructor(t={}){super(t),this.plugins.some((t=>"cacheWillUpdate"in t))||this.plugins.unshift(u)}async _handle(t,s){const r=s.fetchAndCachePut(t).catch((()=>{}));s.waitUntil(r);let n,i=await s.cacheMatch(t);if(i);else try{i=await r}catch(t){t instanceof Error&&(n=t)}if(!i)throw new e.WorkboxError("no-response",{url:t.url,error:n});return i}},t.Strategy=w,t.StrategyHandler=l,t}({},workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private);
+//# sourceMappingURL=workbox-strategies.prod.js.map
diff --git a/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js.map b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..7f97d8d553817ec6a39f0a39777721f383a0b2aa
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/build/workbox-strategies.prod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"workbox-strategies.prod.js","sources":["../_version.js","../StrategyHandler.js","../Strategy.js","../plugins/cacheOkAndOpaquePlugin.js","../CacheFirst.js","../CacheOnly.js","../NetworkFirst.js","../NetworkOnly.js","../StaleWhileRevalidate.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n    self['workbox:strategies:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n    return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n    /**\n     * Creates a new instance associated with the passed strategy and event\n     * that's handling the request.\n     *\n     * The constructor also initializes the state that will be passed to each of\n     * the plugins handling this request.\n     *\n     * @param {workbox-strategies.Strategy} strategy\n     * @param {Object} options\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params] The return value from the\n     *     {@link workbox-routing~matchCallback} (if applicable).\n     */\n    constructor(strategy, options) {\n        this._cacheKeys = {};\n        /**\n         * The request the strategy is performing (passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * @name request\n         * @instance\n         * @type {Request}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * The event associated with this request.\n         * @name event\n         * @instance\n         * @type {ExtendableEvent}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * A `URL` instance of `request.url` (if passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * Note: the `url` param will be present if the strategy was invoked\n         * from a workbox `Route` object.\n         * @name url\n         * @instance\n         * @type {URL|undefined}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        /**\n         * A `param` value (if passed to the strategy's\n         * `handle()` or `handleAll()` method).\n         * Note: the `param` param will be present if the strategy was invoked\n         * from a workbox `Route` object and the\n         * {@link workbox-routing~matchCallback} returned\n         * a truthy value (it will be that value).\n         * @name params\n         * @instance\n         * @type {*|undefined}\n         * @memberof workbox-strategies.StrategyHandler\n         */\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(options.event, ExtendableEvent, {\n                moduleName: 'workbox-strategies',\n                className: 'StrategyHandler',\n                funcName: 'constructor',\n                paramName: 'options.event',\n            });\n        }\n        Object.assign(this, options);\n        this.event = options.event;\n        this._strategy = strategy;\n        this._handlerDeferred = new Deferred();\n        this._extendLifetimePromises = [];\n        // Copy the plugins list (since it's mutable on the strategy),\n        // so any mutations don't affect this handler instance.\n        this._plugins = [...strategy.plugins];\n        this._pluginStateMap = new Map();\n        for (const plugin of this._plugins) {\n            this._pluginStateMap.set(plugin, {});\n        }\n        this.event.waitUntil(this._handlerDeferred.promise);\n    }\n    /**\n     * Fetches a given request (and invokes any applicable plugin callback\n     * methods) using the `fetchOptions` (for non-navigation requests) and\n     * `plugins` defined on the `Strategy` object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - `requestWillFetch()`\n     * - `fetchDidSucceed()`\n     * - `fetchDidFail()`\n     *\n     * @param {Request|string} input The URL or request to fetch.\n     * @return {Promise}\n     */\n    async fetch(input) {\n        const { event } = this;\n        let request = toRequest(input);\n        if (request.mode === 'navigate' &&\n            event instanceof FetchEvent &&\n            event.preloadResponse) {\n            const possiblePreloadResponse = (await event.preloadResponse);\n            if (possiblePreloadResponse) {\n                if (process.env.NODE_ENV !== 'production') {\n                    logger.log(`Using a preloaded navigation response for ` +\n                        `'${getFriendlyURL(request.url)}'`);\n                }\n                return possiblePreloadResponse;\n            }\n        }\n        // If there is a fetchDidFail plugin, we need to save a clone of the\n        // original request before it's either modified by a requestWillFetch\n        // plugin or before the original request's body is consumed via fetch().\n        const originalRequest = this.hasCallback('fetchDidFail')\n            ? request.clone()\n            : null;\n        try {\n            for (const cb of this.iterateCallbacks('requestWillFetch')) {\n                request = await cb({ request: request.clone(), event });\n            }\n        }\n        catch (err) {\n            if (err instanceof Error) {\n                throw new WorkboxError('plugin-error-request-will-fetch', {\n                    thrownErrorMessage: err.message,\n                });\n            }\n        }\n        // The request can be altered by plugins with `requestWillFetch` making\n        // the original request (most likely from a `fetch` event) different\n        // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n        const pluginFilteredRequest = request.clone();\n        try {\n            let fetchResponse;\n            // See https://github.com/GoogleChrome/workbox/issues/1796\n            fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Network request for ` +\n                    `'${getFriendlyURL(request.url)}' returned a response with ` +\n                    `status '${fetchResponse.status}'.`);\n            }\n            for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n                fetchResponse = await callback({\n                    event,\n                    request: pluginFilteredRequest,\n                    response: fetchResponse,\n                });\n            }\n            return fetchResponse;\n        }\n        catch (error) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.log(`Network request for ` +\n                    `'${getFriendlyURL(request.url)}' threw an error.`, error);\n            }\n            // `originalRequest` will only exist if a `fetchDidFail` callback\n            // is being used (see above).\n            if (originalRequest) {\n                await this.runCallbacks('fetchDidFail', {\n                    error: error,\n                    event,\n                    originalRequest: originalRequest.clone(),\n                    request: pluginFilteredRequest.clone(),\n                });\n            }\n            throw error;\n        }\n    }\n    /**\n     * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n     * the response generated by `this.fetch()`.\n     *\n     * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n     * so you do not have to manually call `waitUntil()` on the event.\n     *\n     * @param {Request|string} input The request or URL to fetch and cache.\n     * @return {Promise}\n     */\n    async fetchAndCachePut(input) {\n        const response = await this.fetch(input);\n        const responseClone = response.clone();\n        void this.waitUntil(this.cachePut(input, responseClone));\n        return response;\n    }\n    /**\n     * Matches a request from the cache (and invokes any applicable plugin\n     * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n     * defined on the strategy object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - cacheKeyWillBeUsed()\n     * - cachedResponseWillBeUsed()\n     *\n     * @param {Request|string} key The Request or URL to use as the cache key.\n     * @return {Promise} A matching response, if found.\n     */\n    async cacheMatch(key) {\n        const request = toRequest(key);\n        let cachedResponse;\n        const { cacheName, matchOptions } = this._strategy;\n        const effectiveRequest = await this.getCacheKey(request, 'read');\n        const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n        cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n        if (process.env.NODE_ENV !== 'production') {\n            if (cachedResponse) {\n                logger.debug(`Found a cached response in '${cacheName}'.`);\n            }\n            else {\n                logger.debug(`No cached response found in '${cacheName}'.`);\n            }\n        }\n        for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n            cachedResponse =\n                (await callback({\n                    cacheName,\n                    matchOptions,\n                    cachedResponse,\n                    request: effectiveRequest,\n                    event: this.event,\n                })) || undefined;\n        }\n        return cachedResponse;\n    }\n    /**\n     * Puts a request/response pair in the cache (and invokes any applicable\n     * plugin callback methods) using the `cacheName` and `plugins` defined on\n     * the strategy object.\n     *\n     * The following plugin lifecycle methods are invoked when using this method:\n     * - cacheKeyWillBeUsed()\n     * - cacheWillUpdate()\n     * - cacheDidUpdate()\n     *\n     * @param {Request|string} key The request or URL to use as the cache key.\n     * @param {Response} response The response to cache.\n     * @return {Promise} `false` if a cacheWillUpdate caused the response\n     * not be cached, and `true` otherwise.\n     */\n    async cachePut(key, response) {\n        const request = toRequest(key);\n        // Run in the next task to avoid blocking other cache reads.\n        // https://github.com/w3c/ServiceWorker/issues/1397\n        await timeout(0);\n        const effectiveRequest = await this.getCacheKey(request, 'write');\n        if (process.env.NODE_ENV !== 'production') {\n            if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n                throw new WorkboxError('attempt-to-cache-non-get-request', {\n                    url: getFriendlyURL(effectiveRequest.url),\n                    method: effectiveRequest.method,\n                });\n            }\n            // See https://github.com/GoogleChrome/workbox/issues/2818\n            const vary = response.headers.get('Vary');\n            if (vary) {\n                logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n                    `has a 'Vary: ${vary}' header. ` +\n                    `Consider setting the {ignoreVary: true} option on your strategy ` +\n                    `to ensure cache matching and deletion works as expected.`);\n            }\n        }\n        if (!response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.error(`Cannot cache non-existent response for ` +\n                    `'${getFriendlyURL(effectiveRequest.url)}'.`);\n            }\n            throw new WorkboxError('cache-put-with-no-response', {\n                url: getFriendlyURL(effectiveRequest.url),\n            });\n        }\n        const responseToCache = await this._ensureResponseSafeToCache(response);\n        if (!responseToCache) {\n            if (process.env.NODE_ENV !== 'production') {\n                logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n                    `will not be cached.`, responseToCache);\n            }\n            return false;\n        }\n        const { cacheName, matchOptions } = this._strategy;\n        const cache = await self.caches.open(cacheName);\n        const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n        const oldResponse = hasCacheUpdateCallback\n            ? await cacheMatchIgnoreParams(\n            // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n            // feature. Consider into ways to only add this behavior if using\n            // precaching.\n            cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n            : null;\n        if (process.env.NODE_ENV !== 'production') {\n            logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n                `for ${getFriendlyURL(effectiveRequest.url)}.`);\n        }\n        try {\n            await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n        }\n        catch (error) {\n            if (error instanceof Error) {\n                // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n                if (error.name === 'QuotaExceededError') {\n                    await executeQuotaErrorCallbacks();\n                }\n                throw error;\n            }\n        }\n        for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n            await callback({\n                cacheName,\n                oldResponse,\n                newResponse: responseToCache.clone(),\n                request: effectiveRequest,\n                event: this.event,\n            });\n        }\n        return true;\n    }\n    /**\n     * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n     * executes any of those callbacks found in sequence. The final `Request`\n     * object returned by the last plugin is treated as the cache key for cache\n     * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n     * been registered, the passed request is returned unmodified\n     *\n     * @param {Request} request\n     * @param {string} mode\n     * @return {Promise}\n     */\n    async getCacheKey(request, mode) {\n        const key = `${request.url} | ${mode}`;\n        if (!this._cacheKeys[key]) {\n            let effectiveRequest = request;\n            for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n                effectiveRequest = toRequest(await callback({\n                    mode,\n                    request: effectiveRequest,\n                    event: this.event,\n                    // params has a type any can't change right now.\n                    params: this.params, // eslint-disable-line\n                }));\n            }\n            this._cacheKeys[key] = effectiveRequest;\n        }\n        return this._cacheKeys[key];\n    }\n    /**\n     * Returns true if the strategy has at least one plugin with the given\n     * callback.\n     *\n     * @param {string} name The name of the callback to check for.\n     * @return {boolean}\n     */\n    hasCallback(name) {\n        for (const plugin of this._strategy.plugins) {\n            if (name in plugin) {\n                return true;\n            }\n        }\n        return false;\n    }\n    /**\n     * Runs all plugin callbacks matching the given name, in order, passing the\n     * given param object (merged ith the current plugin state) as the only\n     * argument.\n     *\n     * Note: since this method runs all plugins, it's not suitable for cases\n     * where the return value of a callback needs to be applied prior to calling\n     * the next callback. See\n     * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n     * below for how to handle that case.\n     *\n     * @param {string} name The name of the callback to run within each plugin.\n     * @param {Object} param The object to pass as the first (and only) param\n     *     when executing each callback. This object will be merged with the\n     *     current plugin state prior to callback execution.\n     */\n    async runCallbacks(name, param) {\n        for (const callback of this.iterateCallbacks(name)) {\n            // TODO(philipwalton): not sure why `any` is needed. It seems like\n            // this should work with `as WorkboxPluginCallbackParam[C]`.\n            await callback(param);\n        }\n    }\n    /**\n     * Accepts a callback and returns an iterable of matching plugin callbacks,\n     * where each callback is wrapped with the current handler state (i.e. when\n     * you call each callback, whatever object parameter you pass it will\n     * be merged with the plugin's current state).\n     *\n     * @param {string} name The name fo the callback to run\n     * @return {Array}\n     */\n    *iterateCallbacks(name) {\n        for (const plugin of this._strategy.plugins) {\n            if (typeof plugin[name] === 'function') {\n                const state = this._pluginStateMap.get(plugin);\n                const statefulCallback = (param) => {\n                    const statefulParam = Object.assign(Object.assign({}, param), { state });\n                    // TODO(philipwalton): not sure why `any` is needed. It seems like\n                    // this should work with `as WorkboxPluginCallbackParam[C]`.\n                    return plugin[name](statefulParam);\n                };\n                yield statefulCallback;\n            }\n        }\n    }\n    /**\n     * Adds a promise to the\n     * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n     * of the event associated with the request being handled (usually a\n     * `FetchEvent`).\n     *\n     * Note: you can await\n     * {@link workbox-strategies.StrategyHandler~doneWaiting}\n     * to know when all added promises have settled.\n     *\n     * @param {Promise} promise A promise to add to the extend lifetime promises\n     *     of the event that triggered the request.\n     */\n    waitUntil(promise) {\n        this._extendLifetimePromises.push(promise);\n        return promise;\n    }\n    /**\n     * Returns a promise that resolves once all promises passed to\n     * {@link workbox-strategies.StrategyHandler~waitUntil}\n     * have settled.\n     *\n     * Note: any work done after `doneWaiting()` settles should be manually\n     * passed to an event's `waitUntil()` method (not this handler's\n     * `waitUntil()` method), otherwise the service worker thread may be killed\n     * prior to your work completing.\n     */\n    async doneWaiting() {\n        while (this._extendLifetimePromises.length) {\n            const promises = this._extendLifetimePromises.splice(0);\n            const result = await Promise.allSettled(promises);\n            const firstRejection = result.find((i) => i.status === 'rejected');\n            if (firstRejection) {\n                throw firstRejection.reason;\n            }\n        }\n    }\n    /**\n     * Stops running the strategy and immediately resolves any pending\n     * `waitUntil()` promises.\n     */\n    destroy() {\n        this._handlerDeferred.resolve(null);\n    }\n    /**\n     * This method will call cacheWillUpdate on the available plugins (or use\n     * status === 200) to determine if the Response is safe and valid to cache.\n     *\n     * @param {Request} options.request\n     * @param {Response} options.response\n     * @return {Promise}\n     *\n     * @private\n     */\n    async _ensureResponseSafeToCache(response) {\n        let responseToCache = response;\n        let pluginsUsed = false;\n        for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n            responseToCache =\n                (await callback({\n                    request: this.request,\n                    response: responseToCache,\n                    event: this.event,\n                })) || undefined;\n            pluginsUsed = true;\n            if (!responseToCache) {\n                break;\n            }\n        }\n        if (!pluginsUsed) {\n            if (responseToCache && responseToCache.status !== 200) {\n                responseToCache = undefined;\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                if (responseToCache) {\n                    if (responseToCache.status !== 200) {\n                        if (responseToCache.status === 0) {\n                            logger.warn(`The response for '${this.request.url}' ` +\n                                `is an opaque response. The caching strategy that you're ` +\n                                `using will not cache opaque responses by default.`);\n                        }\n                        else {\n                            logger.debug(`The response for '${this.request.url}' ` +\n                                `returned a status code of '${response.status}' and won't ` +\n                                `be cached as a result.`);\n                        }\n                    }\n                }\n            }\n        }\n        return responseToCache;\n    }\n}\nexport { StrategyHandler };\n","/*\n  Copyright 2020 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n    /**\n     * Creates a new instance of the strategy and sets all documented option\n     * properties as public instance properties.\n     *\n     * Note: if a custom strategy class extends the base Strategy class and does\n     * not need more than these properties, it does not need to define its own\n     * constructor.\n     *\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to the cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] The\n     * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n     * for any `cache.match()` or `cache.put()` calls made by this strategy.\n     */\n    constructor(options = {}) {\n        /**\n         * Cache name to store and retrieve\n         * requests. Defaults to the cache names provided by\n         * {@link workbox-core.cacheNames}.\n         *\n         * @type {string}\n         */\n        this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n        /**\n         * The list\n         * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n         * used by this strategy.\n         *\n         * @type {Array}\n         */\n        this.plugins = options.plugins || [];\n        /**\n         * Values passed along to the\n         * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n         * of all fetch() requests made by this strategy.\n         *\n         * @type {Object}\n         */\n        this.fetchOptions = options.fetchOptions;\n        /**\n         * The\n         * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n         * for any `cache.match()` or `cache.put()` calls made by this strategy.\n         *\n         * @type {Object}\n         */\n        this.matchOptions = options.matchOptions;\n    }\n    /**\n     * Perform a request strategy and returns a `Promise` that will resolve with\n     * a `Response`, invoking all relevant plugin callbacks.\n     *\n     * When a strategy instance is registered with a Workbox\n     * {@link workbox-routing.Route}, this method is automatically\n     * called when the route matches.\n     *\n     * Alternatively, this method can be used in a standalone `FetchEvent`\n     * listener by passing it to `event.respondWith()`.\n     *\n     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n     *     properties listed below.\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params]\n     */\n    handle(options) {\n        const [responseDone] = this.handleAll(options);\n        return responseDone;\n    }\n    /**\n     * Similar to {@link workbox-strategies.Strategy~handle}, but\n     * instead of just returning a `Promise` that resolves to a `Response` it\n     * it will return an tuple of `[response, done]` promises, where the former\n     * (`response`) is equivalent to what `handle()` returns, and the latter is a\n     * Promise that will resolve once any promises that were added to\n     * `event.waitUntil()` as part of performing the strategy have completed.\n     *\n     * You can await the `done` promise to ensure any extra work performed by\n     * the strategy (usually caching responses) completes successfully.\n     *\n     * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n     *     properties listed below.\n     * @param {Request|string} options.request A request to run this strategy for.\n     * @param {ExtendableEvent} options.event The event associated with the\n     *     request.\n     * @param {URL} [options.url]\n     * @param {*} [options.params]\n     * @return {Array} A tuple of [response, done]\n     *     promises that can be used to determine when the response resolves as\n     *     well as when the handler has completed all its work.\n     */\n    handleAll(options) {\n        // Allow for flexible options to be passed.\n        if (options instanceof FetchEvent) {\n            options = {\n                event: options,\n                request: options.request,\n            };\n        }\n        const event = options.event;\n        const request = typeof options.request === 'string'\n            ? new Request(options.request)\n            : options.request;\n        const params = 'params' in options ? options.params : undefined;\n        const handler = new StrategyHandler(this, { event, request, params });\n        const responseDone = this._getResponse(handler, request, event);\n        const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n        // Return an array of promises, suitable for use with Promise.all().\n        return [responseDone, handlerDone];\n    }\n    async _getResponse(handler, request, event) {\n        await handler.runCallbacks('handlerWillStart', { event, request });\n        let response = undefined;\n        try {\n            response = await this._handle(request, handler);\n            // The \"official\" Strategy subclasses all throw this error automatically,\n            // but in case a third-party Strategy doesn't, ensure that we have a\n            // consistent failure when there's no response or an error response.\n            if (!response || response.type === 'error') {\n                throw new WorkboxError('no-response', { url: request.url });\n            }\n        }\n        catch (error) {\n            if (error instanceof Error) {\n                for (const callback of handler.iterateCallbacks('handlerDidError')) {\n                    response = await callback({ error, event, request });\n                    if (response) {\n                        break;\n                    }\n                }\n            }\n            if (!response) {\n                throw error;\n            }\n            else if (process.env.NODE_ENV !== 'production') {\n                logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n                    `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n                    `a handlerDidError plugin.`);\n            }\n        }\n        for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n            response = await callback({ event, request, response });\n        }\n        return response;\n    }\n    async _awaitComplete(responseDone, handler, request, event) {\n        let response;\n        let error;\n        try {\n            response = await responseDone;\n        }\n        catch (error) {\n            // Ignore errors, as response errors should be caught via the `response`\n            // promise above. The `done` promise will only throw for errors in\n            // promises passed to `handler.waitUntil()`.\n        }\n        try {\n            await handler.runCallbacks('handlerDidRespond', {\n                event,\n                request,\n                response,\n            });\n            await handler.doneWaiting();\n        }\n        catch (waitUntilError) {\n            if (waitUntilError instanceof Error) {\n                error = waitUntilError;\n            }\n        }\n        await handler.runCallbacks('handlerDidComplete', {\n            event,\n            request,\n            response,\n            error: error,\n        });\n        handler.destroy();\n        if (error) {\n            throw error;\n        }\n    }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n    /**\n     * Returns a valid response (to allow caching) if the status is 200 (OK) or\n     * 0 (opaque).\n     *\n     * @param {Object} options\n     * @param {Response} options.response\n     * @return {Response|null}\n     *\n     * @private\n     */\n    cacheWillUpdate: async ({ response }) => {\n        if (response.status === 200 || response.status === 0) {\n            return response;\n        }\n        return null;\n    },\n};\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass CacheFirst extends Strategy {\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'makeRequest',\n                paramName: 'request',\n            });\n        }\n        let response = await handler.cacheMatch(request);\n        let error = undefined;\n        if (!response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`No response found in the '${this.cacheName}' cache. ` +\n                    `Will respond with a network request.`);\n            }\n            try {\n                response = await handler.fetchAndCachePut(request);\n            }\n            catch (err) {\n                if (err instanceof Error) {\n                    error = err;\n                }\n            }\n            if (process.env.NODE_ENV !== 'production') {\n                if (response) {\n                    logs.push(`Got response from network.`);\n                }\n                else {\n                    logs.push(`Unable to get a response from the network.`);\n                }\n            }\n        }\n        else {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`Found a cached response in the '${this.cacheName}' cache.`);\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { CacheFirst };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)\n * request strategy.\n *\n * This class is useful if you want to take advantage of any\n * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).\n *\n * If there is no cache match, this will throw a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass CacheOnly extends Strategy {\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'makeRequest',\n                paramName: 'request',\n            });\n        }\n        const response = await handler.cacheMatch(request);\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            if (response) {\n                logger.log(`Found a cached response in the '${this.cacheName}' ` + `cache.`);\n                messages.printFinalResponse(response);\n            }\n            else {\n                logger.log(`No response found in the '${this.cacheName}' cache.`);\n            }\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url });\n        }\n        return response;\n    }\n}\nexport { CacheOnly };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass NetworkFirst extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n     * @param {number} [options.networkTimeoutSeconds] If set, any network requests\n     * that fail to respond within the timeout will fallback to the cache.\n     *\n     * This option can be used to combat\n     * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n     * scenarios.\n     */\n    constructor(options = {}) {\n        super(options);\n        // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n            this.plugins.unshift(cacheOkAndOpaquePlugin);\n        }\n        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n        if (process.env.NODE_ENV !== 'production') {\n            if (this._networkTimeoutSeconds) {\n                assert.isType(this._networkTimeoutSeconds, 'number', {\n                    moduleName: 'workbox-strategies',\n                    className: this.constructor.name,\n                    funcName: 'constructor',\n                    paramName: 'networkTimeoutSeconds',\n                });\n            }\n        }\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'handle',\n                paramName: 'makeRequest',\n            });\n        }\n        const promises = [];\n        let timeoutId;\n        if (this._networkTimeoutSeconds) {\n            const { id, promise } = this._getTimeoutPromise({ request, logs, handler });\n            timeoutId = id;\n            promises.push(promise);\n        }\n        const networkPromise = this._getNetworkPromise({\n            timeoutId,\n            request,\n            logs,\n            handler,\n        });\n        promises.push(networkPromise);\n        const response = await handler.waitUntil((async () => {\n            // Promise.race() will resolve as soon as the first promise resolves.\n            return ((await handler.waitUntil(Promise.race(promises))) ||\n                // If Promise.race() resolved with null, it might be due to a network\n                // timeout + a cache miss. If that were to happen, we'd rather wait until\n                // the networkPromise resolves instead of returning null.\n                // Note that it's fine to await an already-resolved promise, so we don't\n                // have to check to see if it's still \"in flight\".\n                (await networkPromise));\n        })());\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url });\n        }\n        return response;\n    }\n    /**\n     * @param {Object} options\n     * @param {Request} options.request\n     * @param {Array} options.logs A reference to the logs array\n     * @param {Event} options.event\n     * @return {Promise}\n     *\n     * @private\n     */\n    _getTimeoutPromise({ request, logs, handler, }) {\n        let timeoutId;\n        const timeoutPromise = new Promise((resolve) => {\n            const onNetworkTimeout = async () => {\n                if (process.env.NODE_ENV !== 'production') {\n                    logs.push(`Timing out the network response at ` +\n                        `${this._networkTimeoutSeconds} seconds.`);\n                }\n                resolve(await handler.cacheMatch(request));\n            };\n            timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n        });\n        return {\n            promise: timeoutPromise,\n            id: timeoutId,\n        };\n    }\n    /**\n     * @param {Object} options\n     * @param {number|undefined} options.timeoutId\n     * @param {Request} options.request\n     * @param {Array} options.logs A reference to the logs Array.\n     * @param {Event} options.event\n     * @return {Promise}\n     *\n     * @private\n     */\n    async _getNetworkPromise({ timeoutId, request, logs, handler, }) {\n        let error;\n        let response;\n        try {\n            response = await handler.fetchAndCachePut(request);\n        }\n        catch (fetchError) {\n            if (fetchError instanceof Error) {\n                error = fetchError;\n            }\n        }\n        if (timeoutId) {\n            clearTimeout(timeoutId);\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            if (response) {\n                logs.push(`Got response from network.`);\n            }\n            else {\n                logs.push(`Unable to get a response from the network. Will respond ` +\n                    `with a cached response.`);\n            }\n        }\n        if (error || !response) {\n            response = await handler.cacheMatch(request);\n            if (process.env.NODE_ENV !== 'production') {\n                if (response) {\n                    logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache.`);\n                }\n                else {\n                    logs.push(`No response found in the '${this.cacheName}' cache.`);\n                }\n            }\n        }\n        return response;\n    }\n}\nexport { NetworkFirst };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)\n * request strategy.\n *\n * This class is useful if you want to take advantage of any\n * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).\n *\n * If the network request fails, this will throw a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass NetworkOnly extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {number} [options.networkTimeoutSeconds] If set, any network requests\n     * that fail to respond within the timeout will result in a network error.\n     */\n    constructor(options = {}) {\n        super(options);\n        this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: '_handle',\n                paramName: 'request',\n            });\n        }\n        let error = undefined;\n        let response;\n        try {\n            const promises = [\n                handler.fetch(request),\n            ];\n            if (this._networkTimeoutSeconds) {\n                const timeoutPromise = timeout(this._networkTimeoutSeconds * 1000);\n                promises.push(timeoutPromise);\n            }\n            response = await Promise.race(promises);\n            if (!response) {\n                throw new Error(`Timed out the network response after ` +\n                    `${this._networkTimeoutSeconds} seconds.`);\n            }\n        }\n        catch (err) {\n            if (err instanceof Error) {\n                error = err;\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            if (response) {\n                logger.log(`Got response from network.`);\n            }\n            else {\n                logger.log(`Unable to get a response from the network.`);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { NetworkOnly };\n","/*\n  Copyright 2018 Google LLC\n\n  Use of this source code is governed by an MIT-style\n  license that can be found in the LICENSE file or at\n  https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)\n * request strategy.\n *\n * Resources are requested from both the cache and the network in parallel.\n * The strategy will respond with the cached version if available, otherwise\n * wait for the network response. The cache is updated with the network response\n * with each successful request.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass StaleWhileRevalidate extends Strategy {\n    /**\n     * @param {Object} [options]\n     * @param {string} [options.cacheName] Cache name to store and retrieve\n     * requests. Defaults to cache names provided by\n     * {@link workbox-core.cacheNames}.\n     * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n     * to use in conjunction with this caching strategy.\n     * @param {Object} [options.fetchOptions] Values passed along to the\n     * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n     * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n     * `fetch()` requests made by this strategy.\n     * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n     */\n    constructor(options = {}) {\n        super(options);\n        // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n        // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n        if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n            this.plugins.unshift(cacheOkAndOpaquePlugin);\n        }\n    }\n    /**\n     * @private\n     * @param {Request|string} request A request to run this strategy for.\n     * @param {workbox-strategies.StrategyHandler} handler The event that\n     *     triggered the request.\n     * @return {Promise}\n     */\n    async _handle(request, handler) {\n        const logs = [];\n        if (process.env.NODE_ENV !== 'production') {\n            assert.isInstance(request, Request, {\n                moduleName: 'workbox-strategies',\n                className: this.constructor.name,\n                funcName: 'handle',\n                paramName: 'request',\n            });\n        }\n        const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {\n            // Swallow this error because a 'no-response' error will be thrown in\n            // main handler return flow. This will be in the `waitUntil()` flow.\n        });\n        void handler.waitUntil(fetchAndCachePromise);\n        let response = await handler.cacheMatch(request);\n        let error;\n        if (response) {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`Found a cached response in the '${this.cacheName}'` +\n                    ` cache. Will update with the network response in the background.`);\n            }\n        }\n        else {\n            if (process.env.NODE_ENV !== 'production') {\n                logs.push(`No response found in the '${this.cacheName}' cache. ` +\n                    `Will wait for the network response.`);\n            }\n            try {\n                // NOTE(philipwalton): Really annoying that we have to type cast here.\n                // https://github.com/microsoft/TypeScript/issues/20006\n                response = (await fetchAndCachePromise);\n            }\n            catch (err) {\n                if (err instanceof Error) {\n                    error = err;\n                }\n            }\n        }\n        if (process.env.NODE_ENV !== 'production') {\n            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n            for (const log of logs) {\n                logger.log(log);\n            }\n            messages.printFinalResponse(response);\n            logger.groupEnd();\n        }\n        if (!response) {\n            throw new WorkboxError('no-response', { url: request.url, error });\n        }\n        return response;\n    }\n}\nexport { StaleWhileRevalidate };\n"],"names":["self","_","e","toRequest","input","Request","StrategyHandler","constructor","strategy","options","this","_cacheKeys","Object","assign","event","_strategy","_handlerDeferred","Deferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","Map","plugin","set","waitUntil","promise","async","request","mode","FetchEvent","preloadResponse","possiblePreloadResponse","originalRequest","hasCallback","clone","cb","iterateCallbacks","err","Error","WorkboxError","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetch","undefined","fetchOptions","callback","response","error","runCallbacks","responseClone","cachePut","key","cachedResponse","cacheName","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","match","timeout","url","getFriendlyURL","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","cacheMatchIgnoreParams","put","name","executeQuotaErrorCallbacks","newResponse","params","param","state","get","statefulCallback","statefulParam","push","length","promises","splice","firstRejection","Promise","allSettled","find","i","status","reason","destroy","resolve","pluginsUsed","Strategy","cacheNames","getRuntimeName","handle","responseDone","handleAll","handler","_getResponse","_awaitComplete","_handle","type","doneWaiting","waitUntilError","cacheOkAndOpaquePlugin","cacheWillUpdate","cacheMatch","fetchAndCachePut","super","some","p","unshift","_networkTimeoutSeconds","networkTimeoutSeconds","logs","timeoutId","id","_getTimeoutPromise","networkPromise","_getNetworkPromise","race","setTimeout","fetchError","clearTimeout","timeoutPromise","fetchAndCachePromise","catch"],"mappings":"+FAEA,IACIA,KAAK,6BAA+BC,GACxC,CACA,MAAOC,GAAK,CCWZ,SAASC,EAAUC,GACf,MAAwB,iBAAVA,EAAqB,IAAIC,QAAQD,GAASA,CAC5D,CAUA,MAAME,EAiBFC,YAAYC,EAAUC,GAClBC,KAAKC,EAAa,CAAA,EA8ClBC,OAAOC,OAAOH,KAAMD,GACpBC,KAAKI,MAAQL,EAAQK,MACrBJ,KAAKK,EAAYP,EACjBE,KAAKM,EAAmB,IAAIC,WAC5BP,KAAKQ,EAA0B,GAG/BR,KAAKS,EAAW,IAAIX,EAASY,SAC7BV,KAAKW,EAAkB,IAAIC,IAC3B,IAAK,MAAMC,KAAUb,KAAKS,EACtBT,KAAKW,EAAgBG,IAAID,EAAQ,CAAA,GAErCb,KAAKI,MAAMW,UAAUf,KAAKM,EAAiBU,QAC/C,CAcAC,YAAYvB,GACR,MAAMU,MAAEA,GAAUJ,KAClB,IAAIkB,EAAUzB,EAAUC,GACxB,GAAqB,aAAjBwB,EAAQC,MACRf,aAAiBgB,YACjBhB,EAAMiB,gBAAiB,CACvB,MAAMC,QAAiClB,EAAMiB,gBAC7C,GAAIC,EAKA,OAAOA,CAEf,CAIA,MAAMC,EAAkBvB,KAAKwB,YAAY,gBACnCN,EAAQO,QACR,KACN,IACI,IAAK,MAAMC,KAAM1B,KAAK2B,iBAAiB,oBACnCT,QAAgBQ,EAAG,CAAER,QAASA,EAAQO,QAASrB,SAEvD,CACA,MAAOwB,GACH,GAAIA,aAAeC,MACf,MAAM,IAAIC,EAAAA,aAAa,kCAAmC,CACtDC,mBAAoBH,EAAII,SAGpC,CAIA,MAAMC,EAAwBf,EAAQO,QACtC,IACI,IAAIS,EAEJA,QAAsBC,MAAMjB,EAA0B,aAAjBA,E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,GACvB,IACIjF,EADAD,QAAiBsD,EAAQS,WAAWpF,GAExC,GAAIqB,QAWA,IAGIA,QAAkBkF,CACtB,CACA,MAAO7F,GACCA,aAAeC,QACfW,EAAQZ,EAEhB,CAUJ,IAAKW,EACD,MAAM,IAAIT,EAAAA,aAAa,cAAe,CAAEwB,IAAKpC,EAAQoC,IAAKd,UAE9D,OAAOD,CACX"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/index.d.ts b/tools/ui/node_modules/workbox-strategies/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b51c544df121855e4efe3c984b4bb960362e5d4e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/index.d.ts
@@ -0,0 +1,20 @@
+import { CacheFirst } from './CacheFirst.js';
+import { CacheOnly } from './CacheOnly.js';
+import { NetworkFirst, NetworkFirstOptions } from './NetworkFirst.js';
+import { NetworkOnly, NetworkOnlyOptions } from './NetworkOnly.js';
+import { StaleWhileRevalidate } from './StaleWhileRevalidate.js';
+import { Strategy, StrategyOptions } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+declare global {
+    interface FetchEvent {
+        readonly preloadResponse: Promise;
+    }
+}
+/**
+ * There are common caching strategies that most service workers will need
+ * and use. This module provides simple implementations of these strategies.
+ *
+ * @module workbox-strategies
+ */
+export { CacheFirst, CacheOnly, NetworkFirst, NetworkFirstOptions, NetworkOnly, NetworkOnlyOptions, StaleWhileRevalidate, Strategy, StrategyHandler, StrategyOptions, };
diff --git a/tools/ui/node_modules/workbox-strategies/index.js b/tools/ui/node_modules/workbox-strategies/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a2887f36a5ad30bb196014ea6d15134a6603fd47
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/index.js
@@ -0,0 +1,22 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import { CacheFirst } from './CacheFirst.js';
+import { CacheOnly } from './CacheOnly.js';
+import { NetworkFirst } from './NetworkFirst.js';
+import { NetworkOnly } from './NetworkOnly.js';
+import { StaleWhileRevalidate } from './StaleWhileRevalidate.js';
+import { Strategy } from './Strategy.js';
+import { StrategyHandler } from './StrategyHandler.js';
+import './_version.js';
+/**
+ * There are common caching strategies that most service workers will need
+ * and use. This module provides simple implementations of these strategies.
+ *
+ * @module workbox-strategies
+ */
+export { CacheFirst, CacheOnly, NetworkFirst, NetworkOnly, StaleWhileRevalidate, Strategy, StrategyHandler, };
diff --git a/tools/ui/node_modules/workbox-strategies/index.mjs b/tools/ui/node_modules/workbox-strategies/index.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/index.mjs
@@ -0,0 +1 @@
+export * from './index.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/package.json b/tools/ui/node_modules/workbox-strategies/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3234fed32d8629b29318150248d50a68958ce62e
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/package.json
@@ -0,0 +1,32 @@
+{
+  "name": "workbox-strategies",
+  "version": "7.4.1",
+  "license": "MIT",
+  "author": "Google's Web DevRel Team and Google's Aurora Team",
+  "description": "A service worker helper library implementing common caching strategies.",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googlechrome/workbox.git"
+  },
+  "bugs": "https://github.com/googlechrome/workbox/issues",
+  "homepage": "https://github.com/GoogleChrome/workbox",
+  "keywords": [
+    "workbox",
+    "workboxjs",
+    "service worker",
+    "sw",
+    "router",
+    "routing"
+  ],
+  "workbox": {
+    "browserNamespace": "workbox.strategies",
+    "packageType": "sw"
+  },
+  "main": "index.js",
+  "module": "index.mjs",
+  "types": "index.d.ts",
+  "dependencies": {
+    "workbox-core": "7.4.1"
+  },
+  "gitHead": "62b9d8ba8eb3c1a2ab8aac9d84c90cda7865d6a3"
+}
diff --git a/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.d.ts b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8e63142b255ffb695edfa44d0ce0d0984d7634e5
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.d.ts
@@ -0,0 +1,3 @@
+import { WorkboxPlugin } from 'workbox-core/types.js';
+import '../_version.js';
+export declare const cacheOkAndOpaquePlugin: WorkboxPlugin;
diff --git a/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..db03530bf21cac86b4a9ce30ba23b6b62437adbc
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js
@@ -0,0 +1,26 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+import '../_version.js';
+export const cacheOkAndOpaquePlugin = {
+    /**
+     * Returns a valid response (to allow caching) if the status is 200 (OK) or
+     * 0 (opaque).
+     *
+     * @param {Object} options
+     * @param {Response} options.response
+     * @return {Response|null}
+     *
+     * @private
+     */
+    cacheWillUpdate: async ({ response }) => {
+        if (response.status === 200 || response.status === 0) {
+            return response;
+        }
+        return null;
+    },
+};
diff --git a/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.mjs b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.mjs
new file mode 100644
index 0000000000000000000000000000000000000000..bd224b7d7ceff0cdead439bc81ae1e3d763518af
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.mjs
@@ -0,0 +1 @@
+export * from './cacheOkAndOpaquePlugin.js';
\ No newline at end of file
diff --git a/tools/ui/node_modules/workbox-strategies/src/CacheFirst.ts b/tools/ui/node_modules/workbox-strategies/src/CacheFirst.ts
new file mode 100644
index 0000000000000000000000000000000000000000..963da690a0c1783294bc059b6ac45c24e710edd4
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/CacheFirst.ts
@@ -0,0 +1,101 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {Strategy} from './Strategy.js';
+import {StrategyHandler} from './StrategyHandler.js';
+import {messages} from './utils/messages.js';
+import './_version.js';
+
+/**
+ * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)
+ * request strategy.
+ *
+ * A cache first strategy is useful for assets that have been revisioned,
+ * such as URLs like `/styles/example.a8f5f1.css`, since they
+ * can be cached for long periods of time.
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class CacheFirst extends Strategy {
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    const logs = [];
+
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-strategies',
+        className: this.constructor.name,
+        funcName: 'makeRequest',
+        paramName: 'request',
+      });
+    }
+
+    let response = await handler.cacheMatch(request);
+
+    let error: Error | undefined = undefined;
+    if (!response) {
+      if (process.env.NODE_ENV !== 'production') {
+        logs.push(
+          `No response found in the '${this.cacheName}' cache. ` +
+            `Will respond with a network request.`,
+        );
+      }
+      try {
+        response = await handler.fetchAndCachePut(request);
+      } catch (err) {
+        if (err instanceof Error) {
+          error = err;
+        }
+      }
+
+      if (process.env.NODE_ENV !== 'production') {
+        if (response) {
+          logs.push(`Got response from network.`);
+        } else {
+          logs.push(`Unable to get a response from the network.`);
+        }
+      }
+    } else {
+      if (process.env.NODE_ENV !== 'production') {
+        logs.push(`Found a cached response in the '${this.cacheName}' cache.`);
+      }
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.groupCollapsed(
+        messages.strategyStart(this.constructor.name, request),
+      );
+      for (const log of logs) {
+        logger.log(log);
+      }
+      messages.printFinalResponse(response);
+      logger.groupEnd();
+    }
+
+    if (!response) {
+      throw new WorkboxError('no-response', {url: request.url, error});
+    }
+    return response;
+  }
+}
+
+export {CacheFirst};
diff --git a/tools/ui/node_modules/workbox-strategies/src/CacheOnly.ts b/tools/ui/node_modules/workbox-strategies/src/CacheOnly.ts
new file mode 100644
index 0000000000000000000000000000000000000000..12714bcc6aa6ee1115991af8593e2249f23d5177
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/CacheOnly.ts
@@ -0,0 +1,72 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {Strategy} from './Strategy.js';
+import {StrategyHandler} from './StrategyHandler.js';
+import {messages} from './utils/messages.js';
+import './_version.js';
+
+/**
+ * An implementation of a [cache-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If there is no cache match, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class CacheOnly extends Strategy {
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-strategies',
+        className: this.constructor.name,
+        funcName: 'makeRequest',
+        paramName: 'request',
+      });
+    }
+
+    const response = await handler.cacheMatch(request);
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.groupCollapsed(
+        messages.strategyStart(this.constructor.name, request),
+      );
+      if (response) {
+        logger.log(
+          `Found a cached response in the '${this.cacheName}' ` + `cache.`,
+        );
+        messages.printFinalResponse(response);
+      } else {
+        logger.log(`No response found in the '${this.cacheName}' cache.`);
+      }
+      logger.groupEnd();
+    }
+
+    if (!response) {
+      throw new WorkboxError('no-response', {url: request.url});
+    }
+    return response;
+  }
+}
+
+export {CacheOnly};
diff --git a/tools/ui/node_modules/workbox-strategies/src/NetworkFirst.ts b/tools/ui/node_modules/workbox-strategies/src/NetworkFirst.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2495dd623c47f13262f0e99f47989c1464452775
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/NetworkFirst.ts
@@ -0,0 +1,259 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {cacheOkAndOpaquePlugin} from './plugins/cacheOkAndOpaquePlugin.js';
+import {Strategy, StrategyOptions} from './Strategy.js';
+import {StrategyHandler} from './StrategyHandler.js';
+import {messages} from './utils/messages.js';
+import './_version.js';
+
+export interface NetworkFirstOptions extends StrategyOptions {
+  networkTimeoutSeconds?: number;
+}
+
+/**
+ * An implementation of a
+ * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)
+ * request strategy.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class NetworkFirst extends Strategy {
+  private readonly _networkTimeoutSeconds: number;
+
+  /**
+   * @param {Object} [options]
+   * @param {string} [options.cacheName] Cache name to store and retrieve
+   * requests. Defaults to cache names provided by
+   * {@link workbox-core.cacheNames}.
+   * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+   * to use in conjunction with this caching strategy.
+   * @param {Object} [options.fetchOptions] Values passed along to the
+   * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+   * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+   * `fetch()` requests made by this strategy.
+   * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+   * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+   * that fail to respond within the timeout will fallback to the cache.
+   *
+   * This option can be used to combat
+   * "[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}"
+   * scenarios.
+   */
+  constructor(options: NetworkFirstOptions = {}) {
+    super(options);
+
+    // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+    // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+    if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
+      this.plugins.unshift(cacheOkAndOpaquePlugin);
+    }
+
+    this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+    if (process.env.NODE_ENV !== 'production') {
+      if (this._networkTimeoutSeconds) {
+        assert!.isType(this._networkTimeoutSeconds, 'number', {
+          moduleName: 'workbox-strategies',
+          className: this.constructor.name,
+          funcName: 'constructor',
+          paramName: 'networkTimeoutSeconds',
+        });
+      }
+    }
+  }
+
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    const logs: any[] = [];
+
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-strategies',
+        className: this.constructor.name,
+        funcName: 'handle',
+        paramName: 'makeRequest',
+      });
+    }
+
+    const promises: Promise[] = [];
+    let timeoutId: number | undefined;
+
+    if (this._networkTimeoutSeconds) {
+      const {id, promise} = this._getTimeoutPromise({request, logs, handler});
+      timeoutId = id;
+      promises.push(promise);
+    }
+
+    const networkPromise = this._getNetworkPromise({
+      timeoutId,
+      request,
+      logs,
+      handler,
+    });
+
+    promises.push(networkPromise);
+
+    const response = await handler.waitUntil(
+      (async () => {
+        // Promise.race() will resolve as soon as the first promise resolves.
+        return (
+          (await handler.waitUntil(Promise.race(promises))) ||
+          // If Promise.race() resolved with null, it might be due to a network
+          // timeout + a cache miss. If that were to happen, we'd rather wait until
+          // the networkPromise resolves instead of returning null.
+          // Note that it's fine to await an already-resolved promise, so we don't
+          // have to check to see if it's still "in flight".
+          (await networkPromise)
+        );
+      })(),
+    );
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.groupCollapsed(
+        messages.strategyStart(this.constructor.name, request),
+      );
+      for (const log of logs) {
+        logger.log(log);
+      }
+      messages.printFinalResponse(response);
+      logger.groupEnd();
+    }
+
+    if (!response) {
+      throw new WorkboxError('no-response', {url: request.url});
+    }
+    return response;
+  }
+
+  /**
+   * @param {Object} options
+   * @param {Request} options.request
+   * @param {Array} options.logs A reference to the logs array
+   * @param {Event} options.event
+   * @return {Promise}
+   *
+   * @private
+   */
+  private _getTimeoutPromise({
+    request,
+    logs,
+    handler,
+  }: {
+    request: Request;
+    logs: any[];
+    handler: StrategyHandler;
+  }): {promise: Promise; id?: number} {
+    let timeoutId;
+    const timeoutPromise: Promise = new Promise(
+      (resolve) => {
+        const onNetworkTimeout = async () => {
+          if (process.env.NODE_ENV !== 'production') {
+            logs.push(
+              `Timing out the network response at ` +
+                `${this._networkTimeoutSeconds} seconds.`,
+            );
+          }
+          resolve(await handler.cacheMatch(request));
+        };
+        timeoutId = setTimeout(
+          onNetworkTimeout,
+          this._networkTimeoutSeconds * 1000,
+        );
+      },
+    );
+
+    return {
+      promise: timeoutPromise,
+      id: timeoutId,
+    };
+  }
+
+  /**
+   * @param {Object} options
+   * @param {number|undefined} options.timeoutId
+   * @param {Request} options.request
+   * @param {Array} options.logs A reference to the logs Array.
+   * @param {Event} options.event
+   * @return {Promise}
+   *
+   * @private
+   */
+  async _getNetworkPromise({
+    timeoutId,
+    request,
+    logs,
+    handler,
+  }: {
+    request: Request;
+    logs: any[];
+    timeoutId?: number;
+    handler: StrategyHandler;
+  }): Promise {
+    let error;
+    let response;
+    try {
+      response = await handler.fetchAndCachePut(request);
+    } catch (fetchError) {
+      if (fetchError instanceof Error) {
+        error = fetchError;
+      }
+    }
+
+    if (timeoutId) {
+      clearTimeout(timeoutId);
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (response) {
+        logs.push(`Got response from network.`);
+      } else {
+        logs.push(
+          `Unable to get a response from the network. Will respond ` +
+            `with a cached response.`,
+        );
+      }
+    }
+
+    if (error || !response) {
+      response = await handler.cacheMatch(request);
+
+      if (process.env.NODE_ENV !== 'production') {
+        if (response) {
+          logs.push(
+            `Found a cached response in the '${this.cacheName}'` + ` cache.`,
+          );
+        } else {
+          logs.push(`No response found in the '${this.cacheName}' cache.`);
+        }
+      }
+    }
+
+    return response;
+  }
+}
+
+export {NetworkFirst};
diff --git a/tools/ui/node_modules/workbox-strategies/src/NetworkOnly.ts b/tools/ui/node_modules/workbox-strategies/src/NetworkOnly.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b129555eeaf87255258b8410f86ba89f33bfeed0
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/NetworkOnly.ts
@@ -0,0 +1,122 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {timeout} from 'workbox-core/_private/timeout.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {Strategy, StrategyOptions} from './Strategy.js';
+import {StrategyHandler} from './StrategyHandler.js';
+import {messages} from './utils/messages.js';
+import './_version.js';
+
+interface NetworkOnlyOptions
+  extends Omit {
+  networkTimeoutSeconds?: number;
+}
+
+/**
+ * An implementation of a
+ * [network-only](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-only)
+ * request strategy.
+ *
+ * This class is useful if you want to take advantage of any
+ * [Workbox plugins](https://developer.chrome.com/docs/workbox/using-plugins/).
+ *
+ * If the network request fails, this will throw a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class NetworkOnly extends Strategy {
+  private readonly _networkTimeoutSeconds: number;
+
+  /**
+   * @param {Object} [options]
+   * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+   * to use in conjunction with this caching strategy.
+   * @param {Object} [options.fetchOptions] Values passed along to the
+   * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+   * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+   * `fetch()` requests made by this strategy.
+   * @param {number} [options.networkTimeoutSeconds] If set, any network requests
+   * that fail to respond within the timeout will result in a network error.
+   */
+  constructor(options: NetworkOnlyOptions = {}) {
+    super(options);
+
+    this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
+  }
+
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-strategies',
+        className: this.constructor.name,
+        funcName: '_handle',
+        paramName: 'request',
+      });
+    }
+
+    let error: Error | undefined = undefined;
+    let response: Response | undefined;
+
+    try {
+      const promises: Promise[] = [
+        handler.fetch(request),
+      ];
+
+      if (this._networkTimeoutSeconds) {
+        const timeoutPromise = timeout(
+          this._networkTimeoutSeconds * 1000,
+        ) as Promise;
+        promises.push(timeoutPromise);
+      }
+
+      response = await Promise.race(promises);
+      if (!response) {
+        throw new Error(
+          `Timed out the network response after ` +
+            `${this._networkTimeoutSeconds} seconds.`,
+        );
+      }
+    } catch (err) {
+      if (err instanceof Error) {
+        error = err;
+      }
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.groupCollapsed(
+        messages.strategyStart(this.constructor.name, request),
+      );
+      if (response) {
+        logger.log(`Got response from network.`);
+      } else {
+        logger.log(`Unable to get a response from the network.`);
+      }
+      messages.printFinalResponse(response);
+      logger.groupEnd();
+    }
+
+    if (!response) {
+      throw new WorkboxError('no-response', {url: request.url, error});
+    }
+    return response;
+  }
+}
+
+export {NetworkOnly, NetworkOnlyOptions};
diff --git a/tools/ui/node_modules/workbox-strategies/src/StaleWhileRevalidate.ts b/tools/ui/node_modules/workbox-strategies/src/StaleWhileRevalidate.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4594941cc24f724708b9c6d536c4f7e1ae83937d
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/StaleWhileRevalidate.ts
@@ -0,0 +1,135 @@
+/*
+  Copyright 2018 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+
+import {cacheOkAndOpaquePlugin} from './plugins/cacheOkAndOpaquePlugin.js';
+import {Strategy, StrategyOptions} from './Strategy.js';
+import {StrategyHandler} from './StrategyHandler.js';
+import {messages} from './utils/messages.js';
+import './_version.js';
+
+/**
+ * An implementation of a
+ * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)
+ * request strategy.
+ *
+ * Resources are requested from both the cache and the network in parallel.
+ * The strategy will respond with the cached version if available, otherwise
+ * wait for the network response. The cache is updated with the network response
+ * with each successful request.
+ *
+ * By default, this strategy will cache responses with a 200 status code as
+ * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
+ * Opaque responses are cross-origin requests where the response doesn't
+ * support [CORS](https://enable-cors.org/).
+ *
+ * If the network request fails, and there is no cache match, this will throw
+ * a `WorkboxError` exception.
+ *
+ * @extends workbox-strategies.Strategy
+ * @memberof workbox-strategies
+ */
+class StaleWhileRevalidate extends Strategy {
+  /**
+   * @param {Object} [options]
+   * @param {string} [options.cacheName] Cache name to store and retrieve
+   * requests. Defaults to cache names provided by
+   * {@link workbox-core.cacheNames}.
+   * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+   * to use in conjunction with this caching strategy.
+   * @param {Object} [options.fetchOptions] Values passed along to the
+   * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+   * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+   * `fetch()` requests made by this strategy.
+   * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
+   */
+  constructor(options: StrategyOptions = {}) {
+    super(options);
+
+    // If this instance contains no plugins with a 'cacheWillUpdate' callback,
+    // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
+    if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
+      this.plugins.unshift(cacheOkAndOpaquePlugin);
+    }
+  }
+
+  /**
+   * @private
+   * @param {Request|string} request A request to run this strategy for.
+   * @param {workbox-strategies.StrategyHandler} handler The event that
+   *     triggered the request.
+   * @return {Promise}
+   */
+  async _handle(request: Request, handler: StrategyHandler): Promise {
+    const logs = [];
+
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(request, Request, {
+        moduleName: 'workbox-strategies',
+        className: this.constructor.name,
+        funcName: 'handle',
+        paramName: 'request',
+      });
+    }
+
+    const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {
+      // Swallow this error because a 'no-response' error will be thrown in
+      // main handler return flow. This will be in the `waitUntil()` flow.
+    });
+    void handler.waitUntil(fetchAndCachePromise);
+
+    let response = await handler.cacheMatch(request);
+
+    let error;
+    if (response) {
+      if (process.env.NODE_ENV !== 'production') {
+        logs.push(
+          `Found a cached response in the '${this.cacheName}'` +
+            ` cache. Will update with the network response in the background.`,
+        );
+      }
+    } else {
+      if (process.env.NODE_ENV !== 'production') {
+        logs.push(
+          `No response found in the '${this.cacheName}' cache. ` +
+            `Will wait for the network response.`,
+        );
+      }
+      try {
+        // NOTE(philipwalton): Really annoying that we have to type cast here.
+        // https://github.com/microsoft/TypeScript/issues/20006
+        response = (await fetchAndCachePromise) as Response | undefined;
+      } catch (err) {
+        if (err instanceof Error) {
+          error = err;
+        }
+      }
+    }
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.groupCollapsed(
+        messages.strategyStart(this.constructor.name, request),
+      );
+      for (const log of logs) {
+        logger.log(log);
+      }
+      messages.printFinalResponse(response);
+      logger.groupEnd();
+    }
+
+    if (!response) {
+      throw new WorkboxError('no-response', {url: request.url, error});
+    }
+    return response;
+  }
+}
+
+export {StaleWhileRevalidate};
diff --git a/tools/ui/node_modules/workbox-strategies/src/Strategy.ts b/tools/ui/node_modules/workbox-strategies/src/Strategy.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5ab8614551d2610b801bb02ca79b115456b20f23
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/Strategy.ts
@@ -0,0 +1,289 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {cacheNames} from 'workbox-core/_private/cacheNames.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {
+  HandlerCallbackOptions,
+  RouteHandlerObject,
+  WorkboxPlugin,
+} from 'workbox-core/types.js';
+
+import {StrategyHandler} from './StrategyHandler.js';
+
+import './_version.js';
+
+export interface StrategyOptions {
+  cacheName?: string;
+  plugins?: WorkboxPlugin[];
+  fetchOptions?: RequestInit;
+  matchOptions?: CacheQueryOptions;
+}
+
+/**
+ * An abstract base class that all other strategy classes must extend from:
+ *
+ * @memberof workbox-strategies
+ */
+abstract class Strategy implements RouteHandlerObject {
+  cacheName: string;
+  plugins: WorkboxPlugin[];
+  fetchOptions?: RequestInit;
+  matchOptions?: CacheQueryOptions;
+
+  protected abstract _handle(
+    request: Request,
+    handler: StrategyHandler,
+  ): Promise;
+
+  /**
+   * Creates a new instance of the strategy and sets all documented option
+   * properties as public instance properties.
+   *
+   * Note: if a custom strategy class extends the base Strategy class and does
+   * not need more than these properties, it does not need to define its own
+   * constructor.
+   *
+   * @param {Object} [options]
+   * @param {string} [options.cacheName] Cache name to store and retrieve
+   * requests. Defaults to the cache names provided by
+   * {@link workbox-core.cacheNames}.
+   * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+   * to use in conjunction with this caching strategy.
+   * @param {Object} [options.fetchOptions] Values passed along to the
+   * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
+   * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
+   * `fetch()` requests made by this strategy.
+   * @param {Object} [options.matchOptions] The
+   * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+   * for any `cache.match()` or `cache.put()` calls made by this strategy.
+   */
+  constructor(options: StrategyOptions = {}) {
+    /**
+     * Cache name to store and retrieve
+     * requests. Defaults to the cache names provided by
+     * {@link workbox-core.cacheNames}.
+     *
+     * @type {string}
+     */
+    this.cacheName = cacheNames.getRuntimeName(options.cacheName);
+    /**
+     * The list
+     * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
+     * used by this strategy.
+     *
+     * @type {Array}
+     */
+    this.plugins = options.plugins || [];
+    /**
+     * Values passed along to the
+     * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
+     * of all fetch() requests made by this strategy.
+     *
+     * @type {Object}
+     */
+    this.fetchOptions = options.fetchOptions;
+    /**
+     * The
+     * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
+     * for any `cache.match()` or `cache.put()` calls made by this strategy.
+     *
+     * @type {Object}
+     */
+    this.matchOptions = options.matchOptions;
+  }
+
+  /**
+   * Perform a request strategy and returns a `Promise` that will resolve with
+   * a `Response`, invoking all relevant plugin callbacks.
+   *
+   * When a strategy instance is registered with a Workbox
+   * {@link workbox-routing.Route}, this method is automatically
+   * called when the route matches.
+   *
+   * Alternatively, this method can be used in a standalone `FetchEvent`
+   * listener by passing it to `event.respondWith()`.
+   *
+   * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+   *     properties listed below.
+   * @param {Request|string} options.request A request to run this strategy for.
+   * @param {ExtendableEvent} options.event The event associated with the
+   *     request.
+   * @param {URL} [options.url]
+   * @param {*} [options.params]
+   */
+  handle(options: FetchEvent | HandlerCallbackOptions): Promise {
+    const [responseDone] = this.handleAll(options);
+    return responseDone;
+  }
+
+  /**
+   * Similar to {@link workbox-strategies.Strategy~handle}, but
+   * instead of just returning a `Promise` that resolves to a `Response` it
+   * it will return an tuple of `[response, done]` promises, where the former
+   * (`response`) is equivalent to what `handle()` returns, and the latter is a
+   * Promise that will resolve once any promises that were added to
+   * `event.waitUntil()` as part of performing the strategy have completed.
+   *
+   * You can await the `done` promise to ensure any extra work performed by
+   * the strategy (usually caching responses) completes successfully.
+   *
+   * @param {FetchEvent|Object} options A `FetchEvent` or an object with the
+   *     properties listed below.
+   * @param {Request|string} options.request A request to run this strategy for.
+   * @param {ExtendableEvent} options.event The event associated with the
+   *     request.
+   * @param {URL} [options.url]
+   * @param {*} [options.params]
+   * @return {Array} A tuple of [response, done]
+   *     promises that can be used to determine when the response resolves as
+   *     well as when the handler has completed all its work.
+   */
+  handleAll(
+    options: FetchEvent | HandlerCallbackOptions,
+  ): [Promise, Promise] {
+    // Allow for flexible options to be passed.
+    if (options instanceof FetchEvent) {
+      options = {
+        event: options,
+        request: options.request,
+      };
+    }
+
+    const event = options.event;
+    const request =
+      typeof options.request === 'string'
+        ? new Request(options.request)
+        : options.request;
+    const params = 'params' in options ? options.params : undefined;
+
+    const handler = new StrategyHandler(this, {event, request, params});
+
+    const responseDone = this._getResponse(handler, request, event);
+    const handlerDone = this._awaitComplete(
+      responseDone,
+      handler,
+      request,
+      event,
+    );
+
+    // Return an array of promises, suitable for use with Promise.all().
+    return [responseDone, handlerDone];
+  }
+
+  async _getResponse(
+    handler: StrategyHandler,
+    request: Request,
+    event: ExtendableEvent,
+  ): Promise {
+    await handler.runCallbacks('handlerWillStart', {event, request});
+
+    let response: Response | undefined = undefined;
+    try {
+      response = await this._handle(request, handler);
+      // The "official" Strategy subclasses all throw this error automatically,
+      // but in case a third-party Strategy doesn't, ensure that we have a
+      // consistent failure when there's no response or an error response.
+      if (!response || response.type === 'error') {
+        throw new WorkboxError('no-response', {url: request.url});
+      }
+    } catch (error) {
+      if (error instanceof Error) {
+        for (const callback of handler.iterateCallbacks('handlerDidError')) {
+          response = await callback({error, event, request});
+          if (response) {
+            break;
+          }
+        }
+      }
+
+      if (!response) {
+        throw error;
+      } else if (process.env.NODE_ENV !== 'production') {
+        logger.log(
+          `While responding to '${getFriendlyURL(request.url)}', ` +
+            `an ${
+              error instanceof Error ? error.toString() : ''
+            } error occurred. Using a fallback response provided by ` +
+            `a handlerDidError plugin.`,
+        );
+      }
+    }
+
+    for (const callback of handler.iterateCallbacks('handlerWillRespond')) {
+      response = await callback({event, request, response});
+    }
+
+    return response;
+  }
+
+  async _awaitComplete(
+    responseDone: Promise,
+    handler: StrategyHandler,
+    request: Request,
+    event: ExtendableEvent,
+  ): Promise {
+    let response;
+    let error;
+
+    try {
+      response = await responseDone;
+    } catch (error) {
+      // Ignore errors, as response errors should be caught via the `response`
+      // promise above. The `done` promise will only throw for errors in
+      // promises passed to `handler.waitUntil()`.
+    }
+
+    try {
+      await handler.runCallbacks('handlerDidRespond', {
+        event,
+        request,
+        response,
+      });
+      await handler.doneWaiting();
+    } catch (waitUntilError) {
+      if (waitUntilError instanceof Error) {
+        error = waitUntilError;
+      }
+    }
+
+    await handler.runCallbacks('handlerDidComplete', {
+      event,
+      request,
+      response,
+      error: error as Error,
+    });
+    handler.destroy();
+
+    if (error) {
+      throw error;
+    }
+  }
+}
+
+export {Strategy};
+
+/**
+ * Classes extending the `Strategy` based class should implement this method,
+ * and leverage the {@link workbox-strategies.StrategyHandler}
+ * arg to perform all fetching and cache logic, which will ensure all relevant
+ * cache, cache options, fetch options and plugins are used (per the current
+ * strategy instance).
+ *
+ * @name _handle
+ * @instance
+ * @abstract
+ * @function
+ * @param {Request} request
+ * @param {workbox-strategies.StrategyHandler} handler
+ * @return {Promise}
+ *
+ * @memberof workbox-strategies.Strategy
+ */
diff --git a/tools/ui/node_modules/workbox-strategies/src/StrategyHandler.ts b/tools/ui/node_modules/workbox-strategies/src/StrategyHandler.ts
new file mode 100644
index 0000000000000000000000000000000000000000..56c60bcae23ede5b8532076089fd0023883086e3
--- /dev/null
+++ b/tools/ui/node_modules/workbox-strategies/src/StrategyHandler.ts
@@ -0,0 +1,640 @@
+/*
+  Copyright 2020 Google LLC
+
+  Use of this source code is governed by an MIT-style
+  license that can be found in the LICENSE file or at
+  https://opensource.org/licenses/MIT.
+*/
+
+import {assert} from 'workbox-core/_private/assert.js';
+import {cacheMatchIgnoreParams} from 'workbox-core/_private/cacheMatchIgnoreParams.js';
+import {Deferred} from 'workbox-core/_private/Deferred.js';
+import {executeQuotaErrorCallbacks} from 'workbox-core/_private/executeQuotaErrorCallbacks.js';
+import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js';
+import {logger} from 'workbox-core/_private/logger.js';
+import {timeout} from 'workbox-core/_private/timeout.js';
+import {WorkboxError} from 'workbox-core/_private/WorkboxError.js';
+import {
+  HandlerCallbackOptions,
+  MapLikeObject,
+  WorkboxPlugin,
+  WorkboxPluginCallbackParam,
+} from 'workbox-core/types.js';
+
+import {Strategy} from './Strategy.js';
+import './_version.js';
+
+function toRequest(input: RequestInfo) {
+  return typeof input === 'string' ? new Request(input) : input;
+}
+
+/**
+ * A class created every time a Strategy instance calls
+ * {@link workbox-strategies.Strategy~handle} or
+ * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and
+ * cache actions around plugin callbacks and keeps track of when the strategy
+ * is "done" (i.e. all added `event.waitUntil()` promises have resolved).
+ *
+ * @memberof workbox-strategies
+ */
+class StrategyHandler {
+  public request!: Request;
+  public url?: URL;
+  public event: ExtendableEvent;
+  public params?: any;
+
+  private _cacheKeys: Record = {};
+
+  private readonly _strategy: Strategy;
+  private readonly _extendLifetimePromises: Promise[];
+  private readonly _handlerDeferred: Deferred;
+  private readonly _plugins: WorkboxPlugin[];
+  private readonly _pluginStateMap: Map;
+
+  /**
+   * Creates a new instance associated with the passed strategy and event
+   * that's handling the request.
+   *
+   * The constructor also initializes the state that will be passed to each of
+   * the plugins handling this request.
+   *
+   * @param {workbox-strategies.Strategy} strategy
+   * @param {Object} options
+   * @param {Request|string} options.request A request to run this strategy for.
+   * @param {ExtendableEvent} options.event The event associated with the
+   *     request.
+   * @param {URL} [options.url]
+   * @param {*} [options.params] The return value from the
+   *     {@link workbox-routing~matchCallback} (if applicable).
+   */
+  constructor(strategy: Strategy, options: HandlerCallbackOptions) {
+    /**
+     * The request the strategy is performing (passed to the strategy's
+     * `handle()` or `handleAll()` method).
+     * @name request
+     * @instance
+     * @type {Request}
+     * @memberof workbox-strategies.StrategyHandler
+     */
+    /**
+     * The event associated with this request.
+     * @name event
+     * @instance
+     * @type {ExtendableEvent}
+     * @memberof workbox-strategies.StrategyHandler
+     */
+    /**
+     * A `URL` instance of `request.url` (if passed to the strategy's
+     * `handle()` or `handleAll()` method).
+     * Note: the `url` param will be present if the strategy was invoked
+     * from a workbox `Route` object.
+     * @name url
+     * @instance
+     * @type {URL|undefined}
+     * @memberof workbox-strategies.StrategyHandler
+     */
+    /**
+     * A `param` value (if passed to the strategy's
+     * `handle()` or `handleAll()` method).
+     * Note: the `param` param will be present if the strategy was invoked
+     * from a workbox `Route` object and the
+     * {@link workbox-routing~matchCallback} returned
+     * a truthy value (it will be that value).
+     * @name params
+     * @instance
+     * @type {*|undefined}
+     * @memberof workbox-strategies.StrategyHandler
+     */
+    if (process.env.NODE_ENV !== 'production') {
+      assert!.isInstance(options.event, ExtendableEvent, {
+        moduleName: 'workbox-strategies',
+        className: 'StrategyHandler',
+        funcName: 'constructor',
+        paramName: 'options.event',
+      });
+    }
+
+    Object.assign(this, options);
+
+    this.event = options.event;
+    this._strategy = strategy;
+    this._handlerDeferred = new Deferred();
+    this._extendLifetimePromises = [];
+
+    // Copy the plugins list (since it's mutable on the strategy),
+    // so any mutations don't affect this handler instance.
+    this._plugins = [...strategy.plugins];
+    this._pluginStateMap = new Map();
+    for (const plugin of this._plugins) {
+      this._pluginStateMap.set(plugin, {});
+    }
+
+    this.event.waitUntil(this._handlerDeferred.promise);
+  }
+
+  /**
+   * Fetches a given request (and invokes any applicable plugin callback
+   * methods) using the `fetchOptions` (for non-navigation requests) and
+   * `plugins` defined on the `Strategy` object.
+   *
+   * The following plugin lifecycle methods are invoked when using this method:
+   * - `requestWillFetch()`
+   * - `fetchDidSucceed()`
+   * - `fetchDidFail()`
+   *
+   * @param {Request|string} input The URL or request to fetch.
+   * @return {Promise}
+   */
+  async fetch(input: RequestInfo): Promise {
+    const {event} = this;
+    let request: Request = toRequest(input);
+
+    if (
+      request.mode === 'navigate' &&
+      event instanceof FetchEvent &&
+      event.preloadResponse
+    ) {
+      const possiblePreloadResponse = (await event.preloadResponse) as
+        | Response
+        | undefined;
+      if (possiblePreloadResponse) {
+        if (process.env.NODE_ENV !== 'production') {
+          logger.log(
+            `Using a preloaded navigation response for ` +
+              `'${getFriendlyURL(request.url)}'`,
+          );
+        }
+        return possiblePreloadResponse;
+      }
+    }
+
+    // If there is a fetchDidFail plugin, we need to save a clone of the
+    // original request before it's either modified by a requestWillFetch
+    // plugin or before the original request's body is consumed via fetch().
+    const originalRequest = this.hasCallback('fetchDidFail')
+      ? request.clone()
+      : null;
+
+    try {
+      for (const cb of this.iterateCallbacks('requestWillFetch')) {
+        request = await cb({request: request.clone(), event});
+      }
+    } catch (err) {
+      if (err instanceof Error) {
+        throw new WorkboxError('plugin-error-request-will-fetch', {
+          thrownErrorMessage: err.message,
+        });
+      }
+    }
+
+    // The request can be altered by plugins with `requestWillFetch` making
+    // the original request (most likely from a `fetch` event) different
+    // from the Request we make. Pass both to `fetchDidFail` to aid debugging.
+    const pluginFilteredRequest: Request = request.clone();
+
+    try {
+      let fetchResponse: Response;
+
+      // See https://github.com/GoogleChrome/workbox/issues/1796
+      fetchResponse = await fetch(
+        request,
+        request.mode === 'navigate' ? undefined : this._strategy.fetchOptions,
+      );
+
+      if (process.env.NODE_ENV !== 'production') {
+        logger.debug(
+          `Network request for ` +
+            `'${getFriendlyURL(request.url)}' returned a response with ` +
+            `status '${fetchResponse.status}'.`,
+        );
+      }
+
+      for (const callback of this.iterateCallbacks('fetchDidSucceed')) {
+        fetchResponse = await callback({
+          event,
+          request: pluginFilteredRequest,
+          response: fetchResponse,
+        });
+      }
+      return fetchResponse;
+    } catch (error) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.log(
+          `Network request for ` +
+            `'${getFriendlyURL(request.url)}' threw an error.`,
+          error,
+        );
+      }
+
+      // `originalRequest` will only exist if a `fetchDidFail` callback
+      // is being used (see above).
+      if (originalRequest) {
+        await this.runCallbacks('fetchDidFail', {
+          error: error as Error,
+          event,
+          originalRequest: originalRequest.clone(),
+          request: pluginFilteredRequest.clone(),
+        });
+      }
+      throw error;
+    }
+  }
+
+  /**
+   * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on
+   * the response generated by `this.fetch()`.
+   *
+   * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,
+   * so you do not have to manually call `waitUntil()` on the event.
+   *
+   * @param {Request|string} input The request or URL to fetch and cache.
+   * @return {Promise}
+   */
+  async fetchAndCachePut(input: RequestInfo): Promise {
+    const response = await this.fetch(input);
+    const responseClone = response.clone();
+
+    void this.waitUntil(this.cachePut(input, responseClone));
+
+    return response;
+  }
+
+  /**
+   * Matches a request from the cache (and invokes any applicable plugin
+   * callback methods) using the `cacheName`, `matchOptions`, and `plugins`
+   * defined on the strategy object.
+   *
+   * The following plugin lifecycle methods are invoked when using this method:
+   * - cacheKeyWillBeUsed()
+   * - cachedResponseWillBeUsed()
+   *
+   * @param {Request|string} key The Request or URL to use as the cache key.
+   * @return {Promise} A matching response, if found.
+   */
+  async cacheMatch(key: RequestInfo): Promise {
+    const request: Request = toRequest(key);
+    let cachedResponse: Response | undefined;
+    const {cacheName, matchOptions} = this._strategy;
+
+    const effectiveRequest = await this.getCacheKey(request, 'read');
+    const multiMatchOptions = {...matchOptions, ...{cacheName}};
+
+    cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (cachedResponse) {
+        logger.debug(`Found a cached response in '${cacheName}'.`);
+      } else {
+        logger.debug(`No cached response found in '${cacheName}'.`);
+      }
+    }
+
+    for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {
+      cachedResponse =
+        (await callback({
+          cacheName,
+          matchOptions,
+          cachedResponse,
+          request: effectiveRequest,
+          event: this.event,
+        })) || undefined;
+    }
+    return cachedResponse;
+  }
+
+  /**
+   * Puts a request/response pair in the cache (and invokes any applicable
+   * plugin callback methods) using the `cacheName` and `plugins` defined on
+   * the strategy object.
+   *
+   * The following plugin lifecycle methods are invoked when using this method:
+   * - cacheKeyWillBeUsed()
+   * - cacheWillUpdate()
+   * - cacheDidUpdate()
+   *
+   * @param {Request|string} key The request or URL to use as the cache key.
+   * @param {Response} response The response to cache.
+   * @return {Promise} `false` if a cacheWillUpdate caused the response
+   * not be cached, and `true` otherwise.
+   */
+  async cachePut(key: RequestInfo, response: Response): Promise {
+    const request: Request = toRequest(key);
+
+    // Run in the next task to avoid blocking other cache reads.
+    // https://github.com/w3c/ServiceWorker/issues/1397
+    await timeout(0);
+
+    const effectiveRequest = await this.getCacheKey(request, 'write');
+
+    if (process.env.NODE_ENV !== 'production') {
+      if (effectiveRequest.method && effectiveRequest.method !== 'GET') {
+        throw new WorkboxError('attempt-to-cache-non-get-request', {
+          url: getFriendlyURL(effectiveRequest.url),
+          method: effectiveRequest.method,
+        });
+      }
+
+      // See https://github.com/GoogleChrome/workbox/issues/2818
+      const vary = response.headers.get('Vary');
+      if (vary) {
+        logger.debug(
+          `The response for ${getFriendlyURL(effectiveRequest.url)} ` +
+            `has a 'Vary: ${vary}' header. ` +
+            `Consider setting the {ignoreVary: true} option on your strategy ` +
+            `to ensure cache matching and deletion works as expected.`,
+        );
+      }
+    }
+
+    if (!response) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.error(
+          `Cannot cache non-existent response for ` +
+            `'${getFriendlyURL(effectiveRequest.url)}'.`,
+        );
+      }
+
+      throw new WorkboxError('cache-put-with-no-response', {
+        url: getFriendlyURL(effectiveRequest.url),
+      });
+    }
+
+    const responseToCache = await this._ensureResponseSafeToCache(response);
+
+    if (!responseToCache) {
+      if (process.env.NODE_ENV !== 'production') {
+        logger.debug(
+          `Response '${getFriendlyURL(effectiveRequest.url)}' ` +
+            `will not be cached.`,
+          responseToCache,
+        );
+      }
+      return false;
+    }
+
+    const {cacheName, matchOptions} = this._strategy;
+    const cache = await self.caches.open(cacheName);
+
+    const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');
+    const oldResponse = hasCacheUpdateCallback
+      ? await cacheMatchIgnoreParams(
+          // TODO(philipwalton): the `__WB_REVISION__` param is a precaching
+          // feature. Consider into ways to only add this behavior if using
+          // precaching.
+          cache,
+          effectiveRequest.clone(),
+          ['__WB_REVISION__'],
+          matchOptions,
+        )
+      : null;
+
+    if (process.env.NODE_ENV !== 'production') {
+      logger.debug(
+        `Updating the '${cacheName}' cache with a new Response ` +
+          `for ${getFriendlyURL(effectiveRequest.url)}.`,
+      );
+    }
+
+    try {
+      await cache.put(
+        effectiveRequest,
+        hasCacheUpdateCallback ? responseToCache.clone() : responseToCache,
+      );
+    } catch (error) {
+      if (error instanceof Error) {
+        // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError
+        if (error.name === 'QuotaExceededError') {
+          await executeQuotaErrorCallbacks();
+        }
+        throw error;
+      }
+    }
+
+    for (const callback of this.iterateCallbacks('cacheDidUpdate')) {
+      await callback({
+        cacheName,
+        oldResponse,
+        newResponse: responseToCache.clone(),
+        request: effectiveRequest,
+        event: this.event,
+      });
+    }
+
+    return true;
+  }
+
+  /**
+   * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and
+   * executes any of those callbacks found in sequence. The final `Request`
+   * object returned by the last plugin is treated as the cache key for cache
+   * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have
+   * been registered, the passed request is returned unmodified
+   *
+   * @param {Request} request
+   * @param {string} mode
+   * @return {Promise}
+   */
+  async getCacheKey(
+    request: Request,
+    mode: 'read' | 'write',
+  ): Promise {
+    const key = `${request.url} | ${mode}`;
+    if (!this._cacheKeys[key]) {
+      let effectiveRequest = request;
+
+      for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {
+        effectiveRequest = toRequest(
+          await callback({
+            mode,
+            request: effectiveRequest,
+            event: this.event,
+            // params has a type any can't change right now.
+            params: this.params, // eslint-disable-line
+          }),
+        );
+      }
+
+      this._cacheKeys[key] = effectiveRequest;
+    }
+    return this._cacheKeys[key];
+  }
+
+  /**
+   * Returns true if the strategy has at least one plugin with the given
+   * callback.
+   *
+   * @param {string} name The name of the callback to check for.
+   * @return {boolean}
+   */
+  hasCallback(name: C): boolean {
+    for (const plugin of this._strategy.plugins) {
+      if (name in plugin) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Runs all plugin callbacks matching the given name, in order, passing the
+   * given param object (merged ith the current plugin state) as the only
+   * argument.
+   *
+   * Note: since this method runs all plugins, it's not suitable for cases
+   * where the return value of a callback needs to be applied prior to calling
+   * the next callback. See
+   * {@link workbox-strategies.StrategyHandler#iterateCallbacks}
+   * below for how to handle that case.
+   *
+   * @param {string} name The name of the callback to run within each plugin.
+   * @param {Object} param The object to pass as the first (and only) param
+   *     when executing each callback. This object will be merged with the
+   *     current plugin state prior to callback execution.
+   */
+  async runCallbacks>(
+    name: C,
+    param: Omit,
+  ): Promise {
+    for (const callback of this.iterateCallbacks(name)) {
+      // TODO(philipwalton): not sure why `any` is needed. It seems like
+      // this should work with `as WorkboxPluginCallbackParam[C]`.
+      await callback(param as any);
+    }
+  }
+
+  /**
+   * Accepts a callback and returns an iterable of matching plugin callbacks,
+   * where each callback is wrapped with the current handler state (i.e. when
+   * you call each callback, whatever object parameter you pass it will
+   * be merged with the plugin's current state).
+   *
+   * @param {string} name The name fo the callback to run
+   * @return {Array}
+   */
+  *iterateCallbacks(
+    name: C,
+  ): Generator> {
+    for (const plugin of this._strategy.plugins) {
+      if (typeof plugin[name] === 'function') {
+        const state = this._pluginStateMap.get(plugin);
+        const statefulCallback = (
+          param: Omit,
+        ) => {
+          const statefulParam = {...param, state};
+
+          // TODO(philipwalton): not sure why `any` is needed. It seems like
+          // this should work with `as WorkboxPluginCallbackParam[C]`.
+          return plugin[name]!(statefulParam as any);
+        };
+        yield statefulCallback as NonNullable;
+      }
+    }
+  }
+
+  /**
+   * Adds a promise to the
+   * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}
+   * of the event associated with the request being handled (usually a
+   * `FetchEvent`).
+   *
+   * Note: you can await
+   * {@link workbox-strategies.StrategyHandler~doneWaiting}
+   * to know when all added promises have settled.
+   *
+   * @param {Promise} promise A promise to add to the extend lifetime promises
+   *     of the event that triggered the request.
+   */
+  waitUntil(promise: Promise): Promise {
+    this._extendLifetimePromises.push(promise);
+    return promise;
+  }
+
+  /**
+   * Returns a promise that resolves once all promises passed to
+   * {@link workbox-strategies.StrategyHandler~waitUntil}
+   * have settled.
+   *
+   * Note: any work done after `doneWaiting()` settles should be manually
+   * passed to an event's `waitUntil()` method (not this handler's
+   * `waitUntil()` method), otherwise the service worker thread may be killed
+   * prior to your work completing.
+   */
+  async doneWaiting(): Promise {
+    while (this._extendLifetimePromises.length) {
+      const promises = this._extendLifetimePromises.splice(0);
+      const result = await Promise.allSettled(promises);
+      const firstRejection = result.find((i) => i.status === 'rejected');
+      if (firstRejection) {
+        throw (firstRejection as PromiseRejectedResult).reason;
+      }
+    }
+  }
+
+  /**
+   * Stops running the strategy and immediately resolves any pending
+   * `waitUntil()` promises.
+   */
+  destroy(): void {
+    this._handlerDeferred.resolve(null);
+  }
+
+  /**
+   * This method will call cacheWillUpdate on the available plugins (or use
+   * status === 200) to determine if the Response is safe and valid to cache.
+   *
+   * @param {Request} options.request
+   * @param {Response} options.response
+   * @return {Promise}
+   *
+   * @private
+   */
+  async _ensureResponseSafeToCache(
+    response: Response,
+  ): Promise {
+    let responseToCache: Response | undefined = response;
+    let pluginsUsed = false;
+
+    for (const callback of this.iterateCallbacks('cacheWillUpdate')) {
+      responseToCache =
+        (await callback({
+          request: this.request,
+          response: responseToCache,
+          event: this.event,
+        })) || undefined;
+      pluginsUsed = true;
+
+      if (!responseToCache) {
+        break;
+      }
+    }
+
+    if (!pluginsUsed) {
+      if (responseToCache && responseToCache.status !== 200) {
+        responseToCache = undefined;
+      }
+      if (process.env.NODE_ENV !== 'production') {
+        if (responseToCache) {
+          if (responseToCache.status !== 200) {
+            if (responseToCache.status === 0) {
+              logger.warn(
+                `The response for '${this.request.url}' ` +
+                  `is an opaque response. The caching strategy that you're ` +
+                  `using will not cache opaque responses by default.`,
+              );
+            } else {
+              logger.debug(
+                `The response for '${this.request.url}' ` +
+                  `returned a status code of '${response.status}' and won't ` +
+                  `be cached as a result.`,
+              );
+            }
+          }
+        }
+      }
+    }
+
+    return responseToCache;
+  }
+}
+
+export {StrategyHandler};